MFEM v2.0
|
Class for grid function - Vector with asociated FE space. More...
#include <gridfunc.hpp>
Public Member Functions | |
GridFunction () | |
GridFunction (FiniteElementSpace *f) | |
Creates grid function associated with *f. | |
GridFunction (Mesh *m, istream &input) | |
GridFunction (Mesh *m, GridFunction *gf_array[], int num_pieces) | |
void | MakeOwner (FiniteElementCollection *_fec) |
Make the GridFunction the owner of 'fec' and 'fes'. | |
FiniteElementCollection * | OwnFEC () |
int | VectorDim () const |
void | GetNodalValues (int i, Array< double > &nval, int vdim=1) const |
Returns the values in the vertices of i'th element for dimension vdim. | |
double | GetValue (int i, const IntegrationPoint &ip, int vdim=1) const |
void | GetVectorValue (int i, const IntegrationPoint &ip, Vector &val) const |
void | GetValues (int i, const IntegrationRule &ir, Vector &vals, DenseMatrix &tr, int vdim=1) const |
int | GetFaceValues (int i, int side, const IntegrationRule &ir, Vector &vals, DenseMatrix &tr, int vdim=1) const |
void | GetVectorValues (int i, const IntegrationRule &ir, DenseMatrix &vals, DenseMatrix &tr) const |
int | GetFaceVectorValues (int i, int side, const IntegrationRule &ir, DenseMatrix &vals, DenseMatrix &tr) const |
void | GetValuesFrom (GridFunction &) |
void | GetBdrValuesFrom (GridFunction &) |
void | GetVectorFieldValues (int i, const IntegrationRule &ir, DenseMatrix &vals, DenseMatrix &tr, int comp=0) const |
void | ReorderByNodes () |
For a vector grid function, makes sure that the ordering is byNODES. | |
void | GetNodalValues (Vector &nval, int vdim=1) const |
Return the values as a vector on mesh vertices for dimension vdim. | |
void | GetVectorFieldNodalValues (Vector &val, int comp) const |
void | ProjectVectorFieldOn (GridFunction &vec_field, int comp=0) |
void | GetDerivative (int comp, int der_comp, GridFunction &der) |
double | GetDivergence (ElementTransformation &tr) |
void | GetGradient (ElementTransformation &tr, Vector &grad) |
void | GetGradients (const int elem, const IntegrationRule &ir, DenseMatrix &grad) |
void | GetVectorGradient (ElementTransformation &tr, DenseMatrix &grad) |
void | GetElementAverages (GridFunction &avgs) |
void | ProjectCoefficient (Coefficient &coeff) |
void | ProjectCoefficient (Coefficient &coeff, Array< int > &dofs, int vd=0) |
void | ProjectCoefficient (VectorCoefficient &vcoeff) |
void | ProjectCoefficient (Coefficient *coeff[]) |
void | ProjectBdrCoefficient (Coefficient &coeff, Array< int > &attr) |
void | ProjectBdrCoefficient (Coefficient *coeff[], Array< int > &attr) |
void | ProjectBdrCoefficientNormal (VectorCoefficient &vcoeff, Array< int > &bdr_attr) |
void | ProjectBdrCoefficientTangent (VectorCoefficient &vcoeff, Array< int > &bdr_attr) |
double | ComputeL2Error (Coefficient &exsol, const IntegrationRule *irs[]=NULL) const |
double | ComputeL2Error (Coefficient *exsol[], const IntegrationRule *irs[]=NULL) const |
double | ComputeL2Error (VectorCoefficient &exsol, const IntegrationRule *irs[]=NULL, Array< int > *elems=NULL) const |
double | ComputeH1Error (Coefficient *exsol, VectorCoefficient *exgrad, Coefficient *ell_coef, double Nu, int norm_type) const |
double | ComputeMaxError (Coefficient *exsol[], const IntegrationRule *irs[]=NULL) const |
double | ComputeMaxError (VectorCoefficient &exsol, const IntegrationRule *irs[]=NULL) const |
double | ComputeW11Error (Coefficient *exsol, VectorCoefficient *exgrad, int norm_type, Array< int > *elems=NULL, const IntegrationRule *irs[]=NULL) const |
double | ComputeL1Error (VectorCoefficient &exsol, const IntegrationRule *irs[]=NULL) const |
GridFunction & | operator= (double value) |
Redefine '=' for GridFunction = constant. | |
GridFunction & | operator= (const Vector &v) |
Redefine '=' for vector = vector. | |
GridFunction & | operator= (const GridFunction &v) |
FiniteElementSpace * | FESpace () |
void | Update () |
void | Update (FiniteElementSpace *f) |
void | Update (FiniteElementSpace *f, Vector &v, int v_offset) |
virtual void | Save (ostream &out) |
Save the GridFunction to an output stream. | |
void | SaveVTK (ostream &out, const string &field_name, int ref) |
void | SaveSTL (ostream &out, int TimesToRefine=1) |
virtual | ~GridFunction () |
Destroys grid function. | |
Protected Member Functions | |
void | SaveSTLTri (ostream &out, double p1[], double p2[], double p3[]) |
void | GetVectorGradientHat (ElementTransformation &T, DenseMatrix &gh) |
Protected Attributes | |
FiniteElementSpace * | fes |
FE space on which grid function lives. | |
FiniteElementCollection * | fec |
Used when the grid function is read from a file. |
Class for grid function - Vector with asociated FE space.
Definition at line 16 of file gridfunc.hpp.
GridFunction::GridFunction | ( | ) | [inline] |
Definition at line 31 of file gridfunc.hpp.
GridFunction::GridFunction | ( | FiniteElementSpace * | f | ) | [inline] |
Creates grid function associated with *f.
Definition at line 34 of file gridfunc.hpp.
GridFunction::GridFunction | ( | Mesh * | m, |
istream & | input | ||
) |
Definition at line 18 of file gridfunc.cpp.
References fec, fes, FiniteElementSpace::GetVSize(), Vector::Load(), mfem_error(), and FiniteElementCollection::New().
GridFunction::GridFunction | ( | Mesh * | m, |
GridFunction * | gf_array[], | ||
int | num_pieces | ||
) |
Definition at line 44 of file gridfunc.cpp.
References Ordering::byNODES, Vector::data, fec, FiniteElementSpace::FEColl(), fes, FESpace(), Vector::GetData(), FiniteElementSpace::GetNDofs(), FiniteElementSpace::GetNEDofs(), FiniteElementSpace::GetNFDofs(), FiniteElementSpace::GetNVDofs(), FiniteElementSpace::GetOrdering(), FiniteElementSpace::GetVDim(), FiniteElementSpace::GetVSize(), NURBSExtension::MergeGridFunctions(), FiniteElementCollection::Name(), FiniteElementCollection::New(), Mesh::NURBSext, and Vector::SetSize().
GridFunction::~GridFunction | ( | ) | [virtual] |
double GridFunction::ComputeH1Error | ( | Coefficient * | exsol, |
VectorCoefficient * | exgrad, | ||
Coefficient * | ell_coef, | ||
double | Nu, | ||
int | norm_type | ||
) | const |
Definition at line 1168 of file gridfunc.cpp.
References FiniteElement::CalcDShape(), CalcInverse(), FiniteElement::CalcShape(), Mesh::Dimension(), FaceElementTransformations::Elem1, FaceElementTransformations::Elem1No, FaceElementTransformations::Elem2, FaceElementTransformations::Elem2No, Coefficient::Eval(), VectorCoefficient::Eval(), FaceElementTransformations::Face, FaceElementTransformations::FaceGeom, fes, IntegrationRules::Get(), FiniteElement::GetDof(), Mesh::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), Mesh::GetFaceElementTransformations(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetMesh(), Mesh::GetNE(), Mesh::GetNFaces(), IntegrationRule::GetNPoints(), FiniteElement::GetOrder(), IntegrationRule::IntPoint(), IntRules, ElementTransformation::Jacobian(), FaceElementTransformations::Loc1, FaceElementTransformations::Loc2, Mult(), DenseMatrix::MultTranspose(), ElementTransformation::SetIntPoint(), DenseMatrix::SetSize(), Vector::SetSize(), IntegrationPointTransformation::Transform(), ElementTransformation::Weight(), and IntegrationPoint::weight.
double GridFunction::ComputeL1Error | ( | VectorCoefficient & | exsol, |
const IntegrationRule * | irs[] = NULL |
||
) | const |
Reimplemented in ParGridFunction.
Definition at line 1471 of file gridfunc.cpp.
References VectorCoefficient::Eval(), fes, IntegrationRules::Get(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetNE(), IntegrationRule::GetNPoints(), FiniteElement::GetOrder(), GetVectorValues(), IntegrationRule::IntPoint(), IntRules, DenseMatrix::Norm2(), ElementTransformation::SetIntPoint(), Vector::SetSize(), ElementTransformation::Weight(), IntegrationPoint::weight, and DenseMatrix::Width().
double GridFunction::ComputeL2Error | ( | Coefficient * | exsol[], |
const IntegrationRule * | irs[] = NULL |
||
) | const |
Reimplemented in ParGridFunction.
Definition at line 1082 of file gridfunc.cpp.
References FiniteElement::CalcShape(), Coefficient::Eval(), fes, IntegrationRules::Get(), FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetNE(), IntegrationRule::GetNPoints(), FiniteElement::GetOrder(), FiniteElementSpace::GetVDim(), IntegrationRule::IntPoint(), IntRules, ElementTransformation::SetIntPoint(), Vector::SetSize(), ElementTransformation::Weight(), and IntegrationPoint::weight.
double GridFunction::ComputeL2Error | ( | VectorCoefficient & | exsol, |
const IntegrationRule * | irs[] = NULL , |
||
Array< int > * | elems = NULL |
||
) | const |
Reimplemented in ParGridFunction.
Definition at line 1129 of file gridfunc.cpp.
References VectorCoefficient::Eval(), fes, IntegrationRules::Get(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetNE(), IntegrationRule::GetNPoints(), FiniteElement::GetOrder(), GetVectorValues(), IntegrationRule::IntPoint(), IntRules, DenseMatrix::Norm2(), ElementTransformation::SetIntPoint(), Vector::SetSize(), ElementTransformation::Weight(), IntegrationPoint::weight, and DenseMatrix::Width().
double GridFunction::ComputeL2Error | ( | Coefficient & | exsol, |
const IntegrationRule * | irs[] = NULL |
||
) | const [inline] |
Definition at line 131 of file gridfunc.hpp.
Referenced by main().
double GridFunction::ComputeMaxError | ( | Coefficient * | exsol[], |
const IntegrationRule * | irs[] = NULL |
||
) | const |
Reimplemented in ParGridFunction.
Definition at line 1300 of file gridfunc.cpp.
References FiniteElement::CalcShape(), Coefficient::Eval(), fes, IntegrationRules::Get(), FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetNE(), IntegrationRule::GetNPoints(), FiniteElement::GetOrder(), FiniteElementSpace::GetVDim(), IntegrationRule::IntPoint(), IntRules, ElementTransformation::SetIntPoint(), and Vector::SetSize().
double GridFunction::ComputeMaxError | ( | VectorCoefficient & | exsol, |
const IntegrationRule * | irs[] = NULL |
||
) | const |
Reimplemented in ParGridFunction.
Definition at line 1347 of file gridfunc.cpp.
References VectorCoefficient::Eval(), fes, IntegrationRules::Get(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetNE(), FiniteElement::GetOrder(), GetVectorValues(), IntRules, DenseMatrix::Norm2(), Vector::Normlinf(), Vector::SetSize(), and DenseMatrix::Width().
double GridFunction::ComputeW11Error | ( | Coefficient * | exsol, |
VectorCoefficient * | exgrad, | ||
int | norm_type, | ||
Array< int > * | elems = NULL , |
||
const IntegrationRule * | irs[] = NULL |
||
) | const |
Definition at line 1381 of file gridfunc.cpp.
References FiniteElement::CalcDShape(), CalcInverse(), FiniteElement::CalcShape(), Mesh::Dimension(), VectorCoefficient::Eval(), Coefficient::Eval(), fes, IntegrationRules::Get(), FiniteElement::GetDof(), Mesh::GetElementTransformation(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetMesh(), Mesh::GetNE(), IntegrationRule::GetNPoints(), FiniteElement::GetOrder(), IntegrationRule::IntPoint(), IntRules, ElementTransformation::Jacobian(), Mult(), DenseMatrix::MultTranspose(), Vector::Norml1(), ElementTransformation::SetIntPoint(), DenseMatrix::SetSize(), Vector::SetSize(), ElementTransformation::Weight(), and IntegrationPoint::weight.
FiniteElementSpace* GridFunction::FESpace | ( | ) | [inline] |
Definition at line 169 of file gridfunc.hpp.
References fes.
Referenced by ComputeFlux(), Mesh::GetBdrElementTransformation(), GetBdrValuesFrom(), GetDerivative(), Mesh::GetElementTransformation(), Mesh::GetNodalFESpace(), GetValuesFrom(), GridFunction(), Mesh::Load(), NURBSExtension::MergeGridFunctions(), Mesh::PrintVTK(), ProjectVectorFieldOn(), Mesh::SetNodalGridFunction(), Mesh::Transform(), Mesh::UpdateNodes(), Mesh::UpdateNURBS(), and ZZErrorEstimator().
void GridFunction::GetBdrValuesFrom | ( | GridFunction & | orig_func | ) |
Definition at line 432 of file gridfunc.cpp.
References FiniteElement::CalcShape(), fes, FESpace(), FiniteElementSpace::GetBdrElementVDofs(), FiniteElementSpace::GetBE(), FiniteElement::GetDof(), FiniteElementSpace::GetNBE(), FiniteElement::GetNodes(), Vector::GetSubVector(), FiniteElementSpace::GetVDim(), IntegrationRule::IntPoint(), Vector::SetSize(), and Vector::SetSubVector().
void GridFunction::GetDerivative | ( | int | comp, |
int | der_comp, | ||
GridFunction & | der | ||
) |
Definition at line 590 of file gridfunc.cpp.
References FiniteElement::CalcDShape(), CalcInverse(), Vector::data, fes, FESpace(), FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementDofs(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetNE(), FiniteElement::GetNodes(), FiniteElementSpace::GetVSize(), IntegrationRule::IntPoint(), ElementTransformation::Jacobian(), DenseMatrix::MultTranspose(), ElementTransformation::SetIntPoint(), Vector::SetSize(), and DenseMatrix::SetSize().
double GridFunction::GetDivergence | ( | ElementTransformation & | tr | ) |
Definition at line 668 of file gridfunc.cpp.
References FiniteElement::CalcDivShape(), CalcInverse(), ElementTransformation::ElementNo, fes, FiniteElement::GetDof(), FiniteElementSpace::GetElementDofs(), FiniteElementSpace::GetFE(), ElementTransformation::GetIntPoint(), FiniteElement::GetRangeType(), Vector::GetSubVector(), GetVectorGradientHat(), ElementTransformation::Jacobian(), FiniteElement::SCALAR, Operator::Size(), and ElementTransformation::Weight().
void GridFunction::GetElementAverages | ( | GridFunction & | avgs | ) |
Compute , where are the basis functions for the FE space of avgs. Both FE spaces should be scalar and on the same mesh.
Definition at line 738 of file gridfunc.cpp.
References MassIntegrator::AssembleElementMatrix2(), fes, FiniteElementSpace::GetElementDofs(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetNE(), Vector::GetSubVector(), DenseMatrix::Mult, Vector::SetSize(), Array< T >::Size(), and Vector::Size().
int GridFunction::GetFaceValues | ( | int | i, |
int | side, | ||
const IntegrationRule & | ir, | ||
Vector & | vals, | ||
DenseMatrix & | tr, | ||
int | vdim = 1 |
||
) | const |
Definition at line 276 of file gridfunc.cpp.
References FaceElementTransformations::Elem1No, FaceElementTransformations::Elem2No, fes, FiniteElementSpace::GetAttribute(), Mesh::GetFaceElementTransformations(), FiniteElementSpace::GetMesh(), IntegrationRule::GetNPoints(), GetValues(), FaceElementTransformations::Loc1, FaceElementTransformations::Loc2, and IntegrationPointTransformation::Transform().
int GridFunction::GetFaceVectorValues | ( | int | i, |
int | side, | ||
const IntegrationRule & | ir, | ||
DenseMatrix & | vals, | ||
DenseMatrix & | tr | ||
) | const |
Definition at line 358 of file gridfunc.cpp.
References FaceElementTransformations::Elem1No, FaceElementTransformations::Elem2No, fes, FiniteElementSpace::GetAttribute(), Mesh::GetFaceElementTransformations(), FiniteElementSpace::GetMesh(), IntegrationRule::GetNPoints(), GetVectorValues(), FaceElementTransformations::Loc1, FaceElementTransformations::Loc2, and IntegrationPointTransformation::Transform().
void GridFunction::GetGradient | ( | ElementTransformation & | tr, |
Vector & | grad | ||
) |
Definition at line 698 of file gridfunc.cpp.
References mfem_error().
void GridFunction::GetGradients | ( | const int | elem, |
const IntegrationRule & | ir, | ||
DenseMatrix & | grad | ||
) |
Definition at line 703 of file gridfunc.cpp.
References FiniteElement::CalcDShape(), CalcInverse(), fes, DenseMatrix::GetColumnReference(), FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementDofs(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetFE(), IntegrationRule::GetNPoints(), Vector::GetSubVector(), IntegrationRule::IntPoint(), ElementTransformation::Jacobian(), ElementTransformation::SetIntPoint(), and DenseMatrix::SetSize().
void GridFunction::GetNodalValues | ( | Vector & | nval, |
int | vdim = 1 |
||
) | const |
Return the values as a vector on mesh vertices for dimension vdim.
Definition at line 766 of file gridfunc.cpp.
References fes, FiniteElementSpace::GetElementVertices(), FiniteElementSpace::GetNE(), GetNodalValues(), FiniteElementSpace::GetNV(), Vector::SetSize(), and Array< T >::Size().
void GridFunction::GetNodalValues | ( | int | i, |
Array< double > & | nval, | ||
int | vdim = 1 |
||
) | const |
Returns the values in the vertices of i'th element for dimension vdim.
Definition at line 161 of file gridfunc.cpp.
References FiniteElement::CalcShape(), FiniteElement::CalcVShape(), fes, Geometries, FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), IntegrationRule::GetNPoints(), FiniteElement::GetRangeType(), Vector::GetSubVector(), Geometry::GetVertices(), IntegrationRule::IntPoint(), FiniteElement::SCALAR, ElementTransformation::SetIntPoint(), and Array< T >::SetSize().
Referenced by GetNodalValues(), Mesh::Load(), and Mesh::UpdateNURBS().
double GridFunction::GetValue | ( | int | i, |
const IntegrationPoint & | ip, | ||
int | vdim = 1 |
||
) | const |
Definition at line 201 of file gridfunc.cpp.
References FiniteElement::CalcShape(), FiniteElementSpace::DofsToVDofs(), fes, FiniteElementSpace::GetElementDofs(), FiniteElementSpace::GetFE(), Vector::GetSubVector(), and Array< T >::Size().
void GridFunction::GetValues | ( | int | i, |
const IntegrationRule & | ir, | ||
Vector & | vals, | ||
DenseMatrix & | tr, | ||
int | vdim = 1 |
||
) | const |
Definition at line 246 of file gridfunc.cpp.
References FiniteElement::CalcShape(), Vector::data, fes, FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), IntegrationRule::GetNPoints(), IntegrationRule::IntPoint(), Vector::SetSize(), and ElementTransformation::Transform().
Referenced by GetFaceValues(), SaveSTL(), and SaveVTK().
void GridFunction::GetValuesFrom | ( | GridFunction & | orig_func | ) |
Definition at line 395 of file gridfunc.cpp.
References FiniteElement::CalcShape(), fes, FESpace(), FiniteElement::GetDof(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetNE(), FiniteElement::GetNodes(), Vector::GetSubVector(), FiniteElementSpace::GetVDim(), IntegrationRule::IntPoint(), Vector::SetSize(), and Vector::SetSubVector().
void GridFunction::GetVectorFieldNodalValues | ( | Vector & | val, |
int | comp | ||
) | const |
Definition at line 528 of file gridfunc.cpp.
References fes, Geometries, FiniteElementSpace::GetElementVertices(), FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetNE(), IntegrationRule::GetNPoints(), FiniteElementSpace::GetNV(), GetVectorFieldValues(), Geometry::GetVertices(), and Vector::SetSize().
void GridFunction::GetVectorFieldValues | ( | int | i, |
const IntegrationRule & | ir, | ||
DenseMatrix & | vals, | ||
DenseMatrix & | tr, | ||
int | comp = 0 |
||
) | const |
Definition at line 469 of file gridfunc.cpp.
References FiniteElement::CalcVShape(), Vector::data, fes, FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), IntegrationRule::GetNPoints(), IntegrationRule::IntPoint(), ElementTransformation::SetIntPoint(), DenseMatrix::SetSize(), and ElementTransformation::Transform().
Referenced by GetVectorFieldNodalValues(), and ProjectVectorFieldOn().
void GridFunction::GetVectorGradient | ( | ElementTransformation & | tr, |
DenseMatrix & | grad | ||
) |
Definition at line 727 of file gridfunc.cpp.
References CalcInverse(), GetVectorGradientHat(), ElementTransformation::Jacobian(), Mult(), DenseMatrix::SetSize(), and Operator::Size().
void GridFunction::GetVectorGradientHat | ( | ElementTransformation & | T, |
DenseMatrix & | gh | ||
) | [protected] |
Definition at line 644 of file gridfunc.cpp.
References FiniteElement::CalcDShape(), ElementTransformation::ElementNo, fes, FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), ElementTransformation::GetIntPoint(), Vector::GetSubVector(), and DenseMatrix::SetSize().
Referenced by GetDivergence(), and GetVectorGradient().
void GridFunction::GetVectorValue | ( | int | i, |
const IntegrationPoint & | ip, | ||
Vector & | val | ||
) | const |
Definition at line 214 of file gridfunc.cpp.
References FiniteElement::CalcShape(), FiniteElement::CalcVShape(), fes, FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElement::GetRangeType(), Vector::GetSubVector(), FiniteElementSpace::GetVDim(), DenseMatrix::MultTranspose(), FiniteElement::SCALAR, ElementTransformation::SetIntPoint(), and Vector::SetSize().
void GridFunction::GetVectorValues | ( | int | i, |
const IntegrationRule & | ir, | ||
DenseMatrix & | vals, | ||
DenseMatrix & | tr | ||
) | const |
Definition at line 313 of file gridfunc.cpp.
References FiniteElement::CalcShape(), FiniteElement::CalcVShape(), fes, DenseMatrix::GetColumnReference(), FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), IntegrationRule::GetNPoints(), FiniteElement::GetRangeType(), Vector::GetSubVector(), FiniteElementSpace::GetVDim(), IntegrationRule::IntPoint(), DenseMatrix::MultTranspose(), FiniteElement::SCALAR, ElementTransformation::SetIntPoint(), DenseMatrix::SetSize(), and ElementTransformation::Transform().
Referenced by ComputeL1Error(), ComputeL2Error(), ComputeMaxError(), GetFaceVectorValues(), and SaveVTK().
void GridFunction::MakeOwner | ( | FiniteElementCollection * | _fec | ) | [inline] |
Make the GridFunction the owner of 'fec' and 'fes'.
Definition at line 42 of file gridfunc.hpp.
References fec.
Referenced by Mesh::Load().
GridFunction & GridFunction::operator= | ( | const Vector & | v | ) |
Redefine '=' for vector = vector.
Reimplemented from Vector.
Reimplemented in ParGridFunction.
Definition at line 1515 of file gridfunc.cpp.
References Vector::data, and Vector::size.
GridFunction & GridFunction::operator= | ( | const GridFunction & | v | ) |
Definition at line 1522 of file gridfunc.cpp.
References operator=().
GridFunction & GridFunction::operator= | ( | double | value | ) |
Redefine '=' for GridFunction = constant.
Reimplemented from Vector.
Reimplemented in ParGridFunction.
Definition at line 1508 of file gridfunc.cpp.
References Vector::data, and Vector::size.
Referenced by operator=().
FiniteElementCollection* GridFunction::OwnFEC | ( | ) | [inline] |
void GridFunction::ProjectBdrCoefficient | ( | Coefficient * | coeff[], |
Array< int > & | attr | ||
) |
Definition at line 938 of file gridfunc.cpp.
References Coefficient::Eval(), fes, FiniteElementSpace::GetBdrAttribute(), FiniteElementSpace::GetBdrElementTransformation(), FiniteElementSpace::GetBdrElementVDofs(), FiniteElementSpace::GetBE(), FiniteElement::GetDof(), FiniteElementSpace::GetNBE(), FiniteElement::GetNodes(), FiniteElementSpace::GetVDim(), IntegrationRule::IntPoint(), and ElementTransformation::SetIntPoint().
void GridFunction::ProjectBdrCoefficient | ( | Coefficient & | coeff, |
Array< int > & | attr | ||
) | [inline] |
Definition at line 111 of file gridfunc.hpp.
void GridFunction::ProjectBdrCoefficientNormal | ( | VectorCoefficient & | vcoeff, |
Array< int > & | bdr_attr | ||
) |
Project the normal component of the given VectorCoefficient on the boundary. Only boundary attributes that are marked in 'bdr_attr' are projected. Assumes RT-type VectorFE GridFunction.
Definition at line 972 of file gridfunc.cpp.
References Vector::Add(), FiniteElement::CalcShape(), VectorCoefficient::Eval(), fes, IntegrationRules::Get(), FiniteElementSpace::GetBdrAttribute(), FiniteElementSpace::GetBdrElementDofs(), FiniteElementSpace::GetBdrElementTransformation(), FiniteElementSpace::GetBE(), FiniteElement::GetDof(), FiniteElement::GetGeomType(), FiniteElementSpace::GetNBE(), FiniteElement::GetNodes(), IntegrationRule::GetNPoints(), FiniteElement::GetOrder(), VectorCoefficient::GetVDim(), IntegrationRule::IntPoint(), IntRules, ElementTransformation::Jacobian(), ElementTransformation::SetIntPoint(), Vector::SetSize(), Vector::SetSubVector(), and IntegrationPoint::weight.
void GridFunction::ProjectBdrCoefficientTangent | ( | VectorCoefficient & | vcoeff, |
Array< int > & | bdr_attr | ||
) |
Project the tangential components of the given VectorCoefficient on the boundary. Only boundary attributes that are marked in 'bdr_attr' are projected. Assumes ND-type VectorFE GridFunction.
Definition at line 1061 of file gridfunc.cpp.
References fes, FiniteElementSpace::GetBdrAttribute(), FiniteElementSpace::GetBdrElementDofs(), FiniteElementSpace::GetBdrElementTransformation(), FiniteElementSpace::GetBE(), FiniteElement::GetDof(), FiniteElementSpace::GetNBE(), FiniteElement::Project(), Vector::SetSize(), and Vector::SetSubVector().
void GridFunction::ProjectCoefficient | ( | Coefficient * | coeff[] | ) |
Definition at line 908 of file gridfunc.cpp.
References Coefficient::Eval(), fes, FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetNE(), FiniteElement::GetNodes(), FiniteElementSpace::GetVDim(), IntegrationRule::IntPoint(), and ElementTransformation::SetIntPoint().
void GridFunction::ProjectCoefficient | ( | Coefficient & | coeff, |
Array< int > & | dofs, | ||
int | vd = 0 |
||
) |
Definition at line 869 of file gridfunc.cpp.
References FiniteElementSpace::DofToVDof(), Coefficient::Eval(), fes, FiniteElementSpace::GetElementForDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetLocalDofForDof(), FiniteElement::GetNodes(), IntegrationRule::IntPoint(), ElementTransformation::SetIntPoint(), and Array< T >::Size().
void GridFunction::ProjectCoefficient | ( | Coefficient & | coeff | ) |
Definition at line 793 of file gridfunc.cpp.
References DeltaCoefficient::Center(), Mesh::Dimension(), Distance(), fes, FiniteElement::GetDof(), FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), Mesh::GetElementVertices(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetMesh(), Mesh::GetNE(), FiniteElementSpace::GetNE(), Mesh::GetNV(), Mesh::GetVertex(), FiniteElement::Project(), FiniteElement::ProjectDelta(), DeltaCoefficient::Scale(), Vector::SetSize(), Vector::SetSubVector(), Vector::Size(), Array< T >::Size(), DeltaCoefficient::Tol(), and DeltaCoefficient::Weight().
Referenced by main(), Mesh::SetNodalFESpace(), and Mesh::SetNodalGridFunction().
void GridFunction::ProjectCoefficient | ( | VectorCoefficient & | vcoeff | ) |
Definition at line 893 of file gridfunc.cpp.
References fes, FiniteElementSpace::GetElementTransformation(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetNE(), FiniteElement::Project(), Vector::SetSize(), Vector::SetSubVector(), and Array< T >::Size().
void GridFunction::ProjectVectorFieldOn | ( | GridFunction & | vec_field, |
int | comp = 0 |
||
) |
Definition at line 557 of file gridfunc.cpp.
References FESpace(), FiniteElement::GetDim(), FiniteElement::GetDof(), FiniteElementSpace::GetElementVDofs(), FiniteElementSpace::GetFE(), FiniteElementSpace::GetNE(), FiniteElement::GetNodes(), GetVectorFieldValues(), and FiniteElementSpace::GetVSize().
void GridFunction::ReorderByNodes | ( | ) |
For a vector grid function, makes sure that the ordering is byNODES.
Definition at line 507 of file gridfunc.cpp.
References Ordering::byNODES, Vector::data, fes, FiniteElementSpace::GetNDofs(), FiniteElementSpace::GetOrdering(), FiniteElementSpace::GetVDim(), and Vector::size.
void GridFunction::Save | ( | ostream & | out | ) | [virtual] |
Save the GridFunction to an output stream.
Reimplemented in ParGridFunction.
Definition at line 1527 of file gridfunc.cpp.
References Ordering::byNODES, fes, FiniteElementSpace::GetOrdering(), FiniteElementSpace::GetVDim(), Vector::Print(), and FiniteElementSpace::Save().
Referenced by main(), Mesh::Print(), Mesh::PrintWithPartitioning(), and Mesh::PrintXG().
void GridFunction::SaveSTL | ( | ostream & | out, |
int | TimesToRefine = 1 |
||
) |
Definition at line 1605 of file gridfunc.cpp.
References Mesh::Dimension(), fes, Geometries, FiniteElementSpace::GetFE(), FiniteElement::GetGeomType(), FiniteElementSpace::GetMesh(), Mesh::GetNE(), GetValues(), GlobGeometryRefiner, Geometry::NumBdr(), RefinedGeometry::RefGeoms, GeometryRefiner::Refine(), RefinedGeometry::RefPts, SaveSTLTri(), Vector::Size(), and Array< T >::Size().
void GridFunction::SaveSTLTri | ( | ostream & | out, |
double | p1[], | ||
double | p2[], | ||
double | p3[] | ||
) | [protected] |
Definition at line 1586 of file gridfunc.cpp.
Referenced by SaveSTL().
void GridFunction::SaveVTK | ( | ostream & | out, |
const string & | field_name, | ||
int | ref | ||
) |
Write the GridFunction in VTK format. Note that Mesh::PrintVTK must be called first. The parameter ref must match the one used in Mesh::PrintVTK.
Definition at line 1537 of file gridfunc.cpp.
References fes, Mesh::GetElementBaseGeometry(), FiniteElementSpace::GetMesh(), Mesh::GetNE(), GetValues(), GetVectorValues(), GlobGeometryRefiner, DenseMatrix::Height(), GeometryRefiner::Refine(), RefinedGeometry::RefPts, Vector::Size(), VectorDim(), and DenseMatrix::Width().
void GridFunction::Update | ( | ) | [inline] |
Definition at line 171 of file gridfunc.hpp.
References fes, FiniteElementSpace::GetVSize(), and Vector::SetSize().
Referenced by Mesh::UpdateNodes(), and Mesh::UpdateNURBS().
void GridFunction::Update | ( | FiniteElementSpace * | f, |
Vector & | v, | ||
int | v_offset | ||
) |
Definition at line 140 of file gridfunc.cpp.
References fec, fes, FiniteElementSpace::GetVSize(), and Vector::SetDataAndSize().
void GridFunction::Update | ( | FiniteElementSpace * | f | ) |
Definition at line 128 of file gridfunc.cpp.
References fec, fes, FiniteElementSpace::GetVSize(), and Vector::SetSize().
int GridFunction::VectorDim | ( | ) | const |
Definition at line 152 of file gridfunc.cpp.
References fes, FiniteElement::GetDim(), FiniteElementSpace::GetFE(), FiniteElement::GetRangeType(), FiniteElementSpace::GetVDim(), and FiniteElement::SCALAR.
Referenced by Mesh::Load(), SaveVTK(), and Mesh::UpdateNURBS().
FiniteElementCollection* GridFunction::fec [protected] |
Used when the grid function is read from a file.
Definition at line 23 of file gridfunc.hpp.
Referenced by GridFunction(), MakeOwner(), OwnFEC(), Update(), and ~GridFunction().
FiniteElementSpace* GridFunction::fes [protected] |
FE space on which grid function lives.
Definition at line 20 of file gridfunc.hpp.
Referenced by ComputeH1Error(), ComputeL1Error(), ComputeL2Error(), ComputeMaxError(), ComputeW11Error(), FESpace(), GetBdrValuesFrom(), GetDerivative(), GetDivergence(), GetElementAverages(), GetFaceValues(), GetFaceVectorValues(), GetGradients(), GetNodalValues(), GetValue(), GetValues(), GetValuesFrom(), GetVectorFieldNodalValues(), GetVectorFieldValues(), GetVectorGradientHat(), GetVectorValue(), GetVectorValues(), GridFunction(), ProjectBdrCoefficient(), ProjectBdrCoefficientNormal(), ProjectBdrCoefficientTangent(), ProjectCoefficient(), ReorderByNodes(), Save(), SaveSTL(), SaveVTK(), Update(), VectorDim(), and ~GridFunction().