2009-01-13 04:40:13 +05:00
|
|
|
#ifndef CURVEDELEMS
|
|
|
|
#define CURVEDELEMS
|
|
|
|
|
|
|
|
/**************************************************************************/
|
|
|
|
/* File: curvedelems.hpp */
|
2009-01-24 18:35:44 +05:00
|
|
|
/* Author: Robert Gaisbauer (first version) */
|
|
|
|
/* redesign by Joachim Schoeberl */
|
|
|
|
/* Date: 27. Sep. 02, Feb 2006 */
|
2009-01-13 04:40:13 +05:00
|
|
|
/**************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
class Refinement;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
|
|
|
class CurvedElements
|
|
|
|
{
|
|
|
|
const Mesh & mesh;
|
|
|
|
|
2009-01-25 17:35:25 +05:00
|
|
|
Array<int> edgeorder;
|
|
|
|
Array<int> faceorder;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-25 17:35:25 +05:00
|
|
|
Array<int> edgecoeffsindex;
|
|
|
|
Array<int> facecoeffsindex;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-25 17:35:25 +05:00
|
|
|
Array< Vec<3> > edgecoeffs;
|
|
|
|
Array< Vec<3> > facecoeffs;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-25 17:35:25 +05:00
|
|
|
Array< double > edgeweight; // for rational 2nd order splines
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
int order;
|
|
|
|
bool rational;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
bool ishighorder;
|
2019-04-06 16:40:37 +05:00
|
|
|
void buildJacPols();
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
public:
|
2015-10-19 13:08:30 +05:00
|
|
|
DLL_HEADER CurvedElements (const Mesh & amesh);
|
|
|
|
DLL_HEADER ~CurvedElements();
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
// bool IsHighOrder() const { return order > 1; }
|
|
|
|
bool IsHighOrder() const { return ishighorder; }
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
// void SetHighOrder (int aorder) { order=aorder; }
|
|
|
|
void SetIsHighOrder (bool ho) { ishighorder = ho; }
|
|
|
|
|
2015-10-19 13:08:30 +05:00
|
|
|
DLL_HEADER void BuildCurvedElements(const Refinement * ref, int aorder, bool arational = false);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
int GetOrder () { return order; }
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2018-12-14 16:01:58 +05:00
|
|
|
virtual void DoArchive(Archive& ar)
|
|
|
|
{
|
2019-04-06 16:40:37 +05:00
|
|
|
if(ar.Input())
|
|
|
|
buildJacPols();
|
2018-12-14 16:01:58 +05:00
|
|
|
ar & edgeorder & faceorder & edgecoeffsindex & facecoeffsindex & edgecoeffs & facecoeffs
|
|
|
|
& edgeweight & order & rational & ishighorder;
|
|
|
|
}
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
bool IsSegmentCurved (SegmentIndex segnr) const;
|
|
|
|
bool IsSurfaceElementCurved (SurfaceElementIndex sei) const;
|
|
|
|
bool IsElementCurved (ElementIndex ei) const;
|
2014-01-07 16:42:39 +06:00
|
|
|
bool IsElementHighOrder (ElementIndex ei) const;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Point<3> & x)
|
2017-11-24 01:26:23 +05:00
|
|
|
{ CalcSegmentTransformation<double> (xi, segnr, &x, NULL); };
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Vec<3> & dxdxi)
|
2017-11-24 01:26:23 +05:00
|
|
|
{ CalcSegmentTransformation<double> (xi, segnr, NULL, &dxdxi); };
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Point<3> & x, Vec<3> & dxdxi)
|
2017-11-24 01:26:23 +05:00
|
|
|
{ CalcSegmentTransformation<double> (xi, segnr, &x, &dxdxi, NULL); };
|
2009-01-24 18:35:44 +05:00
|
|
|
|
|
|
|
void CalcSegmentTransformation (double xi, SegmentIndex segnr,
|
|
|
|
Point<3> & x, Vec<3> & dxdxi, bool & curved)
|
|
|
|
{ CalcSegmentTransformation (xi, segnr, &x, &dxdxi, &curved); };
|
|
|
|
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Point<3> & x)
|
|
|
|
{ CalcSurfaceTransformation (xi, elnr, &x, NULL); };
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Mat<3,2> & dxdxi)
|
|
|
|
{ CalcSurfaceTransformation (xi, elnr, NULL, &dxdxi); };
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Point<3> & x, Mat<3,2> & dxdxi)
|
2009-01-24 18:35:44 +05:00
|
|
|
{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, NULL); };
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,
|
|
|
|
Point<3> & x, Mat<3,2> & dxdxi, bool & curved)
|
|
|
|
{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, &curved); };
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Point<3> & x)
|
|
|
|
{ CalcElementTransformation (xi, elnr, &x, NULL); };
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Mat<3,3> & dxdxi)
|
|
|
|
{ CalcElementTransformation (xi, elnr, NULL, &dxdxi); };
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
2009-01-13 04:40:13 +05:00
|
|
|
Point<3> & x, Mat<3,3> & dxdxi)
|
2009-01-24 18:35:44 +05:00
|
|
|
{ CalcElementTransformation (xi, elnr, &x, &dxdxi /* , NULL */ ); };
|
|
|
|
|
|
|
|
void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
|
|
|
Point<3> & x, Mat<3,3> & dxdxi,
|
|
|
|
void * buffer, bool valid)
|
|
|
|
{ CalcElementTransformation (xi, elnr, &x, &dxdxi, /* NULL, */ buffer, valid ); };
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
// void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,
|
|
|
|
// Point<3> & x, Mat<3,3> & dxdxi) // , bool & curved)
|
|
|
|
// { CalcElementTransformation (xi, elnr, &x, &dxdxi /* , &curved * ); }
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
2017-11-24 01:26:23 +05:00
|
|
|
/*
|
2009-01-25 17:35:25 +05:00
|
|
|
void CalcMultiPointSegmentTransformation (Array<double> * xi, SegmentIndex segnr,
|
|
|
|
Array<Point<3> > * x,
|
|
|
|
Array<Vec<3> > * dxdxi);
|
2017-11-24 01:26:23 +05:00
|
|
|
*/
|
|
|
|
|
|
|
|
template <int DIM_SPACE, typename T>
|
2010-07-21 02:04:16 +06:00
|
|
|
void CalcMultiPointSegmentTransformation (SegmentIndex elnr, int n,
|
2017-11-24 01:26:23 +05:00
|
|
|
const T * xi, size_t sxi,
|
|
|
|
T * x, size_t sx,
|
|
|
|
T * dxdxi, size_t sdxdxi);
|
2010-07-21 02:04:16 +06:00
|
|
|
|
2009-01-25 17:35:25 +05:00
|
|
|
void CalcMultiPointSurfaceTransformation (Array< Point<2> > * xi, SurfaceElementIndex elnr,
|
|
|
|
Array< Point<3> > * x,
|
|
|
|
Array< Mat<3,2> > * dxdxi);
|
2010-07-21 02:04:16 +06:00
|
|
|
|
2016-07-11 21:27:44 +05:00
|
|
|
template <int DIM_SPACE, typename T>
|
2009-07-06 14:16:02 +06:00
|
|
|
void CalcMultiPointSurfaceTransformation (SurfaceElementIndex elnr, int n,
|
2016-07-11 21:27:44 +05:00
|
|
|
const T * xi, size_t sxi,
|
|
|
|
T * x, size_t sx,
|
|
|
|
T * dxdxi, size_t sdxdxi);
|
2009-07-06 14:16:02 +06:00
|
|
|
|
2009-01-25 17:35:25 +05:00
|
|
|
void CalcMultiPointElementTransformation (Array< Point<3> > * xi, ElementIndex elnr,
|
|
|
|
Array< Point<3> > * x,
|
|
|
|
Array< Mat<3,3> > * dxdxi);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2016-07-06 21:12:57 +05:00
|
|
|
template <typename T>
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcMultiPointElementTransformation (ElementIndex elnr, int n,
|
2016-07-06 21:12:57 +05:00
|
|
|
const T * xi, size_t sxi,
|
|
|
|
T * x, size_t sx,
|
|
|
|
T * dxdxi, size_t sdxdxi);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
private:
|
2017-11-24 01:26:23 +05:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void CalcSegmentTransformation (T xi, SegmentIndex segnr,
|
|
|
|
Point<3,T> * x = NULL, Vec<3,T> * dxdxi = NULL, bool * curved = NULL);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcSurfaceTransformation (Point<2> xi, SurfaceElementIndex elnr,
|
|
|
|
Point<3> * x = NULL, Mat<3,2> * dxdxi = NULL, bool * curved = NULL);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
void CalcElementTransformation (Point<3> xi, ElementIndex elnr,
|
|
|
|
Point<3> * x = NULL, Mat<3,3> * dxdxi = NULL, // bool * curved = NULL,
|
|
|
|
void * buffer = NULL, bool valid = 0);
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
class SegmentInfo
|
2009-01-13 04:40:13 +05:00
|
|
|
{
|
2009-01-24 18:35:44 +05:00
|
|
|
public:
|
|
|
|
SegmentIndex elnr;
|
|
|
|
int order;
|
|
|
|
int nv;
|
|
|
|
int ndof;
|
|
|
|
int edgenr;
|
2009-01-13 04:40:13 +05:00
|
|
|
};
|
|
|
|
|
2017-11-24 01:26:23 +05:00
|
|
|
template <typename T>
|
|
|
|
void CalcElementShapes (SegmentInfo & elnr, T xi, TFlatVector<T> shapes) const;
|
2009-01-25 17:35:25 +05:00
|
|
|
void GetCoefficients (SegmentInfo & elnr, Array<Vec<3> > & coefs) const;
|
2017-11-24 01:26:23 +05:00
|
|
|
template <typename T>
|
|
|
|
void CalcElementDShapes (SegmentInfo & elnr, T xi, TFlatVector<T> dshapes) const;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
|
|
|
|
2009-01-24 18:35:44 +05:00
|
|
|
class ElementInfo
|
2009-01-13 04:40:13 +05:00
|
|
|
{
|
2009-01-24 18:35:44 +05:00
|
|
|
public:
|
|
|
|
ElementIndex elnr;
|
|
|
|
int order;
|
|
|
|
int nv;
|
|
|
|
int ndof;
|
|
|
|
int nedges;
|
|
|
|
int nfaces;
|
|
|
|
int edgenrs[12];
|
|
|
|
int facenrs[6];
|
|
|
|
Mat<3> hdxdxi;
|
|
|
|
Vec<3> hcoefs[10]; // enough for second order tets
|
2009-01-13 04:40:13 +05:00
|
|
|
};
|
|
|
|
|
2016-07-06 21:12:57 +05:00
|
|
|
template <typename T>
|
|
|
|
void CalcElementShapes (ElementInfo & info, Point<3,T> xi, TFlatVector<T> shapes) const;
|
2009-01-24 18:35:44 +05:00
|
|
|
void GetCoefficients (ElementInfo & info, Vec<3> * coefs) const;
|
2016-07-06 21:12:57 +05:00
|
|
|
template <typename T>
|
|
|
|
void CalcElementDShapes (ElementInfo & info, const Point<3,T> xi, MatrixFixWidth<3,T> dshapes) const;
|
2009-01-13 04:40:13 +05:00
|
|
|
|
2016-07-07 18:28:27 +05:00
|
|
|
template <typename T>
|
|
|
|
bool EvaluateMapping (ElementInfo & info, const Point<3,T> xi, Point<3,T> & x, Mat<3,3,T> & jac) const;
|
2009-01-24 18:35:44 +05:00
|
|
|
|
|
|
|
class SurfaceElementInfo
|
2009-01-13 04:40:13 +05:00
|
|
|
{
|
2009-01-24 18:35:44 +05:00
|
|
|
public:
|
|
|
|
SurfaceElementIndex elnr;
|
|
|
|
int order;
|
|
|
|
int nv;
|
|
|
|
int ndof;
|
|
|
|
ArrayMem<int,4> edgenrs;
|
|
|
|
int facenr;
|
2009-01-13 04:40:13 +05:00
|
|
|
};
|
|
|
|
|
2016-07-11 21:27:44 +05:00
|
|
|
template <typename T>
|
|
|
|
void CalcElementShapes (SurfaceElementInfo & elinfo, const Point<2,T> xi, TFlatVector<T> shapes) const;
|
2009-07-06 14:16:02 +06:00
|
|
|
template <int DIM_SPACE>
|
|
|
|
void GetCoefficients (SurfaceElementInfo & elinfo, Array<Vec<DIM_SPACE> > & coefs) const;
|
2016-07-11 21:27:44 +05:00
|
|
|
template <typename T>
|
|
|
|
void CalcElementDShapes (SurfaceElementInfo & elinfo, const Point<2,T> xi, MatrixFixWidth<2,T> dshapes) const;
|
|
|
|
|
|
|
|
template <int DIM_SPACE, typename T>
|
|
|
|
bool EvaluateMapping (SurfaceElementInfo & info, const Point<2,T> xi, Point<DIM_SPACE,T> & x, Mat<DIM_SPACE,2,T> & jac) const;
|
2009-01-13 04:40:13 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|