00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _CARTESIANCS_H_ 00012 #define _CARTESIANCS_H_ 00013 00014 #include "NewFourthOrderCoordSys.H" 00015 00016 00017 #include "NamespaceHeader.H" 00018 00019 /// Basic (possibly stretched) Cartesian fourth-order oordinate system 00020 /** 00021 The CartesianCS class implements the NewFourthOrderCoordSys class 00022 for Cartesian mappings 00023 */ 00024 class CartesianCS : public NewFourthOrderCoordSys 00025 { 00026 public: 00027 CartesianCS() 00028 { 00029 } 00030 00031 /// constructor 00032 CartesianCS(const RealVect& a_dX, 00033 const RealVect& a_origin = RealVect::Zero, 00034 const RealVect& a_stretch = RealVect::Unit); 00035 00036 /** 00037 Destructor. 00038 */ 00039 virtual ~CartesianCS(); 00040 00041 /// given coordinate in mapped space, return its location in real space 00042 RealVect realCoord(const RealVect& a_X) const; 00043 00044 /// given coordinate in real space, return its location in the mapped space 00045 RealVect mappedCoord(const RealVect& a_x) const; 00046 00047 // Calculate the derivative of each coordinate vector 00048 virtual Real dXdXi(const RealVect& a_Xi, int a_dirX, int a_dirXi) const; 00049 00050 protected: 00051 // Allow for translations 00052 RealVect m_origin; 00053 // allows for stretched Cartesian grids 00054 RealVect m_stretch; 00055 00056 }; 00057 00058 00059 /// factory for CartesianCS 00060 /** 00061 */ 00062 class 00063 CartesianCSFactory : public NewCoordSysFactory 00064 { 00065 00066 public: 00067 /// constructor 00068 CartesianCSFactory(const RealVect& a_origin = RealVect::Zero, 00069 const RealVect& a_stretch = RealVect::Unit); 00070 00071 /// 00072 virtual NewCoordSys* getCoordSys(const ProblemDomain& a_domain, 00073 const RealVect& a_dx) const; 00074 00075 protected: 00076 00077 /// 00078 RealVect m_origin; 00079 /// 00080 RealVect m_stretch; 00081 }; 00082 00083 00084 #include "NamespaceFooter.H" 00085 00086 #endif
1.5.5