00001
00002
00003
00004
00005
00006 #ifndef AMROC_PROBLEM_H
00007 #define AMROC_PROBLEM_H
00008
00009 #include "eulerznd3.h"
00010 #include "ClpProblem.h"
00011
00012 #define f_track FORTRAN_NAME(track, TRACK)
00013 #define f_lsetrfl FORTRAN_NAME(lsrfl, LSRFL)
00014 #define f_lsetrdi FORTRAN_NAME(lsrdi, LSRDI)
00015
00016 extern "C" {
00017 void f_track(const INTEGER &, const DOUBLE *, const DOUBLE *, DOUBLE *, INTEGER&,
00018 const DOUBLE&, const DOUBLE&, const DOUBLE&);
00019 void f_lsetrfl();
00020 void f_lsetrdi();
00021 }
00022
00023 #define OWN_GFMAMRSOLVER
00024 #include "ClpStdGFMProblem.h"
00025 #include "AMRGFMInterpolation.h"
00026
00027 class SolverSpecific :
00028 public AMRGFMSolver<VectorType,FixupType,FlagType,DIM> {
00029 typedef VectorType::InternalDataType DataType;
00030 typedef AMRGFMSolver<VectorType,FixupType,FlagType,DIM> base;
00031 typedef AMRGFMInterpolation<VectorType,FixupType,FlagType,DIM> interpolation_type;
00032 typedef interpolation_type::point_type point_type;
00033 typedef F77GFMFileOutput<VectorType,FixupType,FlagType,DIM> output_type;
00034 public:
00035 SolverSpecific(IntegratorSpecific& integ,
00036 base::initial_condition_type& init,
00037 base::boundary_conditions_type& bc) : base(integ, init, bc) {
00038 SetLevelTransfer(new F77LevelTransfer<VectorType,DIM>(f_prolong, f_restrict));
00039 #ifdef f_flgout
00040 SetFileOutput(new F77GFMFileOutput<VectorType,FixupType,FlagType,DIM>(*this,f_flgout));
00041 #else
00042 SetFileOutput(new GFMFileOutput<VectorType,FixupType,FlagType,DIM>(*this));
00043 #endif
00044 SetFixup(new FixupSpecific(integ));
00045 SetFlagging(new FlaggingSpecific(*this));
00046 AddGFM(new GhostFluidMethod<VectorType,DIM>(
00047 new F77GFMBoundary<VectorType,DIM>(f_ibndex,f_itrans),
00048 new F77GFMLevelSet<DataType,DIM>(f_lset)));
00049 AddGFM(new GhostFluidMethod<VectorType,DIM>(
00050 new F77GFMBoundary<VectorType,DIM>(f_ibndrfl,f_itrans),
00051 new F77GFMLevelSet<DataType,DIM>(f_lsetrdi)));
00052 AddGFM(new GhostFluidMethod<VectorType,DIM>(
00053 new F77GFMBoundary<VectorType,DIM>(f_ibndrfl,f_itrans),
00054 new F77GFMLevelSet<DataType,DIM>(f_lsetrfl)));
00055 _Interpolation = new interpolation_type(*this);
00056 }
00057
00058 ~SolverSpecific() {
00059 DeleteGFM(_GFM[0]);
00060 DeleteGFM(_GFM[1]);
00061 DeleteGFM(_GFM[2]);
00062 delete _Flagging;
00063 delete _Fixup;
00064 delete _Interpolation;
00065 }
00066
00067 virtual void SetupData() {
00068 base::SetupData();
00069 _Interpolation->SetupData(base::PGH(), base::NGhosts());
00070 }
00071
00072 virtual double Tick(int VariableTimeStepping, const double dtv[], const double cflv[],
00073 int& Rejections) {
00074
00075 double cfl = base::Tick(VariableTimeStepping, dtv, cflv, Rejections);
00076 return cfl;
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 }
00148
00149 protected:
00150 interpolation_type* _Interpolation;