Element Class Reference
Element.h: Basic Element over which fields are defined.
More...
#include <Element.h>
List of all members.
Public Member Functions |
| Element () |
virtual | ~Element () |
| Element (const Element &) |
virtual Element * | clone () const =0 |
virtual const size_t | getNumFields () const =0 |
| Number of different fields.
|
virtual const size_t | getDof (size_t field) const =0 |
| Number of degrees of freedom of one of the fields.
|
virtual const size_t | getNumDerivatives (size_t field) const =0 |
| Number of derivatives per shape function for one of the fields.
|
virtual const std::vector
< double > & | getShapes (size_t field) const =0 |
| Shape functions at quadrature points of one of the fields.
|
virtual const std::vector
< double > & | getDShapes (size_t field) const =0 |
| Shape function derivatives at quadrature points of one of the fields.
|
virtual const std::vector
< double > & | getIntegrationWeights (size_t field) const =0 |
| Integration weights of a given field.
|
virtual const std::vector
< double > & | getIntegrationPtCoords (size_t field) const =0 |
| Integration point coordinates of a given field.
|
virtual const double | getShape (size_t field, size_t quad, size_t shapenumber) const =0 |
| Value of shape function "shapenumber" of field "field" at quadrature point "quad".
|
virtual const double | getDShape (size_t field, size_t quad, size_t shapenumber, size_t dir) const =0 |
| Value of derivative of shape function "shapenumber" of field "field" at quadrature point "quad" in direction "dir".
|
virtual const ElementGeometry & | getGeometry () const =0 |
| Access to Element Geometry.
|
| Element (const Tuple &a, const Tuple &b, const Tuple &c) |
| Element (const Tuple &a, const Tuple &b) |
Tuple | getCenter () const |
double | get_radius_squared () const |
double | get_radius_squared (const Tuple ¢er) const |
bool | operator< (const Element &rhs) const |
bool | isRelated (const Element &rhs) const |
bool | inCircle (Tuple p) const |
void | angleCheck (int i, bool &ob, bool &sm, double M) const |
Edge | getEdge (int i) const |
const Tuple & | getPoint (int i) const |
const Tuple & | getObtuse () const |
Edge | getOppositeObtuse () const |
bool | isBad () const |
int | getDim () const |
int | numEdges () const |
bool | isObtuse () const |
Edge | getRelatedEdge (const Element &e) const |
| Scans all the edges of the two elements and if it finds one that is equal, then sets this as the Edge of the EdgeRelation.
|
std::ostream & | print (std::ostream &s) const |
const Tuple & | getPoint (int i) const |
bool | getBDim () |
int | getDim () const |
void | addTuple (Tuple &newTuple) |
TupleList & | getTuples () |
| Element (const Tuple a, const Tuple b, const Tuple c) |
| Element (const Tuple a, const Tuple b) |
bool | elementContains (Tuple p) |
| determine if a tuple is inside the triangle
|
bool | clockwise () |
bool | inCircle (const Tuple &p) |
| determine if the circumcircle of the triangle contains the tuple
|
std::ostream & | print (std::ostream &s) const |
Private Attributes |
Tuple | coords [3] |
signed char | obtuse |
bool | bBad |
bool | bDim |
TupleList | tuples |
Detailed Description
Element.h: Basic Element over which fields are defined.
It contains an element geometry, shape functions etc.
DG++
Created by Adrian Lew on 9/2/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. Element: abstract base class for any element An Element is a convex polytope with possibly-multiple discrete functional spaces, one for each field, with support on it.
An element has:
1) A geometry. The connectivity of vertices that define the convex hull.
2) A group of scalar functional spaces. Each functional space is defined by a set of basis functions with support on the element. Each functional space has an associated number of degrees of freedom to it: the components of any function in the space in the chosen basis.
A field is a scalar-valued function defined over the element.
Each field may have a different underlying functional space.
Each field may have a different quadrature rule. Different quadrature rules will also be handled with different elements, or through inheritance. The consistency of the quadrature rule when different fields are integrated together is in principle not checked by the element hierarchy.
Clearly, isoparametric elements will not necessarily be convex, but Element class can still be used.
As a convention, fields are numbered starting from 0.
- Todo:
- It would be nice to have vectors and tensors as fields, where for each component one assigns a single set of shape functions and quadrature points. The current abstraction is flexible in the sense that it does not enforce vector or tensor fields to have the same quadrature and shapes.
- Todo:
- Need to explain what the expected order of the vectors getShapes() and getDShapes() is.
- Todo:
- Need to explain that either getShapes or getDShapes may return an empty vector, signaling that those values are not available.
Constructor & Destructor Documentation
Element::Element |
( |
|
) |
[inline] |
virtual Element::~Element |
( |
|
) |
[inline, virtual] |
Element::Element |
( |
const Element & |
|
) |
[inline] |
Element::Element |
( |
const Tuple & |
a, |
|
|
const Tuple & |
b, |
|
|
const Tuple & |
c | |
|
) |
| | [inline, explicit] |
Element::Element |
( |
const Tuple & |
a, |
|
|
const Tuple & |
b | |
|
) |
| | [inline, explicit] |
Element::Element |
( |
const Tuple |
a, |
|
|
const Tuple |
b, |
|
|
const Tuple |
c | |
|
) |
| | [inline, explicit] |
Element::Element |
( |
const Tuple |
a, |
|
|
const Tuple |
b | |
|
) |
| | [inline, explicit] |
Member Function Documentation
void Element::addTuple |
( |
Tuple & |
newTuple |
) |
[inline] |
void Element::angleCheck |
( |
int |
i, |
|
|
bool & |
ob, |
|
|
bool & |
sm, |
|
|
double |
M | |
|
) |
| | const [inline] |
bool Element::clockwise |
( |
|
) |
[inline] |
virtual Element* Element::clone |
( |
|
) |
const [pure virtual] |
bool Element::elementContains |
( |
Tuple |
p |
) |
[inline] |
determine if a tuple is inside the triangle
double Element::get_radius_squared |
( |
const Tuple & |
center |
) |
const [inline] |
double Element::get_radius_squared |
( |
|
) |
const [inline] |
bool Element::getBDim |
( |
|
) |
[inline] |
Tuple Element::getCenter |
( |
|
) |
const [inline] |
int Element::getDim |
( |
|
) |
const [inline] |
int Element::getDim |
( |
|
) |
const [inline] |
virtual const size_t Element::getDof |
( |
size_t |
field |
) |
const [pure virtual] |
Number of degrees of freedom of one of the fields.
Implemented in Element_.
virtual const double Element::getDShape |
( |
size_t |
field, |
|
|
size_t |
quad, |
|
|
size_t |
shapenumber, |
|
|
size_t |
dir | |
|
) |
| | const [pure virtual] |
Value of derivative of shape function "shapenumber" of field "field" at quadrature point "quad" in direction "dir".
Implemented in Element_.
virtual const std::vector<double>& Element::getDShapes |
( |
size_t |
field |
) |
const [pure virtual] |
Shape function derivatives at quadrature points of one of the fields.
Implemented in Element_.
Edge Element::getEdge |
( |
int |
i |
) |
const [inline] |
virtual const ElementGeometry& Element::getGeometry |
( |
|
) |
const [pure virtual] |
virtual const std::vector<double>& Element::getIntegrationPtCoords |
( |
size_t |
field |
) |
const [pure virtual] |
Integration point coordinates of a given field.
Implemented in Element_.
virtual const std::vector<double>& Element::getIntegrationWeights |
( |
size_t |
field |
) |
const [pure virtual] |
Integration weights of a given field.
Implemented in Element_.
virtual const size_t Element::getNumDerivatives |
( |
size_t |
field |
) |
const [pure virtual] |
Number of derivatives per shape function for one of the fields.
Implemented in Element_.
virtual const size_t Element::getNumFields |
( |
|
) |
const [pure virtual] |
const Tuple& Element::getObtuse |
( |
|
) |
const [inline] |
Edge Element::getOppositeObtuse |
( |
|
) |
const [inline] |
const Tuple& Element::getPoint |
( |
int |
i |
) |
const [inline] |
const Tuple& Element::getPoint |
( |
int |
i |
) |
const [inline] |
Edge Element::getRelatedEdge |
( |
const Element & |
e |
) |
const [inline] |
Scans all the edges of the two elements and if it finds one that is equal, then sets this as the Edge of the EdgeRelation.
virtual const double Element::getShape |
( |
size_t |
field, |
|
|
size_t |
quad, |
|
|
size_t |
shapenumber | |
|
) |
| | const [pure virtual] |
Value of shape function "shapenumber" of field "field" at quadrature point "quad".
Implemented in Element_.
virtual const std::vector<double>& Element::getShapes |
( |
size_t |
field |
) |
const [pure virtual] |
Shape functions at quadrature points of one of the fields.
Implemented in Element_.
bool Element::inCircle |
( |
const Tuple & |
p |
) |
[inline] |
determine if the circumcircle of the triangle contains the tuple
bool Element::inCircle |
( |
Tuple |
p |
) |
const [inline] |
bool Element::isBad |
( |
|
) |
const [inline] |
bool Element::isObtuse |
( |
|
) |
const [inline] |
bool Element::isRelated |
( |
const Element & |
rhs |
) |
const [inline] |
- Returns:
- if the current triangle has a common edge with e
int Element::numEdges |
( |
|
) |
const [inline] |
bool Element::operator< |
( |
const Element & |
rhs |
) |
const [inline] |
std::ostream& Element::print |
( |
std::ostream & |
s |
) |
const [inline] |
std::ostream& Element::print |
( |
std::ostream & |
s |
) |
const [inline] |
Member Data Documentation
The documentation for this class was generated from the following files: