MFEM  v3.2
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
nurbs.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_NURBS
13 #define MFEM_NURBS
14 
15 #include "../config/config.hpp"
16 #include "../general/table.hpp"
17 #include "../general/communication.hpp"
18 #include "../linalg/vector.hpp"
19 #include "element.hpp"
20 #include "mesh.hpp"
21 #include <iostream>
22 
23 namespace mfem
24 {
25 
26 class GridFunction;
27 
28 
30 {
31 protected:
32  static const int MaxOrder;
33 
36 
37 public:
39  KnotVector() { }
40  KnotVector(std::istream &input);
41  KnotVector(int Order_, int NCP);
42  KnotVector(const KnotVector &kv) { (*this) = kv; }
43 
44  KnotVector &operator=(const KnotVector &kv);
45 
46  int GetNE() const { return NumOfElements; }
47  int GetNKS() const { return NumOfControlPoints - Order; }
48  int GetNCP() const { return NumOfControlPoints; }
49  int GetOrder() const { return Order; }
50  int Size() const { return knot.Size(); }
51 
53  void GetElements();
54 
55  bool isElement(int i) const { return (knot(Order+i) != knot(Order+i+1)); }
56 
57  double getKnotLocation(double xi, int ni) const
58  { return (xi*knot(ni+1) + (1. - xi)*knot(ni)); }
59 
60  int findKnotSpan(double u) const;
61 
62  void CalcShape (Vector &shape, int i, double xi);
63  void CalcDShape(Vector &grad, int i, double xi);
64 
65  void Difference(const KnotVector &kv, Vector &diff) const;
66  void UniformRefinement(Vector &newknots) const;
69  KnotVector *DegreeElevate(int t) const;
70 
71  void Flip();
72 
73  void Print(std::ostream &out) const;
74 
77 
78  double &operator[](int i) { return knot(i); }
79  const double &operator[](int i) const { return knot(i); }
80 };
81 
82 
84 {
85 protected:
86  int ni, nj, nk, Dim;
87  double *data;
88 
90 
91  int sd, nd;
92 
93  void swap(NURBSPatch *np);
94 
95  // Special B-NET access functions
96  int SetLoopDirection(int dir);
97  inline double &operator()(int i, int j);
98  inline const double &operator()(int i, int j) const;
99 
100  void init(int dim_);
101 
102  NURBSPatch(NURBSPatch *parent, int dir, int Order, int NCP);
103 
104 public:
105  NURBSPatch(std::istream &input);
106  NURBSPatch(KnotVector *kv0, KnotVector *kv1, int dim_);
107  NURBSPatch(KnotVector *kv0, KnotVector *kv1, KnotVector *kv2, int dim_);
108  NURBSPatch(Array<KnotVector *> &kv, int dim_);
109 
110  ~NURBSPatch();
111 
112  void Print(std::ostream &out);
113 
114  void DegreeElevate(int dir, int t);
115  void KnotInsert (int dir, const KnotVector &knot);
116  void KnotInsert (int dir, const Vector &knot);
117 
118  void KnotInsert(Array<KnotVector *> &knot);
119  void DegreeElevate(int t);
120  void UniformRefinement();
121 
122  KnotVector *GetKV(int i) { return kv[i]; }
123 
124  // Standard B-NET access functions
125  inline double &operator()(int i, int j, int l);
126  inline const double &operator()(int i, int j, int l) const;
127 
128  inline double &operator()(int i, int j, int k, int l);
129  inline const double &operator()(int i, int j, int k, int l) const;
130 
131  static void Get3DRotationMatrix(double n[], double angle, double r,
132  DenseMatrix &T);
133  void FlipDirection(int dir);
134  void SwapDirections(int dir1, int dir2);
135  void Rotate3D(double normal[], double angle);
136  int MakeUniformDegree();
137  friend NURBSPatch *Interpolate(NURBSPatch &p1, NURBSPatch &p2);
138  friend NURBSPatch *Revolve3D(NURBSPatch &patch, double n[], double ang,
139  int times);
140 };
141 
142 
143 #ifdef MFEM_USE_MPI
144 class ParNURBSExtension;
145 #endif
146 
147 class NURBSPatchMap;
148 
149 
151 {
152 #ifdef MFEM_USE_MPI
153  friend class ParNURBSExtension;
154 #endif
155  friend class NURBSPatchMap;
156 
157 protected:
158  int Order;
160  // global entity counts
162  // local entity counts
165 
166  Array<int> activeVert; // activeVert[glob_vert] = loc_vert or -1
169  Array<int> activeDof; // activeDof[glob_dof] = loc_dof + 1 or 0
170 
172  int own_topo;
176 
177  // global offsets, meshOffsets == meshVertexOffsets
182 
183  // global offsets, spaceOffsets == dofOffsets
188 
190 
193  Array2D<int> el_to_IJK; // IJK are "knot-span" indices!
194  Array2D<int> bel_to_IJK; // they are NOT element indices!
195 
197 
198  inline int KnotInd(int edge);
199  inline KnotVector *KnotVec(int edge);
200  inline KnotVector *KnotVec(int edge, int oedge, int *okv);
201 
202  void CheckPatches();
203  void CheckBdrPatches();
204 
205  void GetPatchKnotVectors (int p, Array<KnotVector *> &kv);
207 
208  // also count the global NumOfVertices and the global NumOfDofs
209  void GenerateOffsets();
210  // count the global NumOfElements
211  void CountElements();
212  // count the global NumOfBdrElements
213  void CountBdrElements();
214 
215  // generate the mesh elements
216  void Get2DElementTopo(Array<Element *> &elements);
217  void Get3DElementTopo(Array<Element *> &elements);
218 
219  // generate the boundary mesh elements
220  void Get2DBdrElementTopo(Array<Element *> &boundary);
221  void Get3DBdrElementTopo(Array<Element *> &boundary);
222 
223 
224  // FE space generation functions
225 
226  // based on activeElem, count NumOfActiveDofs, generate el_dof,
227  // el_to_patch, el_to_IJK, activeDof map (global-to-local)
229 
230  // generate elem_to_global-dof table for the active elements
231  // define el_to_patch, el_to_IJK, activeDof (as bool)
234 
235  // call after GenerateElementDofTable
237 
238  // generate the bdr-elem_to_global-dof table for the active bdr. elements
239  // define bel_to_patch, bel_to_IJK
242 
243  // Patch <--> FE translation functions
244  void GetPatchNets (const Vector &Nodes);
245  void Get2DPatchNets(const Vector &Nodes);
246  void Get3DPatchNets(const Vector &Nodes);
247 
248  void SetSolutionVector (Vector &Nodes);
249  void Set2DSolutionVector(Vector &Nodes);
250  void Set3DSolutionVector(Vector &Nodes);
251 
252  // determine activeVert, NumOfActiveVertices from the activeElem array
253  void GenerateActiveVertices();
254 
255  // determine activeBdrElem, NumOfActiveBdrElems
256  void GenerateActiveBdrElems();
257 
258  void MergeWeights(Mesh *mesh_array[], int num_pieces);
259 
260  // to be used by ParNURBSExtension constructor(s)
262 
263 public:
265  NURBSExtension(std::istream &input);
268  NURBSExtension(NURBSExtension *parent, int Order);
270  NURBSExtension(Mesh *mesh_array[], int num_pieces);
271 
272  void MergeGridFunctions(GridFunction *gf_array[], int num_pieces,
273  GridFunction &merged);
274 
276  virtual ~NURBSExtension();
277 
278  // Print functions
279  void Print(std::ostream &out) const;
280  void PrintCharacteristics(std::ostream &out);
281 
282  // Meta data functions
283  int Dimension() { return patchTopo->Dimension(); }
284  int GetNP() { return patchTopo->GetNE(); }
285  int GetNBP() { return patchTopo->GetNBE(); }
286  int GetOrder() { return Order; }
287  int GetNKV() { return NumOfKnotVectors; }
288 
289  int GetGNV() { return NumOfVertices; }
290  int GetNV() { return NumOfActiveVertices; }
291  int GetGNE() { return NumOfElements; }
292  int GetNE() { return NumOfActiveElems; }
293  int GetGNBE() { return NumOfBdrElements; }
294  int GetNBE() { return NumOfActiveBdrElems; }
295 
296  int GetNTotalDof() { return NumOfDofs; }
297  int GetNDof() { return NumOfActiveDofs; }
298 
299  // Knotvector access function
300  const KnotVector *GetKnotVector(int i) const { return knotVectors[i]; }
301 
302  // Mesh generation functions
303  void GetElementTopo (Array<Element *> &elements);
304  void GetBdrElementTopo(Array<Element *> &boundary);
305 
306  bool HavePatches() { return (patches.Size() != 0); }
307 
310 
311  void GetVertexLocalToGlobal(Array<int> &lvert_vert);
312  void GetElementLocalToGlobal(Array<int> &lelem_elem);
313 
314  // Load functions
315  void LoadFE(int i, const FiniteElement *FE);
316  void LoadBE(int i, const FiniteElement *BE);
317 
318  const Vector &GetWeights() const { return weights; }
319  Vector &GetWeights() { return weights; }
320 
321  // Translation functions: from FE coordinates into to IJK patch
322  // format and vice versa
323  void ConvertToPatches(const Vector &Nodes);
324  void SetKnotsFromPatches();
325  void SetCoordsFromPatches(Vector &Nodes);
326 
327  // Refinement methods
328  void DegreeElevate(int t);
329  void UniformRefinement();
331 };
332 
333 
334 #ifdef MFEM_USE_MPI
336 {
337 private:
338  int *partitioning;
339 
340  Table *GetGlobalElementDofTable();
341  Table *Get2DGlobalElementDofTable();
342  Table *Get3DGlobalElementDofTable();
343 
344  void SetActive(int *partitioning, const Array<bool> &active_bel);
345  void BuildGroups(int *partitioning, const Table &elem_dof);
346 
347 public:
349 
351 
352  ParNURBSExtension(MPI_Comm comm, NURBSExtension *parent, int *partitioning,
353  const Array<bool> &active_bel);
354 
355  // create a parallel version of 'parent' with partitioning as in
356  // 'par_parent'; the 'parent' object is destroyed
357  ParNURBSExtension(NURBSExtension *parent, ParNURBSExtension *par_parent);
358 
359  virtual ~ParNURBSExtension() { delete [] partitioning; }
360 };
361 #endif
362 
363 
365 {
366 private:
367  NURBSExtension *Ext;
368 
369  int I, J, K, pOffset, opatch;
370  Array<int> verts, edges, faces, oedge, oface;
371 
372  inline static int F(const int n, const int N)
373  { return (n < 0) ? 0 : ((n >= N) ? 2 : 1); }
374 
375  inline static int Or1D(const int n, const int N, const int Or)
376  { return (Or > 0) ? n : (N - 1 - n); }
377 
378  inline static int Or2D(const int n1, const int n2,
379  const int N1, const int N2, const int Or);
380 
381  // also set verts, edges, faces, orientations etc
382  void GetPatchKnotVectors (int p, KnotVector *kv[]);
383  void GetBdrPatchKnotVectors(int p, KnotVector *kv[], int *okv);
384 
385 public:
386  NURBSPatchMap(NURBSExtension *ext) { Ext = ext; }
387 
388  int nx() { return I + 1; }
389  int ny() { return J + 1; }
390  int nz() { return K + 1; }
391 
392  void SetPatchVertexMap(int p, KnotVector *kv[]);
393  void SetPatchDofMap (int p, KnotVector *kv[]);
394 
395  void SetBdrPatchVertexMap(int p, KnotVector *kv[], int *okv);
396  void SetBdrPatchDofMap (int p, KnotVector *kv[], int *okv);
397 
398  inline int operator()(const int i) const;
399  inline int operator[](const int i) const { return (*this)(i); }
400 
401  inline int operator()(const int i, const int j) const;
402 
403  inline int operator()(const int i, const int j, const int k) const;
404 };
405 
406 
407 // Inline function implementations
408 
409 inline double &NURBSPatch::operator()(int i, int j)
410 {
411  return data[j%sd + sd*(i + (j/sd)*nd)];
412 }
413 
414 inline const double &NURBSPatch::operator()(int i, int j) const
415 {
416  return data[j%sd + sd*(i + (j/sd)*nd)];
417 }
418 
419 inline double &NURBSPatch::operator()(int i, int j, int l)
420 {
421 #ifdef MFEM_DEBUG
422  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || nk > 0 ||
423  l < 0 || l >= Dim)
424  {
425  mfem_error("NURBSPatch::operator() 2D");
426  }
427 #endif
428 
429  return data[(i+j*ni)*Dim+l];
430 }
431 
432 inline const double &NURBSPatch::operator()(int i, int j, int l) const
433 {
434 #ifdef MFEM_DEBUG
435  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || nk > 0 ||
436  l < 0 || l >= Dim)
437  {
438  mfem_error("NURBSPatch::operator() const 2D");
439  }
440 #endif
441 
442  return data[(i+j*ni)*Dim+l];
443 }
444 
445 inline double &NURBSPatch::operator()(int i, int j, int k, int l)
446 {
447 #ifdef MFEM_DEBUG
448  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
449  k >= nk || l < 0 || l >= Dim)
450  {
451  mfem_error("NURBSPatch::operator() 3D");
452  }
453 #endif
454 
455  return data[(i+(j+k*nj)*ni)*Dim+l];
456 }
457 
458 inline const double &NURBSPatch::operator()(int i, int j, int k, int l) const
459 {
460 #ifdef MFEM_DEBUG
461  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
462  k >= nk || l < 0 || l >= Dim)
463  {
464  mfem_error("NURBSPatch::operator() const 3D");
465  }
466 #endif
467 
468  return data[(i+(j+k*nj)*ni)*Dim+l];
469 }
470 
471 
472 inline int NURBSExtension::KnotInd(int edge)
473 {
474  int kv = edge_to_knot[edge];
475  return (kv >= 0) ? kv : (-1-kv);
476 }
477 
479 {
480  return knotVectors[KnotInd(edge)];
481 }
482 
483 inline KnotVector *NURBSExtension::KnotVec(int edge, int oedge, int *okv)
484 {
485  int kv = edge_to_knot[edge];
486  if (kv >= 0)
487  {
488  *okv = oedge;
489  return knotVectors[kv];
490  }
491  else
492  {
493  *okv = -oedge;
494  return knotVectors[-1-kv];
495  }
496 }
497 
498 
499 inline int NURBSPatchMap::Or2D(const int n1, const int n2,
500  const int N1, const int N2, const int Or)
501 {
502  // Needs testing
503  switch (Or)
504  {
505  case 0: return n1 + n2*N1;
506  case 1: return n2 + n1*N2;
507  case 2: return n2 + (N1 - 1 - n1)*N2;
508  case 3: return (N1 - 1 - n1) + n2*N1;
509  case 4: return (N1 - 1 - n1) + (N2 - 1 - n2)*N1;
510  case 5: return (N2 - 1 - n2) + (N1 - 1 - n1)*N2;
511  case 6: return (N2 - 1 - n2) + n1*N2;
512  case 7: return n1 + (N2 - 1 - n2)*N1;
513  }
514 #ifdef MFEM_DEBUG
515  mfem_error("NURBSPatchMap::Or2D");
516 #endif
517  return -1;
518 }
519 
520 inline int NURBSPatchMap::operator()(const int i) const
521 {
522  int i1 = i - 1;
523  switch (F(i1, I))
524  {
525  case 0: return verts[0];
526  case 1: return pOffset + Or1D(i1, I, opatch);
527  case 2: return verts[1];
528  }
529 #ifdef MFEM_DEBUG
530  mfem_error("NURBSPatchMap::operator() const 1D");
531 #endif
532  return -1;
533 }
534 
535 inline int NURBSPatchMap::operator()(const int i, const int j) const
536 {
537  int i1 = i - 1, j1 = j - 1;
538  switch (3*F(j1, J) + F(i1, I))
539  {
540  case 0: return verts[0];
541  case 1: return edges[0] + Or1D(i1, I, oedge[0]);
542  case 2: return verts[1];
543  case 3: return edges[3] + Or1D(j1, J, -oedge[3]);
544  case 4: return pOffset + Or2D(i1, j1, I, J, opatch);
545  case 5: return edges[1] + Or1D(j1, J, oedge[1]);
546  case 6: return verts[3];
547  case 7: return edges[2] + Or1D(i1, I, -oedge[2]);
548  case 8: return verts[2];
549  }
550 #ifdef MFEM_DEBUG
551  mfem_error("NURBSPatchMap::operator() const 2D");
552 #endif
553  return -1;
554 }
555 
556 inline int NURBSPatchMap::operator()(const int i, const int j, const int k)
557 const
558 {
559  // Needs testing
560  int i1 = i - 1, j1 = j - 1, k1 = k - 1;
561  switch (3*(3*F(k1, K) + F(j1, J)) + F(i1, I))
562  {
563  case 0: return verts[0];
564  case 1: return edges[0] + Or1D(i1, I, oedge[0]);
565  case 2: return verts[1];
566  case 3: return edges[3] + Or1D(j1, J, oedge[3]);
567  case 4: return faces[0] + Or2D(i1, J - 1 - j1, I, J, oface[0]);
568  case 5: return edges[1] + Or1D(j1, J, oedge[1]);
569  case 6: return verts[3];
570  case 7: return edges[2] + Or1D(i1, I, oedge[2]);
571  case 8: return verts[2];
572  case 9: return edges[8] + Or1D(k1, K, oedge[8]);
573  case 10: return faces[1] + Or2D(i1, k1, I, K, oface[1]);
574  case 11: return edges[9] + Or1D(k1, K, oedge[9]);
575  case 12: return faces[4] + Or2D(J - 1 - j1, k1, J, K, oface[4]);
576  case 13: return pOffset + I*(J*k1 + j1) + i1;
577  case 14: return faces[2] + Or2D(j1, k1, J, K, oface[2]);
578  case 15: return edges[11] + Or1D(k1, K, oedge[11]);
579  case 16: return faces[3] + Or2D(I - 1 - i1, k1, I, K, oface[3]);
580  case 17: return edges[10] + Or1D(k1, K, oedge[10]);
581  case 18: return verts[4];
582  case 19: return edges[4] + Or1D(i1, I, oedge[4]);
583  case 20: return verts[5];
584  case 21: return edges[7] + Or1D(j1, J, oedge[7]);
585  case 22: return faces[5] + Or2D(i1, j1, I, J, oface[5]);
586  case 23: return edges[5] + Or1D(j1, J, oedge[5]);
587  case 24: return verts[7];
588  case 25: return edges[6] + Or1D(i1, I, oedge[6]);
589  case 26: return verts[6];
590  }
591 #ifdef MFEM_DEBUG
592  mfem_error("NURBSPatchMap::operator() const 3D");
593 #endif
594  return -1;
595 }
596 
597 }
598 
599 #endif
Array< KnotVector * > knotVectors
Definition: nurbs.hpp:174
Abstract class for Finite Elements.
Definition: fe.hpp:44
Array< KnotVector * > kv
Definition: nurbs.hpp:89
Array< int > f_meshOffsets
Definition: nurbs.hpp:180
KnotVector * DegreeElevate(int t) const
Definition: nurbs.cpp:54
void Get3DPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2470
void Set3DSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2539
NURBSPatch(NURBSPatch *parent, int dir, int Order, int NCP)
Definition: nurbs.cpp:388
Array2D< int > bel_to_IJK
Definition: nurbs.hpp:194
void SetCoordsFromPatches(Vector &Nodes)
Definition: nurbs.cpp:2339
int Size() const
Definition: nurbs.hpp:50
Array< int > activeVert
Definition: nurbs.hpp:166
KnotVector * KnotVec(int edge)
Definition: nurbs.hpp:478
const Vector & GetWeights() const
Definition: nurbs.hpp:318
void swap(NURBSPatch *np)
Definition: nurbs.cpp:403
void Get2DBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1940
Class for grid function - Vector with associated FE space.
Definition: gridfunc.hpp:27
void DegreeElevate(int dir, int t)
Definition: nurbs.cpp:681
int NumOfElements
Definition: nurbs.hpp:35
void SetPatchDofMap(int p, KnotVector *kv[])
Definition: nurbs.cpp:2931
void Generate2DElementDofTable()
Definition: nurbs.cpp:2039
void MergeGridFunctions(GridFunction *gf_array[], int num_pieces, GridFunction &merged)
Definition: nurbs.cpp:1565
Array< int > ldof_group
Definition: nurbs.hpp:350
virtual ~ParNURBSExtension()
Definition: nurbs.hpp:359
void Generate3DElementDofTable()
Definition: nurbs.cpp:2090
void KnotInsert(int dir, const KnotVector &knot)
Definition: nurbs.cpp:543
void MergeWeights(Mesh *mesh_array[], int num_pieces)
Definition: nurbs.cpp:1540
int GetNBE() const
Returns number of boundary elements.
Definition: mesh.hpp:499
void UniformRefinement()
Definition: nurbs.cpp:2396
NURBSPatchMap(NURBSExtension *ext)
Definition: nurbs.hpp:386
int GetNE() const
Definition: nurbs.hpp:46
void Print(std::ostream &out)
Definition: nurbs.cpp:442
void Rotate3D(double normal[], double angle)
Definition: nurbs.cpp:1007
Array< int > e_meshOffsets
Definition: nurbs.hpp:179
int GetNKS() const
Definition: nurbs.hpp:47
int operator()(const int i) const
Definition: nurbs.hpp:520
void GetElements()
Count the number of elements.
Definition: nurbs.cpp:95
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
int Size() const
Returns the size of the vector.
Definition: vector.hpp:86
void GetPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2431
void Generate3DBdrElementDofTable()
Definition: nurbs.cpp:2213
int GetNE() const
Returns number of elements.
Definition: mesh.hpp:496
int NumOfControlPoints
Definition: nurbs.hpp:35
Array< int > e_spaceOffsets
Definition: nurbs.hpp:185
void GenerateBdrElementDofTable()
Definition: nurbs.cpp:2153
const KnotVector * GetKnotVector(int i) const
Definition: nurbs.hpp:300
void Get2DElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1845
void GetElementLocalToGlobal(Array< int > &lelem_elem)
Definition: nurbs.cpp:2278
void init(int dim_)
Definition: nurbs.cpp:277
Array< int > edge_to_knot
Definition: nurbs.hpp:173
void GenerateActiveVertices()
Definition: nurbs.cpp:1451
Array< bool > activeElem
Definition: nurbs.hpp:167
void GetVertexLocalToGlobal(Array< int > &lvert_vert)
Definition: nurbs.cpp:2268
Vector knot
Definition: nurbs.hpp:34
friend NURBSPatch * Revolve3D(NURBSPatch &patch, double n[], double ang, int times)
Definition: nurbs.cpp:1099
Array< int > el_to_patch
Definition: nurbs.hpp:191
void SetBdrPatchVertexMap(int p, KnotVector *kv[], int *okv)
Definition: nurbs.cpp:2961
void SwapDirections(int dir1, int dir2)
Definition: nurbs.cpp:944
void Get3DElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1881
KnotVector()
Create KnotVector.
Definition: nurbs.hpp:39
void Get3DBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1971
static const int MaxOrder
Definition: nurbs.hpp:32
Array< int > v_spaceOffsets
Definition: nurbs.hpp:184
void UniformRefinement(Vector &newknots) const
Definition: nurbs.cpp:81
void LoadFE(int i, const FiniteElement *FE)
Definition: nurbs.cpp:2288
void GetBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1926
void GetElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1831
void Generate2DBdrElementDofTable()
Definition: nurbs.cpp:2172
void GetPatchKnotVectors(int p, Array< KnotVector * > &kv)
Definition: nurbs.cpp:1664
void GenerateActiveBdrElems()
Definition: nurbs.cpp:1518
double * data
Definition: nurbs.hpp:87
Vector & GetWeights()
Definition: nurbs.hpp:319
virtual ~NURBSExtension()
Destroy a NURBSExtension.
Definition: nurbs.cpp:1367
void GenerateOffsets()
Definition: nurbs.cpp:1704
Array< int > activeDof
Definition: nurbs.hpp:169
friend NURBSPatch * Interpolate(NURBSPatch &p1, NURBSPatch &p2)
Definition: nurbs.cpp:1052
static void Get3DRotationMatrix(double n[], double angle, double r, DenseMatrix &T)
Definition: nurbs.cpp:968
void SetKnotsFromPatches()
Definition: nurbs.cpp:2347
void CalcShape(Vector &shape, int i, double xi)
Definition: nurbs.cpp:127
void UniformRefinement()
Definition: nurbs.cpp:525
Array< int > f_spaceOffsets
Definition: nurbs.hpp:186
Array< bool > activeBdrElem
Definition: nurbs.hpp:168
int Dimension() const
Definition: mesh.hpp:523
KnotVector(const KnotVector &kv)
Definition: nurbs.hpp:42
int MakeUniformDegree()
Definition: nurbs.cpp:1033
KnotVector * GetKV(int i)
Definition: nurbs.hpp:122
int KnotInd(int edge)
Definition: nurbs.hpp:472
Array< int > v_meshOffsets
Definition: nurbs.hpp:178
void mfem_error(const char *msg)
Definition: error.cpp:23
void GetBdrPatchKnotVectors(int p, Array< KnotVector * > &kv)
Definition: nurbs.cpp:1685
Array< int > p_meshOffsets
Definition: nurbs.hpp:181
KnotVector & operator=(const KnotVector &kv)
Definition: nurbs.cpp:42
void Set2DSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2512
Table * GetElementDofTable()
Definition: nurbs.hpp:308
Table * GetBdrElementDofTable()
Definition: nurbs.hpp:309
Array2D< int > el_to_IJK
Definition: nurbs.hpp:193
void CountBdrElements()
Definition: nurbs.cpp:1811
ParNURBSExtension(MPI_Comm comm, NURBSExtension *parent, int *partitioning, const Array< bool > &active_bel)
Definition: nurbs.cpp:2571
bool isElement(int i) const
Definition: nurbs.hpp:55
Array< int > p_spaceOffsets
Definition: nurbs.hpp:187
int findKnotSpan(double u) const
Definition: nurbs.cpp:214
int GetNCP() const
Definition: nurbs.hpp:48
double & operator()(int i, int j)
Definition: nurbs.hpp:409
void GenerateElementDofTable()
Definition: nurbs.cpp:2009
Array< NURBSPatch * > patches
Definition: nurbs.hpp:196
const double & operator[](int i) const
Definition: nurbs.hpp:79
void SetBdrPatchDofMap(int p, KnotVector *kv[], int *okv)
Definition: nurbs.cpp:2989
~KnotVector()
Destroys KnotVector.
Definition: nurbs.hpp:76
void Difference(const KnotVector &kv, Vector &diff) const
Definition: nurbs.cpp:243
void CalcDShape(Vector &grad, int i, double xi)
Definition: nurbs.cpp:158
void DegreeElevate(int t)
Definition: nurbs.cpp:2388
void Get2DPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2443
Vector data type.
Definition: vector.hpp:33
int operator[](const int i) const
Definition: nurbs.hpp:399
void LoadBE(int i, const FiniteElement *BE)
Definition: nurbs.cpp:2308
void Print(std::ostream &out) const
Definition: nurbs.cpp:120
double getKnotLocation(double xi, int ni) const
Definition: nurbs.hpp:57
void PrintCharacteristics(std::ostream &out)
Definition: nurbs.cpp:1426
void CheckBdrPatches()
Definition: nurbs.cpp:1636
double & operator[](int i)
Definition: nurbs.hpp:78
void SetPatchVertexMap(int p, KnotVector *kv[])
Definition: nurbs.cpp:2901
void FlipDirection(int dir)
Definition: nurbs.cpp:932
void SetSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2500
GroupTopology gtopo
Definition: nurbs.hpp:348
int GetOrder() const
Definition: nurbs.hpp:49
Array< int > bel_to_patch
Definition: nurbs.hpp:192
void ConvertToPatches(const Vector &Nodes)
Definition: nurbs.cpp:2328
void KnotInsert(Array< KnotVector * > &kv)
Definition: nurbs.cpp:2404
void Print(std::ostream &out) const
Definition: nurbs.cpp:1391
int SetLoopDirection(int dir)
Definition: nurbs.cpp:466