00001 /* @HEADER@ */ 00002 // ************************************************************************ 00003 // 00004 // Sundance 00005 // Copyright 2011 Sandia Corporation 00006 // 00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00008 // the U.S. Government retains certain rights in this software. 00009 // 00010 // Redistribution and use in source and binary forms, with or without 00011 // modification, are permitted provided that the following conditions are 00012 // met: 00013 // 00014 // 1. Redistributions of source code must retain the above copyright 00015 // notice, this list of conditions and the following disclaimer. 00016 // 00017 // 2. Redistributions in binary form must reproduce the above copyright 00018 // notice, this list of conditions and the following disclaimer in the 00019 // documentation and/or other materials provided with the distribution. 00020 // 00021 // 3. Neither the name of the Corporation nor the names of the 00022 // contributors may be used to endorse or promote products derived from 00023 // this software without specific prior written permission. 00024 // 00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 // 00037 // Questions? Contact Kevin Long (kevin.long@ttu.edu) 00038 // 00039 00040 /* @HEADER@ */ 00041 00042 #ifndef SUNDANCE_BASISREFERENCEEVALUATIONBASE_H 00043 #define SUNDANCE_BASISREFERENCEEVALUATIONBASE_H 00044 00045 #include "SundanceDefs.hpp" 00046 #include "SundanceCellType.hpp" 00047 #include "Teuchos_Array.hpp" 00048 00049 00050 namespace Sundance {class Point;} 00051 namespace Sundance {class SpatialDerivSpecifier;} 00052 namespace Sundance {class MultiIndex;} 00053 00054 namespace Sundance 00055 { 00056 using namespace Teuchos; 00057 00058 using Teuchos::Array; 00059 00060 00061 /** 00062 * Abstract interface for evaluation of basis functions and their 00063 * spatial derivatives on reference cells. 00064 */ 00065 class BasisReferenceEvaluationBase 00066 { 00067 public: 00068 00069 /** \brief Evaluate the basis functions (or some mixed spatial derivative of 00070 * the basis functions) for an array of points on the "reference cell" for a 00071 * given cell type. 00072 * 00073 * \param cellType 00074 * [in] The type of cell on which the basis is currently being 00075 * evaluated. 00076 * \param pts 00077 * [in] Array of points on the reference cell (or master cell) 00078 * where the basis functions are to be computed. 00079 * \param deriv 00080 * [in] Specification of which differential operator is 00081 * to be applied to the basis functions. 00082 * \param result 00083 * [out] On output, gives a triply nested array which contain 00084 * the basis functions (or the requested basis function 00085 * derivatives) evaluated at the given points <tt>pts</tt>. The 00086 * size of the outer array <tt>results</tt> is either zero 00087 * or spatialDim, depending on whether this is a scalar or 00088 * vector basis, respectively. The size of the next 00089 * array level is equal to the number of evaluation points. 00090 * Finally, the size of the innermost array level is equal to 00091 * the number of DOFs visible from the given cell type. 00092 x * Specifically, 00093 * \code 00094 * results[k][pointIndex][basisIndex] 00095 * \endcode gives the value 00096 * of the spatial derivative of the \f$k\f$-th component of 00097 * \f[\frac{\partial^{d_x+d_y+d_z}}{\partial x^{d_x} \partial 00098 * y^{d_y} \partial z^{d_z}}\psi_i(x,y,z)\f], 00099 * where \f$d_x\f$ = 00100 * <tt>deriv[0]</tt>, \f$d_y\f$ = <tt>deriv[1]</tt> (in 2D or 3D) 00101 * and \f$d_Z\f$ 00102 * = <tt>deriv[2]</tt> (in 3D) at the point <tt>pointIndex</tt> 00103 * (where 00104 * <tt>0 <= pointIndex < pts.size()</tt>) for the basis function 00105 * \f$i\f$ = <tt>basisIndex</tt> (where <tt>0 <= basisIndex < 00106 * mapStructure.numBasisChunks()</tt>). 00107 */ 00108 virtual void refEval( 00109 const CellType& cellType, 00110 const Array<Point>& pts, 00111 const SpatialDerivSpecifier& deriv, 00112 Array<Array<Array<double> > >& result, 00113 int verbosity = 0 00114 ) const = 0 ; 00115 00116 /** 00117 * Computes the constraints for DoFs which are on hanging elements. <br> 00118 * The child cell is which constrains the hanging local DoF, and the parent cell is needed to find the 00119 * global DoFs. 00120 * @param indexInParent [in] each (child)cell which has one hanging node, has a parent cell which 00121 * has one facet, where there are global DoFs 00122 * @param maxCellDim [in] the dimension of the maximal cell 00123 * @param maxNrChild [in] how many children has one parent cell, this tells us if we have trisection or bisection 00124 * @param facetDim [in] the hanging element dimension which is a facet of the child cell 00125 * @param facetIndex [in] the hanging element facet index in the child cell 00126 * @param nodeIndex [in] one element (e.g edge) might have more than one DoF, specify which DoF on the 00127 * elemnt do we want to constrain 00128 * @param localDoFs [out] the local DoFs in the parent cell which contribute to the hanging DoF 00129 * @param parentFacetDim [out] the facet dimension where the local DoFs (localDoFs) are 00130 * @param parentFacetIndex[out] the facet index where the local DoFs (localDoFs) are 00131 * @param parentFacetNode[out] the facet node where the local DoFs (localDoFs) is (e.g.: one edge might have 2 DoFs in P3) 00132 * @param coefs [out] the belonging coefficients to the parents local DoF 00133 * 00134 */ 00135 virtual void getConstrainsForHNDoF( 00136 const int indexInParent, 00137 const int maxCellDim, 00138 const int maxNrChild, 00139 const int facetDim, 00140 const int facetIndex, 00141 const int nodeIndex, 00142 Array<int>& localDoFs, 00143 Array<int>& parentFacetDim, 00144 Array<int>& parentFacetIndex, 00145 Array<int>& parentFacetNode, 00146 Array<double>& coefs 00147 ) {}; 00148 00149 }; 00150 00151 } 00152 00153 00154 #endif