Encapsulation of the element-wise computations for two-dimensional elements. More...
#include <Generic_element_2.h>
Public Types | |
enum | { MAX_SIZE = 9 } |
typedef Generic_element_2 | Self |
typedef double | Real |
typedef unsigned int | Size |
typedef SURF::Vector_2< Real > | Vector_2 |
typedef SURF::Vector_3< Real > | Vector_3 |
typedef Vector_2 | Nat_coor |
Public Member Functions | |
Generic_element_2 (Size ne, Size nn=0) | |
Constructor. More... | |
Size | size_of_edges () const |
Number of edges. More... | |
Size | size_of_nodes () const |
Number of nodes. More... | |
Size | order () const |
Degree of the element. 1 for linear and 2 for quadratic. More... | |
Interpolation \{ | |
void | shape_func (const Nat_coor &nc, Real N[]) const |
Evaluates the shape functions of the element and output the barycentric coordinates into the array N. More... | |
void | shape_func_deriv (const Nat_coor &nc, Vector_2 Np[]) const |
Evaluates the derivatives of the shape functions. More... | |
template<class Field , class Value > | |
void | interpolate (const Field &f, const Nat_coor &nc, Value *v) const throw (int) |
Interpolates the field data at a given point. More... | |
template<class Field > | |
void | interpolate (const Field &f, const Nat_coor &nc, Real *v) const throw (int) |
Customized interpolation for primitive data types. More... | |
template<class Field , class Value > | |
void | interpolate (const Field &f, const Real xi, Value *v) const throw (int) |
Interpolates the field data at a given point on an edge. More... | |
template<class Field > | |
void | interpolate (const Field &f, const Real xi, Real *v) const throw (int) |
Customized interpolation for primitive data types. More... | |
template<class Field > | |
Field_traits< Field >::Value | interpolate (const Field &f, const Nat_coor &nc) const throw (int) |
Interpolates the field data at a given point and return the result. More... | |
template<class Field > | |
Field_traits< Field >::Value | interpolate (const Field &f, const Real xi) const throw (int) |
Interpolates the field data at a given point on an edge and return the result. More... | |
template<class Field , class Value > | |
void | interpolate_to_center (const Field &f, Value *v) const throw (int) |
Interpolates the field data to the center of the element. More... | |
template<class Field > | |
Field_traits< Field >::Value | interpolate_to_center (const Field &f) const throw (int) |
Interpolates the field data to the center and return the value. More... | |
Gradient | |
template<class Field > | |
void | Jacobian (const Field &f, const Nat_coor &nc, Vector_3 J[2]) const |
Evaluates the Jacobian at a given point. More... | |
template<class Field > | |
void | Jacobian (const Field &f, const Real xi, Vector_3 &v) const |
template<class Pnts > | |
void | gradients (const Pnts &ps, const Nat_coor &nc, Vector_3 grads[3]) const |
Evaluates the gradient of the shape functions. More... | |
template<class Field > | |
Real | Jacobian_det (const Field &f, const Nat_coor &nc) const |
Evaluates the determinant of the Jacobian (dx/dxi,dx/deta). More... | |
template<class Field > | |
Real | Jacobian_det (const Field &f1, const Field &f2, Real alpha, const Nat_coor &nc2) const |
Evaluates the determinant of the Jacobian (dx/dxi,dx/deta), where x is (1-alpha)*f1+alpha*f2. More... | |
Gaussian quadrature rules \{ | |
Size | get_num_gp (const Size doa=0) const |
Get the number of Gauss points. More... | |
Real | get_gp_weight (const Size i, const Size doa=0) const |
Get the weight associated with a Gauss point. More... | |
void | get_gp_nat_coor (const Size i, Nat_coor &nc, const Size doa=0) const |
Get the natrual coordinate associated with a Gauss point. More... | |
Protected Member Functions | |
void | solve (const Vector_3 M[2], Vector_3 x[], const Vector_2 b[]) const |
template<class Field , class Value > | |
void | interpolate_nopt (const Field &f, const Nat_coor &nc, Value *v) const throw (int) |
Nonoptimized version of interpolation. More... | |
template<class Field , class Value > | |
void | interpolate_nopt (const Field &f, const Real xi, Value *v) const throw (int) |
Nonoptimized version of interpolation. More... | |
Private Attributes | |
const Size | _nedges |
const Size | _nnodes |
const Size | _order |
Encapsulation of the element-wise computations for two-dimensional elements.
It supports linear/quadratic triangle/quadrilateral elements. It does not contain any geometric or field data but only defines the master element. Geometric or field data data should be provided as parameters to the member functions as necessary. NOTE: We normalized the natural (local) coodinates so that they always fall between 0 and 1.
Definition at line 94 of file Generic_element_2.h.
Definition at line 101 of file Generic_element_2.h.
typedef double Real |
Definition at line 97 of file Generic_element_2.h.
typedef Generic_element_2 Self |
Definition at line 96 of file Generic_element_2.h.
typedef unsigned int Size |
Definition at line 98 of file Generic_element_2.h.
Definition at line 99 of file Generic_element_2.h.
Definition at line 100 of file Generic_element_2.h.
anonymous enum |
SURF_BEGIN_NAMESPACE Generic_element_2 | ( | Size | ne, |
Size | nn = 0 |
||
) |
Constructor.
ne | specifies the number of edges. |
nn | specifies the number of nodes. |
Definition at line 32 of file Generic_element_2.C.
References _nnodes.
Get the natrual coordinate associated with a Gauss point.
Definition at line 182 of file Generic_element_2.C.
References _nedges, _order, and max().
Referenced by compute_lbop_weights(), and get_face_volume().
Generic_element_2::Real get_gp_weight | ( | const Size | i, |
const Size | doa = 0 |
||
) | const |
Get the weight associated with a Gauss point.
Definition at line 159 of file Generic_element_2.C.
References _nedges, _order, and max().
Referenced by compute_lbop_weights(), and get_face_volume().
Generic_element_2::Size get_num_gp | ( | const Size | doa = 0 | ) | const |
Get the number of Gauss points.
Definition at line 145 of file Generic_element_2.C.
References _nedges, _order, and max().
Referenced by compute_lbop_weights(), and get_face_volume().
Evaluates the gradient of the shape functions.
Definition at line 506 of file Generic_element_2.h.
References Jacobian(), shape_func_deriv(), and solve().
Interpolates the field data at a given point.
Definition at line 242 of file Generic_element_2.h.
References v.
Referenced by get_face_volume(), and interpolate().
Customized interpolation for primitive data types.
Definition at line 136 of file Generic_element_2.h.
References interpolate_nopt(), and v.
Interpolates the field data at a given point on an edge.
Definition at line 351 of file Generic_element_2.h.
References v.
Customized interpolation for primitive data types.
Definition at line 147 of file Generic_element_2.h.
References interpolate_nopt(), and v.
|
inline |
Interpolates the field data at a given point and return the result.
Definition at line 154 of file Generic_element_2.h.
References interpolate(), and v.
|
inline |
Interpolates the field data at a given point on an edge and return the result.
Definition at line 163 of file Generic_element_2.h.
References interpolate(), and v.
|
protected |
Nonoptimized version of interpolation.
Definition at line 303 of file Generic_element_2.h.
References v.
Referenced by interpolate().
Nonoptimized version of interpolation.
Definition at line 379 of file Generic_element_2.h.
References v.
void interpolate_to_center | ( | const Field & | f, |
Value * | v | ||
) | const | ||
throw | ( | int | |
) |
Interpolates the field data to the center of the element.
Definition at line 405 of file Generic_element_2.h.
Referenced by interpolate_to_center().
|
inline |
Interpolates the field data to the center and return the value.
Definition at line 176 of file Generic_element_2.h.
References interpolate_to_center(), and v.
Evaluates the Jacobian at a given point.
Definition at line 419 of file Generic_element_2.h.
References _nnodes.
Referenced by Window_manifold_2::elements_to_nodes(), get_deformed_normal(), get_face_volume(), get_normal(), gradients(), and Jacobian_det().
Generic_element_2::Real Jacobian_det | ( | const Field & | f, |
const Nat_coor & | nc | ||
) | const |
Evaluates the determinant of the Jacobian (dx/dxi,dx/deta).
Definition at line 521 of file Generic_element_2.h.
References Vector_3< Type >::cross_product(), Jacobian(), and sqrt().
Generic_element_2::Real Jacobian_det | ( | const Field & | f1, |
const Field & | f2, | ||
Real | alpha, | ||
const Nat_coor & | nc2 | ||
) | const |
Evaluates the determinant of the Jacobian (dx/dxi,dx/deta), where x is (1-alpha)*f1+alpha*f2.
Used by Rocface.
Definition at line 533 of file Generic_element_2.h.
References Vector_3< Type >::cross_product(), Jacobian(), and sqrt().
|
inline |
Degree of the element. 1 for linear and 2 for quadratic.
Definition at line 117 of file Generic_element_2.h.
References _order.
Referenced by rflu_modstencilsbfaces::rflu_buildbf2cstencil(), rflu_modstencilscells::rflu_buildc2cstencil(), rflu_modstencilscells::rflu_buildc2cstencil_1d_g(), rflu_modstencilsfaces::rflu_buildf2cstencil(), rflu_modstencilsvert::rflu_buildstencilvert2cell(), rflu_moddifferentiationbfaces::rflu_computegradbfaces_1d(), rflu_moddifferentiationcells::rflu_computegradcells_1d(), rflu_moddifferentiationfaces::rflu_computegradconstrained(), rflu_computestencilsize(), rflu_modstencilsutils::rflu_computestencilsize(), rflu_modstencilsutils::rflu_computestencilweights(), rflu_modweights::rflu_computewtsbf2c(), rflu_modweights::rflu_computewtsbf2cwrapper(), rflu_modweights::rflu_computewtsc2c(), rflu_modweights::rflu_computewtsc2cwrapper(), rflu_modweights::rflu_computewtsf2c(), rflu_modweights::rflu_computewtsf2cwrapper(), rflu_modweights::rflu_createwtsbf2c(), rflu_modweights::rflu_createwtsbf2cwrapper(), rflu_modweights::rflu_createwtsc2c(), rflu_modweights::rflu_createwtsc2cwrapper(), rflu_modweights::rflu_createwtsf2c(), rflu_modweights::rflu_createwtsf2cwrapper(), and updatetbcpiecewise().
Evaluates the shape functions of the element and output the barycentric coordinates into the array N.
Definition at line 42 of file Generic_element_2.C.
References _nnodes.
Evaluates the derivatives of the shape functions.
Definition at line 94 of file Generic_element_2.C.
References _nnodes.
Referenced by gradients().
|
inline |
|
inline |
Number of nodes.
Definition at line 115 of file Generic_element_2.h.
References _nnodes.
Referenced by solve().
Definition at line 231 of file Generic_element_2.C.
References Vector_3< Type >::cross_product(), i, size_of_nodes(), and Vector_3< Type >::squared_norm().
Referenced by gradients().
|
private |
Definition at line 236 of file Generic_element_2.h.
Referenced by get_gp_nat_coor(), get_gp_weight(), get_num_gp(), and size_of_edges().
|
private |
Definition at line 237 of file Generic_element_2.h.
Referenced by Generic_element_2(), Jacobian(), shape_func(), shape_func_deriv(), and size_of_nodes().
|
private |
Definition at line 238 of file Generic_element_2.h.
Referenced by get_gp_nat_coor(), get_gp_weight(), get_num_gp(), and order().