Path: blob/devel/ElmerGUI/netgen/libsrc/meshing/curvedelems_new.hpp
3206 views
#ifndef CURVEDELEMS_NEWH1#define CURVEDELEMS_NEWH23/**************************************************************************/4/* File: curvedelems.hpp */5/* Author: Robert Gaisbauer (first version) */6/* redesign by Joachim Schoeberl */7/* Date: 27. Sep. 02, Feb 2006 */8/**************************************************************************/910111213class Refinement;141516class CurvedElements17{18const Mesh & mesh;1920ARRAY<int> edgeorder;21ARRAY<int> faceorder;2223ARRAY<int> edgecoeffsindex;24ARRAY<int> facecoeffsindex;2526ARRAY< Vec<3> > edgecoeffs;27ARRAY< Vec<3> > facecoeffs;2829ARRAY< double > edgeweight; // for rational 2nd order splines3031int order;32bool rational;3334bool ishighorder;3536public:37CurvedElements (const Mesh & amesh);38~CurvedElements();3940// bool IsHighOrder() const { return order > 1; }41bool IsHighOrder() const { return ishighorder; }4243void SetHighOrder (int aorder) { order=aorder; }4445void BuildCurvedElements(Refinement * ref, int aorder, bool arational = false);4647int GetOrder () { return order; }484950bool IsSegmentCurved (SegmentIndex segnr) const;51bool IsSurfaceElementCurved (SurfaceElementIndex sei) const;52bool IsElementCurved (ElementIndex ei) const;535455void CalcSegmentTransformation (double xi, SegmentIndex segnr,56Point<3> & x)57{ CalcSegmentTransformation (xi, segnr, &x, NULL); };5859void CalcSegmentTransformation (double xi, SegmentIndex segnr,60Vec<3> & dxdxi)61{ CalcSegmentTransformation (xi, segnr, NULL, &dxdxi); };6263void CalcSegmentTransformation (double xi, SegmentIndex segnr,64Point<3> & x, Vec<3> & dxdxi)65{ CalcSegmentTransformation (xi, segnr, &x, &dxdxi, NULL); };6667void CalcSegmentTransformation (double xi, SegmentIndex segnr,68Point<3> & x, Vec<3> & dxdxi, bool & curved)69{ CalcSegmentTransformation (xi, segnr, &x, &dxdxi, &curved); };70717273void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,74Point<3> & x)75{ CalcSurfaceTransformation (xi, elnr, &x, NULL); };7677void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,78Mat<3,2> & dxdxi)79{ CalcSurfaceTransformation (xi, elnr, NULL, &dxdxi); };8081void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,82Point<3> & x, Mat<3,2> & dxdxi)83{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, NULL); };8485void CalcSurfaceTransformation (const Point<2> & xi, SurfaceElementIndex elnr,86Point<3> & x, Mat<3,2> & dxdxi, bool & curved)87{ CalcSurfaceTransformation (xi, elnr, &x, &dxdxi, &curved); };888990919293void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,94Point<3> & x)95{ CalcElementTransformation (xi, elnr, &x, NULL); };9697void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,98Mat<3,3> & dxdxi)99{ CalcElementTransformation (xi, elnr, NULL, &dxdxi); };100101void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,102Point<3> & x, Mat<3,3> & dxdxi)103{ CalcElementTransformation (xi, elnr, &x, &dxdxi /* , NULL */ ); };104105void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,106Point<3> & x, Mat<3,3> & dxdxi,107void * buffer, bool valid)108{ CalcElementTransformation (xi, elnr, &x, &dxdxi, /* NULL, */ buffer, valid ); };109110// void CalcElementTransformation (const Point<3> & xi, ElementIndex elnr,111// Point<3> & x, Mat<3,3> & dxdxi) // , bool & curved)112// { CalcElementTransformation (xi, elnr, &x, &dxdxi /* , &curved * ); }113114115116void CalcMultiPointSegmentTransformation (ARRAY<double> * xi, SegmentIndex segnr,117ARRAY<Point<3> > * x,118ARRAY<Vec<3> > * dxdxi);119120void CalcMultiPointSurfaceTransformation (ARRAY< Point<2> > * xi, SurfaceElementIndex elnr,121ARRAY< Point<3> > * x,122ARRAY< Mat<3,2> > * dxdxi);123124void CalcMultiPointElementTransformation (ARRAY< Point<3> > * xi, ElementIndex elnr,125ARRAY< Point<3> > * x,126ARRAY< Mat<3,3> > * dxdxi);127128void CalcMultiPointElementTransformation (ElementIndex elnr, int n,129const double * xi, int sxi,130double * x, int sx,131double * dxdxi, int sdxdxi);132133134135136private:137138void CalcSegmentTransformation (double xi, SegmentIndex segnr,139Point<3> * x = NULL, Vec<3> * dxdxi = NULL, bool * curved = NULL);140141void CalcSurfaceTransformation (Point<2> xi, SurfaceElementIndex elnr,142Point<3> * x = NULL, Mat<3,2> * dxdxi = NULL, bool * curved = NULL);143144void CalcElementTransformation (Point<3> xi, ElementIndex elnr,145Point<3> * x = NULL, Mat<3,3> * dxdxi = NULL, // bool * curved = NULL,146void * buffer = NULL, bool valid = 0);147148149150151152153class SegmentInfo154{155public:156SegmentIndex elnr;157int order;158int nv;159int ndof;160int edgenr;161};162163void CalcElementShapes (SegmentInfo & elnr, double xi, Vector & shapes) const;164void GetCoefficients (SegmentInfo & elnr, ARRAY<Vec<3> > & coefs) const;165void CalcElementDShapes (SegmentInfo & elnr, double xi, Vector & dshapes) const;166167168class ElementInfo169{170public:171ElementIndex elnr;172int order;173int nv;174int ndof;175int nedges;176int nfaces;177int edgenrs[12];178int facenrs[6];179Mat<3> hdxdxi;180Vec<3> hcoefs[10]; // enough for second order tets181};182183184void CalcElementShapes (ElementInfo & info, const Point<3> & xi, Vector & shapes) const;185void GetCoefficients (ElementInfo & info, Vec<3> * coefs) const;186void CalcElementDShapes (ElementInfo & info, const Point<3> & xi, MatrixFixWidth<3> & dshapes) const;187188189class SurfaceElementInfo190{191public:192SurfaceElementIndex elnr;193int order;194int nv;195int ndof;196ArrayMem<int,4> edgenrs;197int facenr;198};199200void CalcElementShapes (SurfaceElementInfo & elinfo, const Point<2> & xi, Vector & shapes) const;201void GetCoefficients (SurfaceElementInfo & elinfo, ARRAY<Vec<3> > & coefs) const;202void CalcElementDShapes (SurfaceElementInfo & elinfo, const Point<2> & xi, DenseMatrix & dshapes) const;203};204205206207#endif208209210