11 #define MESH_DIRICHLET BND_DIRICHLET
12 #define MESH_ROBIN BND_ROBIN
13 #define MESH_EXTRAPOL BND_INTERNAL
14 #define MESH_ODD BND_NONE
19 #define ASSEMBLE_PFF 2
20 #define ASSEMBLE_PDD 3
21 #define ASSEMBLE_BNDPFF 4
22 #define ASSEMBLE_CFF 5
23 #define ASSEMBLE_CDD 6
24 #define ASSEMBLE_iCFF 7
25 #define ASSEMBLE_iCDD 8
26 #define ASSEMBLE_PFF_EL 9
27 #define ASSEMBLE_PDD_EL 10
28 #define ASSEMBLE_BNDPFF_EL 11
29 #define ASSEMBLE_BNDFF 12
30 #define ASSEMBLE_iPFF 13
40 FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
43 FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
46 FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
49 FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
52 FELIB
void AddToSysMatrix (
const Mesh &mesh,
55 FELIB
void AddToSysMatrix (
const Mesh &mesh,
58 FELIB
void AddToSysMatrix (
const Mesh &mesh,
61 FELIB
void AddToSysMatrix (
const Mesh &mesh,
64 FELIB
void AddToSysMatrix (
const Mesh &mesh,
67 FELIB
void AddToSysMatrix (
const Mesh &mesh,
70 FELIB
void AddToSysMatrix_elasticity (
const Mesh &mesh,
74 FELIB
void AddToRHS_elasticity (
const Mesh &mesh,
RVector &rhs,
75 const RVector *coeff,
int mode);
77 FELIB
void AddToRHS_thermal_expansion (
const Mesh &mesh,
79 const RVector &thermal_expansion,
double deltaT);
85 FELIB
void AddElasticStrainDisplacementToSysMatrix (
const Mesh &mesh,
94 const int *elref = 0);
97 const IVector &bdim,
const int *elref = 0);
100 const IVector &bdim,
const int *elref = 0);
103 const IVector &gdim,
const int *elref = 0);
105 FELIB
void GenerateVoxelPositions (
const Mesh &mesh,
const IVector &gdim,
113 const int *elref = 0);
117 const int *elref = 0);
119 FELIB
int *GenerateElementPixelRef (
const Mesh &mesh,
const IVector &gdim,
131 FELIB
Mesh *Lin2Quad (
const Mesh &linmesh);
170 void Setup (
bool mark_boundary=
true);
174 void Copy (
const Mesh &mesh);
182 {
return (elen() ? elist[0]->Dimension() : 0); }
188 int nlen()
const {
return nlist.Len(); }
194 int elen()
const {
return elist.Len(); }
196 int ilen()
const {
return priv_ilen; }
199 int nbnd()
const {
return priv_nbnd; }
206 double ElSize (
int el)
const;
210 Point ElCentre (
int el)
const;
213 Point ElSideCentre (
int el,
int sd)
const;
216 double ElSideSize (
int el,
int sd)
const;
219 RVector ElDirectionCosine (
int el,
int sd,
Point *p = 0)
const;
228 double FullSize ()
const;
230 int ElFind (
const Point &pt)
const;
234 int NdFind (
const Point &pt,
double &dist)
const;
250 void Reorder (
const IVector &perm);
252 double ElDist (
int el1,
int el2)
const;
255 virtual void ScaleMesh (
double scale);
258 virtual void ScaleMesh (
const RVector &scale);
261 double ParamAverage (
const ParameterType prmtp)
const;
264 int MaxNodeDiff (
int mode=BW_AUTO)
const;
272 Point NeighbourBarycentre (
int node);
275 void SparseRowStructure (idxtype *&rowptr, idxtype *&colidx,
int &nzero)
const;
282 void NeighbourCount (
int *plist,
int nnode,
bool include_self =
false)
290 void SysMatrixStructure (
int *nz,
int **row_ind,
int **col_ind);
295 int FindBoundarySegment (
const Point &p,
int *n1,
int *n2,
double *dist1,
296 double *dist2)
const;
301 double BoundaryDistance (
int node)
const;
306 int BoundaryList (
int **bndellist,
int **bndsdlist)
const;
311 bool PullToBoundary (
const Point &p,
Point &pshift,
int &element,
312 int &side,
double sub = 0)
const;
322 bool PullToBoundary_old (
const Point &p,
Point &pshift,
int &element,
323 int &side,
double sub = 0)
const;
326 void SetupNeighbourList ()
const;
330 void NodeNeighbourList (
int **_nnbhrs,
int ***_nbhrs)
const;
350 bool ElConnected (
int el1,
int el2,
int *sd1 = NULL,
int *sd2 = NULL);
352 double Size (
Point *centre = 0)
const;
356 void BoundingBox (
Point &mmin,
Point &mmax,
double pad = 0.0)
const;
365 void ResetCoeff_homog (ParameterType prmtp,
double val)
366 { plist.SetParam (prmtp, val); }
370 void ResetCoeff_region (ParameterType prmtp,
double val,
int region);
374 void ResetCoeff_sqrt (ParameterType prmtp,
double cnt,
double bnd);
379 int CheckConsistency ()
const;
384 void MarkBoundary ();
399 friend FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
404 friend FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
409 friend FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
414 friend FELIB
void AddToElMatrix (
const Mesh &mesh,
int el,
419 friend FELIB
void AddToSysMatrix (
const Mesh &mesh,
425 friend FELIB
void AddToSysMatrix (
const Mesh &mesh,
431 friend FELIB
void AddToSysMatrix (
const Mesh &mesh,
434 friend FELIB
void AddToSysMatrix (
const Mesh &mesh,
439 friend FELIB
void AddToSysMatrix (
const Mesh &mesh,
442 friend FELIB
void AddToSysMatrix (
const Mesh &mesh,
447 friend FELIB
void AddToSysMatrix_elasticity (
const Mesh &mesh,
451 friend FELIB
void AddToRHS_elasticity (
const Mesh &mesh,
RVector &rhs,
452 const RVector *coeff,
int mode);
455 friend FELIB
void AddToRHS_thermal_expansion (
const Mesh &mesh,
457 const RVector &thermal_expansion,
double deltaT);
459 friend FELIB
void AddElasticStrainDisplacementToSysMatrix (
const Mesh &mesh,
511 const IVector &bdim,
const int *elref);
516 const IVector &bdim,
const int *elref);
519 const IVector &gdim,
const int *elref);
521 friend FELIB
int *GenerateElementPixelRef (
const Mesh &mesh,
526 friend FELIB
void GenerateVoxelPositions (
const Mesh &mesh,
532 friend FELIB
void SubsampleLinPixel (
const RVector &gf,
RVector &bf,
546 friend FELIB
void SubsampleCubPixel (
const RVector &gf,
RVector &bf,
555 friend FELIB std::istream& operator>> (std::istream& i,
Mesh& mesh);
556 friend FELIB std::ostream& operator<< (std::ostream& o,
Mesh& mesh);
557 void put (std::ostream &os, ParameterType p1 = PRM_MUA,
558 ParameterType p2 = PRM_KAPPA, ParameterType p3 = PRM_N);
559 void WriteVtk (ostream &os,
const RVector &nim);
561 bool trap_load_error;
565 Surface *Boundary()
const {
return boundary; }
568 void SetBoundary (
const Surface &_boundary);
571 void PopulateNeighbourLists ();
573 void InitSubdivisionSupport ();
583 int RefineElement (
int el);
607 mutable int lastel_found;
611 double CalcFullSize ()
const;
615 mutable double fullsize;
632 #ifdef TOAST_PARALLEL
633 static void Setup_engine (
void*,
int,
int);
637 int MakeNodalFreedomArray (
int *&nf,
int nlen,
int dofnod,
bool *rest);
639 void CreateVoxelMesh (
int ex,
int ey,
int ez,
bool *egrid,
640 double dx,
double dy,
double dz,
Mesh &mesh);
Virtual base class for sparse matrix types.
Definition: gsmatrix.h:47
Templated vector class.
Definition: vector.h:39
int Dimension() const
Mesh dimension.
Definition: mesh.h:181
Finite-element mesh management.
Definition: mesh.h:145
int elen() const
Number of mesh elements.
Definition: mesh.h:194
int nlen() const
Number of mesh nodes.
Definition: mesh.h:188
Dense matrix class.
Definition: crmatrix.h:38