Main Page | User's Guide | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | 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,
00100            NewAlloc<List<Vector<int> > > > Tube;
00102     int TubeSemiWidth;
00103 
00107     Matrix<int> Barrier;
00109     int BarrierWidth;
00110 
00115     Matrix<int> OutSpace;
00117     int OutSpaceWidth;
00118 
00123     ArrayHeap<CFastMarchingNode<T> > TrialPoints;
00126     Matrix<int> PointersToNodes;
00128     T TMax;
00129 
00130 
00131     /*****************************
00132      * CONSTRUCTORS & DESTRUCTOR *
00133      *****************************/
00134 
00135   public:
00136 
00137     CUpdater()  throw();
00138 
00139     virtual ~CUpdater()  throw();
00140 
00141 
00142     /***********
00143      * METHODS *
00144      ***********/
00145 
00146   public:
00147   
00148     /**** For all methods ****/
00149 
00150     virtual bool IsNarrowBand() const = 0;
00151     virtual bool IsFastMarching() const = 0;
00152 
00153     virtual void Init(CMesh<T>& Mesh, CLevelSet<T>& Phi) = 0;
00154     virtual void UpdateLevelSet(T Delta_t, CMesh<T>& Mesh,
00155                                 CSpeedFunction<T>& F,
00156                                 CLevelSet<T>& Phi,
00157                                 T CurrentTime) = 0;
00158 
00159     virtual bool NeedSpeedUpdate() const;
00160     virtual bool NeedInitialization() const;
00161 
00162     virtual Matrix<T>& GetTemp();
00163 
00164     int GetOffset();
00165 
00166     /**** For full matrix level set methods ****/
00167 
00168 
00169     /**** For narrow band level set methods ****/
00170 
00171     Vector<List<Vector<int> >, Vect_Full,
00172            NewAlloc<List<Vector<int> > > >& GetTube();
00173     int GetTubeSemiWidth() const;
00174 
00175     Matrix<int>& GetBarrier();
00176     int GetBarrierWidth() const;
00177     Matrix<int>& GetOutSpace();
00178     int GetOutSpaceWidth() const;
00179     
00180     /**** For fast marching methods ****/
00181 
00182     virtual bool KeepOnWorking() const;
00183 
00184     ArrayHeap<CFastMarchingNode<T> >& GetTrialPoints();
00185     Matrix<int>& GetPointersToNodes();
00186     
00187     T GetTMax();
00188 
00189   };  // CUpdater.
00190 
00191 
00192 }  // namespace Multivac.
00193 
00194 
00195 #define FILE_UPDATER_BASECLASS_HXX
00196 #endif

Generated on Sun Jan 16 23:37:57 2005 for Multivac by  doxygen 1.4.0