vtf-logo

SimplexAdjJacQF.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00008 #if !defined(__geom_SimplexAdjJacQF_h__)
00009 #define __geom_SimplexAdjJacQF_h__
00010 
00011 #if defined(DEBUG_geom) && !defined(DEBUG_SimplexAdjJacQF)
00012 #define DEBUG_SimplexAdjJacQF
00013 #endif
00014 
00015 #include "SimplexJacQF.h"
00016 #include "SimplexAdjJac.h"
00017 
00018 BEGIN_NAMESPACE_GEOM
00019 
00021 
00031 template<int N, typename T = double>
00032 class SimplexAdjJacQF :
00033   public SimplexJacQF<N,T> {
00034 private:
00035 
00036   typedef SimplexJacQF<N,T> Base;
00037   typedef SimplexAdjJac<N,T> Adjoint;
00038 
00039 public:
00040 
00041   //
00042   // Public types.
00043   //
00044 
00046   typedef T Number;
00047 
00049   typedef typename Base::Vertex Vertex;
00050 
00052   typedef typename Base::Simplex Simplex;
00053 
00055   typedef typename Base::Matrix Matrix;
00056 
00057 protected:
00058 
00059   //
00060   // Member data.
00061   //
00062 
00064   Adjoint _adjoint;
00065 
00066 public:
00067 
00068   //--------------------------------------------------------------------------
00071 
00073   SimplexAdjJacQF() :
00074     Base(),
00075     _adjoint()
00076   {}
00077 
00079   SimplexAdjJacQF(const SimplexAdjJacQF& other) :
00080     Base(other),
00081     _adjoint(other._adjoint)
00082   {}
00083 
00085   SimplexAdjJacQF(const Simplex& s) :
00086     Base(s),
00087     _adjoint(getMatrix())
00088   {}
00089 
00091   SimplexAdjJacQF& 
00092   operator=(const SimplexAdjJacQF& other) {
00093     if (&other != this) {
00094       Base::operator=(other);
00095       _adjoint = other._adjoint;
00096     }
00097     return *this;
00098   }
00099   
00101   ~SimplexAdjJacQF()
00102   {}
00103 
00105   //--------------------------------------------------------------------------
00108 
00109 
00110   //
00111   // Inherited from SimplexJacQF.
00112   //
00113 
00115   using Base::getMatrix;
00116 
00118   using Base::getGradientMatrix;
00119 
00121   using Base::getDeterminant;
00122 
00124   using Base::getGradientDeterminant;
00125 
00127   using Base::computeContent;
00128 
00130   using Base::computeGradientContent;
00131 
00133   using Base::getDimension;
00134 
00135   //
00136   // From SimplexAdjJac.
00137   //
00138 
00140   const Matrix&
00141   getAdjointMatrix() const {
00142     return _adjoint.getMatrix();
00143   }
00144 
00146   const ads::FixedArray<N,Matrix>&
00147   getAdjointGradientMatrix() const {
00148     return _adjoint.getGradientMatrix();
00149   }
00150 
00152   //--------------------------------------------------------------------------
00155 
00157   void
00158   setFunction(const Simplex& s) {
00159     Base::setFunction(s);
00160     _adjoint.setFunction(getMatrix());
00161   }
00162 
00164   void
00165   set(const Simplex& s) {
00166     Base::set(s);
00167     _adjoint.set(getMatrix());
00168   }
00169 
00171 
00175   void
00176   setFunction(const geom::Simplex<N,ads::FixedArray<N+1,Number>,Number>& s) {
00177     Simplex t;
00178     projectToLowerDimension(s, &t);
00179     setFunction(t);
00180   }
00181 
00183 
00186   void
00187   set(const geom::Simplex<N,ads::FixedArray<N+1,Number>,Number>& s) {
00188     Simplex t;
00189     projectToLowerDimension(s, &t);
00190     set(t);
00191   }
00192 
00194 };
00195 
00196 END_NAMESPACE_GEOM
00197 
00198 #endif

Generated on Fri Aug 24 12:55:57 2007 for Computational Geometry Package by  doxygen 1.4.7