SundanceBasisReferenceEvaluationBase.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                              Sundance
00005 //                 Copyright (2005) Sandia Corporation
00006 // 
00007 // Copyright (year first published) Sandia Corporation.  Under the terms 
00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 
00009 // retains certain rights in this software.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //  
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //                                                                                 
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA                                                                                
00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 
00026 // Sandia National Laboratories, Livermore, California, USA
00027 // 
00028 // ************************************************************************
00029 /* @HEADER@ */
00030 
00031 #ifndef SUNDANCE_BASISREFERENCEEVALUATIONBASE_H
00032 #define SUNDANCE_BASISREFERENCEEVALUATIONBASE_H
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceCellType.hpp"
00036 #include "Teuchos_Array.hpp"
00037 
00038 
00039 namespace Sundance {class Point;}
00040 namespace Sundance {class SpatialDerivSpecifier;}
00041 namespace Sundance {class MultiIndex;}
00042 
00043 namespace Sundance 
00044 {
00045 using namespace Teuchos;
00046 
00047 using Teuchos::Array;
00048 
00049 
00050 /** 
00051  * Abstract interface for evaluation of basis functions and their
00052  * spatial derivatives on reference cells.
00053  */
00054 class BasisReferenceEvaluationBase
00055 {
00056 public:
00057 
00058   /** \brief Evaluate the basis functions (or some mixed spatial derivative of
00059    * the basis functions) for an array of points on the "reference cell" for a
00060    * given cell type.
00061    *
00062    * \param  cellType
00063    *           [in] The type of cell on which the basis is currently being
00064    *           evaluated. 
00065    * \param  pts
00066    *           [in] Array of points on the reference cell (or master cell)
00067    *           where the basis functions are to be computed. 
00068    * \param  deriv
00069    *           [in] Specification of which differential operator is
00070    *           to be applied to the basis functions.
00071    * \param  result
00072    *           [out] On output, gives a triply nested array which contain
00073    *           the basis functions (or the requested basis function
00074    *           derivatives) evaluated at the given points <tt>pts</tt>.  The
00075    *           size of the outer array <tt>results</tt> is either zero
00076    *           or spatialDim, depending on whether this is a scalar or
00077    *           vector basis, respectively. The size of the next
00078    *           array level is equal to the number of evaluation points. 
00079    *           Finally, the size of the innermost array level is equal to
00080    *           the number of DOFs visible from the given cell type.
00081 x   *           Specifically,
00082    *           \code 
00083    *           results[k][pointIndex][basisIndex] 
00084    *           \endcode gives the value
00085    *           of the spatial derivative of the \f$k\f$-th component of
00086    *           \f[\frac{\partial^{d_x+d_y+d_z}}{\partial x^{d_x} \partial
00087    *           y^{d_y} \partial z^{d_z}}\psi_i(x,y,z)\f],
00088    *           where \f$d_x\f$ =
00089    *           <tt>deriv[0]</tt>, \f$d_y\f$ = <tt>deriv[1]</tt> (in 2D or 3D)
00090    *           and \f$d_Z\f$
00091    *           = <tt>deriv[2]</tt> (in 3D) at the point <tt>pointIndex</tt> 
00092    *           (where
00093    *           <tt>0 <= pointIndex < pts.size()</tt>) for the basis function
00094    *           \f$i\f$ = <tt>basisIndex</tt> (where <tt>0 <= basisIndex <
00095    *           mapStructure.numBasisChunks()</tt>). 
00096    */
00097   virtual void refEval(
00098     const CellType& cellType,
00099     const Array<Point>& pts,
00100     const SpatialDerivSpecifier& deriv,
00101     Array<Array<Array<double> > >& result,
00102     int verbosity = 0
00103     ) const = 0 ;  
00104 
00105   /**
00106    * Computes the constraints for DoFs which are on hanging elements. <br>
00107    * The child cell is which constrains the hanging local DoF, and the parent cell is needed to find the
00108    * global DoFs.
00109    * @param indexInParent  [in] each (child)cell which has one hanging node, has a parent cell which
00110    * has one facet, where there are global DoFs
00111    * @param maxCellDim     [in] the dimension of the maximal cell
00112    * @param maxNrChild     [in] how many children has one parent cell, this tells us if we have trisection or bisection
00113    * @param facetDim       [in] the hanging element dimension which is a facet of the child cell
00114    * @param facetIndex     [in] the hanging element facet index in the child cell
00115    * @param nodeIndex      [in] one element (e.g edge) might have more than one DoF, specify which DoF on the
00116    * elemnt do we want to constrain
00117    * @param localDoFs      [out] the local DoFs in the parent cell which contribute to the hanging DoF
00118    * @param parentFacetDim [out] the facet dimension where the local DoFs (localDoFs) are
00119    * @param parentFacetIndex[out] the facet index where the local DoFs (localDoFs) are
00120    * @param parentFacetNode[out] the facet node where the local DoFs (localDoFs) is (e.g.: one edge might have 2 DoFs in P3)
00121    * @param coefs          [out] the belonging coefficients to the parents local DoF
00122    *
00123    */
00124   virtual void  getConstrainsForHNDoF(
00125               const int indexInParent,
00126               const int maxCellDim,
00127               const int maxNrChild,
00128               const int facetDim,
00129               const int facetIndex,
00130               const int nodeIndex,
00131               Array<int>& localDoFs,
00132               Array<int>& parentFacetDim,
00133               Array<int>& parentFacetIndex,
00134               Array<int>& parentFacetNode,
00135               Array<double>& coefs
00136               ) {};
00137 
00138 };
00139 
00140 }
00141 
00142 
00143 #endif

Site Contact