AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

amr_main.C

Go to the documentation of this file.
00001 
00006 #include "Problem.h"
00007 
00008 #if ! defined __PGI
00009 # if defined(LINUX_387_DOUBLE) || defined(LINUX_387_EXTENDED)
00010 #  include <fpu_control.h>
00011 # endif
00012 #endif
00013 
00014 extern "C" {
00015 extern int chdir(const char *);
00016 }
00017 
00018 #ifdef DEBUG_PRINT_BKT_MEMORY
00019 #include "DAGHMemoryTrace.h"
00020 DAGHMemoryTrace DAGHMemory;
00021 #endif
00022 
00023 int main(int argc, char *argv[]) {
00024 
00025 #if ! defined __PGI
00026 # if defined(LINUX_387_DOUBLE) || defined(LINUX_387_EXTENDED)
00027   fpu_control_t cw;
00028   _FPU_GETCW(cw);
00029   cw &=  ~(_FPU_EXTENDED | _FPU_DOUBLE | _FPU_SINGLE);
00030   // cw &=  ~(_FPU_EXTENDED | _FPU_DOUBLE | _FPU_SINGLE | _FPU_MASK_ZM );
00031 #  ifdef LINUX_387_DOUBLE
00032   cw |= _FPU_DOUBLE;
00033 #  else
00034   cw |= _FPU_EXTENDED;
00035 #  endif
00036   _FPU_SETCW(cw);
00037 # endif
00038 #endif
00039    
00040 #ifndef DAGH_NO_MPI
00041   cout << "Initializing MPI\n" << flush;  
00042   MPI_Init( &argc, &argv );
00043 #endif  
00044 
00045   if (argc>1 && strlen(argv[1])>0)
00046     chdir((const char *)argv[1]);
00047 
00048   IntegratorSpecific TheIntegrator;
00049   InitialConditionSpecific TheInitialCondition;
00050   BoundaryConditionsSpecific TheBoundaryCondition;
00051   SolverSpecific TheSolver(TheIntegrator, TheInitialCondition, TheBoundaryCondition);
00052   SolverControlSpecific TheSolverControl(TheSolver);
00053   TheSolverControl.init();
00054 
00055   ControlDevice SolverCtrl(GetFileControlDevice("solver.in",""));
00056   TheSolver.register_at(SolverCtrl,"");
00057   TheSolverControl.register_at(SolverCtrl,"");
00058   SolverCtrl.update();   
00059   TheSolverControl.update();
00060 
00061   TheSolverControl.Solve();
00062 
00063   TheSolverControl.finish();
00064 }         
00065      
00066    
00067 
00068 


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04