Main Page | User's guide | Class Hierarchy | Class List | File List | Class Members

baseclass.hxx

00001 // Copyright (C) 2002-2004 Vivien Mallet
00002 //
00003 // This file is part of Multivac library.
00004 // Multivac library provides front-tracking algorithms.
00005 // 
00006 // Multivac is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 2 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // Multivac is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License (file "license") for more details.
00015 //
00016 // For more information, please see the Multivac home page:
00017 //     http://spacetown.free.fr/fronts/
00018 
00019 
00020 #ifndef FILE_UPDATER_BASECLASS_HXX
00021 
00022 
00023 #include "../errors.cxx"
00024 #include <stdio.h>
00025 
00026 
00027 namespace Multivac
00028 {
00029 
00030 
00032   // CLASS DECLARATIONS //
00034 
00035   template <class T>
00036   class CFastMarchingNode;
00037 
00038 
00040   // CUPDATER //
00042 
00045 
00051   template <class T>
00052   class CUpdater
00053   {
00054 
00055 
00056     /***********************
00057      * TYPEDEF DECLARATION *
00058      ***********************/
00059 
00060   public:
00061 
00062     typedef CFastMarchingNode<T> heap_node_value_type;
00063     typedef CFastMarchingNode<T>& heap_node_reference;
00064     typedef const CFastMarchingNode<T>& heap_node_const_reference;
00065     typedef CFastMarchingNode<T>* heap_node_pointer;
00066     typedef const CFastMarchingNode<T>* heap_node_const_pointer;
00067 
00068 
00069     /**************
00070      * ATTRIBUTES *
00071      **************/
00072 
00073   protected:
00074 
00075     /**** For all methods ****/
00076 
00079     Matrix<T> Temp;
00080 
00082     int offset;
00083 
00086     bool NeedSpeedUpdateFlag;
00087 
00090     bool NeedInitializationFlag;
00091 
00092     /**** For the full matrix level set method ****/
00093 
00094 
00095     /**** For the narrow band level set method ****/
00096 
00099     Vector<List<Vector<int> >, Vect_Full, NewAlloc<List<Vector<int> > > > Tube;
00101     int TubeSemiWidth;
00102 
00106     Matrix<int> Barrier;
00108     int BarrierWidth;
00109 
00113     Matrix<int> OutSpace;
00115     int OutSpaceWidth;
00116 
00121     ArrayHeap<CFastMarchingNode<T> > TrialPoints;
00124     Matrix<int> PointersToNodes;
00126     T TMax;
00127 
00128 
00129     /*****************************
00130      * CONSTRUCTORS & DESTRUCTOR *
00131      *****************************/
00132 
00133   public:
00134 
00135     CUpdater()  throw();
00136 
00137     virtual ~CUpdater()  throw();
00138 
00139 
00140     /***********
00141      * METHODS *
00142      ***********/
00143 
00144   public:
00145   
00146     /**** For all methods ****/
00147 
00148     virtual bool IsNarrowBand() const = 0;
00149     virtual bool IsFastMarching() const = 0;
00150 
00151     virtual void Init(CMesh<T>& Mesh, CLevelSet<T>& Phi) = 0;
00152     virtual void UpdateLevelSet(T Delta_t, CMesh<T>& Mesh,
00153                                 CSpeedFunction<T>& F,
00154                                 CLevelSet<T>& Phi,
00155                                 T CurrentTime) = 0;
00156 
00157     virtual bool NeedSpeedUpdate() const;
00158     virtual bool NeedInitialization() const;
00159 
00160     virtual Matrix<T>& GetTemp();
00161 
00162     int GetOffset();
00163 
00164     /**** For full matrix level set methods ****/
00165 
00166 
00167     /**** For narrow band level set methods ****/
00168 
00169     Vector<List<Vector<int> >, Vect_Full, NewAlloc<List<Vector<int> > > >& GetTube();
00170     int GetTubeSemiWidth() const;
00171 
00172     Matrix<int>& GetBarrier();
00173     int GetBarrierWidth() const;
00174     Matrix<int>& GetOutSpace();
00175     int GetOutSpaceWidth() const;
00176     
00177     /**** For fast marching methods ****/
00178 
00179     virtual bool KeepOnWorking() const;
00180 
00181     ArrayHeap<CFastMarchingNode<T> >& GetTrialPoints();
00182     Matrix<int>& GetPointersToNodes();
00183     
00184     T GetTMax();
00185 
00186   };  // CUpdater.
00187 
00188 
00189 }  // namespace Multivac.
00190 
00191 
00192 #define FILE_UPDATER_BASECLASS_HXX
00193 #endif

Generated on Mon Apr 19 01:59:14 2004 for Multivac by doxygen 1.3.6-20040222