Linear< SPD > Class Template Reference

Linear.h: a set of linear shape functions DG++. More...

#include <Linear.h>

Inheritance diagram for Linear< SPD >:
Shape

List of all members.

Public Member Functions

 Linear (const size_t *iMap=0)
 Constructor
.
virtual ~Linear ()
 Linear (const Linear< SPD > &)
virtual Linear< SPD > * clone () const
size_t getNumFunctions () const
size_t getNumVariables () const
 Number of arguments of the functions.
double getVal (size_t a, const double *x) const
double getDVal (size_t a, const double *x, size_t i) const

Private Attributes

size_t bctMap [SPD+1]

Detailed Description

template<size_t SPD>
class Linear< SPD >

Linear.h: a set of linear shape functions DG++.

Created by Adrian Lew on 9/4/06.

Copyright (c) 2006 Adrian Lew

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. set of linear shape functions in SPD dimensions The linear shape functions in SPD dimensions are precisely the barycentric coordinates of a point in the simplex defined by SPD+1 points.

Since quadrature points are often expressed in baricentric coordinates, this class was implemented to take the SPD+1 barycentric coordinates of a point as arguments only.

Since barycentric coordinates are linearly dependent, the class chooses SPD coordinates as arguments of the shape functions. This choice is made by shuffling the coordinates so that the first SPD coordinates are the linearly independent ones.

The possibility of shuffling becomes useful, for example, in tetrahedra. Without shuffling the class would have

\[ N_a(\lambda_0,\lambda_1,\lambda_2), \qquad a=0,1,2,3 \]

and the derivatives of the shape function with respect to the same arguments. With a shuffling of the form $(\lambda_0,\lambda_1,\lambda_2,\lambda_3)$ to $(\lambda_0,\lambda_1,\lambda_3,\lambda_2)$ it is possible to have

\[ N_a(\lambda_0,\lambda_1,\lambda_3), \qquad a=0,1,2,3. \]

The derivatives returned here, are clearly different that in the previous case. The reason that this is useful is that these derivatives are precisely the derivatives with respect to the Cartesian coordinates of the shape functions in a standard parametric tet ( with vertices at (1,0,0), (0,1,0), (0,0,0), (0,0,1) )


Constructor & Destructor Documentation

template<size_t SPD>
Linear< SPD >::Linear ( const size_t *  iMap = 0  )  [inline]

Constructor
.

Parameters:
iMap Shuffle of the barycentric coordinates. iMap[a] returns the position of the original a-th barycentric coordinate after shuffling. If not provided, an identity mapping is assumed iMap[a]=a
Warning:
No way to know if iMap has the proper length.
template<size_t SPD>
virtual Linear< SPD >::~Linear (  )  [inline, virtual]
template<size_t SPD>
Linear< SPD >::Linear ( const Linear< SPD > &  Lin  )  [inline]

Member Function Documentation

template<size_t SPD>
virtual Linear<SPD>* Linear< SPD >::clone (  )  const [inline, virtual]

Implements Shape.

template<size_t SPD>
double Linear< SPD >::getDVal ( size_t  a,
const double *  x,
size_t  i 
) const [inline, virtual]
Parameters:
a shape function number
x first spartial_dimension barycentric coordinates of the point
i partial derivative number Returns derivative with respect to the barycentric coordinates
Warning:
Does not check range for parameters a and i

Implements Shape.

template<size_t SPD>
size_t Linear< SPD >::getNumFunctions (  )  const [inline, virtual]

Implements Shape.

template<size_t SPD>
size_t Linear< SPD >::getNumVariables (  )  const [inline, virtual]

Number of arguments of the functions.

Implements Shape.

template<size_t SPD>
double Linear< SPD >::getVal ( size_t  a,
const double *  x 
) const [inline, virtual]
Parameters:
a shape function number
x first SPD barycentric coordinates of the point
Warning:
Does not check range for parameter a

Implements Shape.


Member Data Documentation

template<size_t SPD>
size_t Linear< SPD >::bctMap[SPD+1] [private]

The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:27 2011 for Galois by  doxygen 1.6.3