vtf-logo

InitialCondition.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 // Copyright (C) 2002 Ralf Deiterding
00004 // Brandenburgische Universitaet Cottbus
00005 //
00006 // Copyright (C) 2003-2007 California Institute of Technology
00007 // Ralf Deiterding, ralf@amroc.net
00008 
00009 #ifndef AMROC_INITIALCONDITION_H
00010 #define AMROC_INITIALCONDITION_H
00011 
00019 #include <string>
00020 #include "AMRBase.h"
00021 
00028 template <class VectorType, int dim>
00029 class InitialCondition : public AMRBase<VectorType,dim> {
00030   typedef AMRBase<VectorType,dim> base;
00031   typedef typename VectorType::InternalDataType DataType;
00032 public:
00033   typedef typename base::vec_grid_fct_type vec_grid_fct_type;  
00034   typedef typename base::vec_grid_data_type vec_grid_data_type;
00035   typedef GridFunction<DataType,dim> grid_fct_type;
00036   typedef GridData<DataType,dim> grid_data_type;
00037 
00038   InitialCondition() : base() {}
00039 
00040   virtual ~InitialCondition() {}
00041 
00042   //******************************************************************************
00043   // Abstract class interface
00044   //******************************************************************************
00045   virtual void SetGrid(vec_grid_data_type& gd, const int& level) = 0;   
00046   //******************************************************************************
00047 
00048   virtual void register_at(ControlDevice& Ctrl, const std::string& prefix) {
00049     base::LocCtrl = Ctrl.getSubDevice(prefix+"InitialCondition");
00050   }
00051   virtual void register_at(ControlDevice& Ctrl) {
00052     register_at(Ctrl, "");
00053   }
00054 
00055   virtual void Set(vec_grid_fct_type& u, grid_fct_type& work, const int Level) { 
00056     SetPhysicalTime(u,0,Level,0.0);
00057     forall (u,0,Level,c)
00058       SetGrid(u(0,Level,c),Level);    
00059     end_forall
00060   }
00061 };
00062 
00063 
00064 #endif

Generated on Fri Aug 24 13:00:51 2007 for AMROC Fluid-solver Framework - by  doxygen 1.4.7