MFEM  v3.3
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 "../linalg/vector.hpp"
18 #include "element.hpp"
19 #include "mesh.hpp"
20 #ifdef MFEM_USE_MPI
21 #include "../general/communication.hpp"
22 #endif
23 #include <iostream>
24 
25 namespace mfem
26 {
27 
28 class GridFunction;
29 
30 
32 {
33 protected:
34  static const int MaxOrder;
35 
38 
39 public:
40  /// Create KnotVector
41  KnotVector() { }
42  KnotVector(std::istream &input);
43  KnotVector(int Order_, int NCP);
44  KnotVector(const KnotVector &kv) { (*this) = kv; }
45 
46  KnotVector &operator=(const KnotVector &kv);
47 
48  int GetNE() const { return NumOfElements; }
49  int GetNKS() const { return NumOfControlPoints - Order; }
50  int GetNCP() const { return NumOfControlPoints; }
51  int GetOrder() const { return Order; }
52  int Size() const { return knot.Size(); }
53 
54  /// Count the number of elements
55  void GetElements();
56 
57  bool isElement(int i) const { return (knot(Order+i) != knot(Order+i+1)); }
58 
59  double getKnotLocation(double xi, int ni) const
60  { return (xi*knot(ni+1) + (1. - xi)*knot(ni)); }
61 
62  int findKnotSpan(double u) const;
63 
64  void CalcShape (Vector &shape, int i, double xi);
65  void CalcDShape(Vector &grad, int i, double xi);
66 
67  void Difference(const KnotVector &kv, Vector &diff) const;
68  void UniformRefinement(Vector &newknots) const;
69  /** Return a new KnotVector with elevated degree by repeating the endpoints
70  of the knot vector. */
71  KnotVector *DegreeElevate(int t) const;
72 
73  void Flip();
74 
75  void Print(std::ostream &out) const;
76 
77  /// Destroys KnotVector
79 
80  double &operator[](int i) { return knot(i); }
81  const double &operator[](int i) const { return knot(i); }
82 };
83 
84 
86 {
87 protected:
88  int ni, nj, nk, Dim;
89  double *data;
90 
92 
93  int sd, nd;
94 
95  void swap(NURBSPatch *np);
96 
97  // Special B-NET access functions
98  int SetLoopDirection(int dir);
99  inline double &operator()(int i, int j);
100  inline const double &operator()(int i, int j) const;
101 
102  void init(int dim_);
103 
104  NURBSPatch(NURBSPatch *parent, int dir, int Order, int NCP);
105 
106 public:
107  NURBSPatch(std::istream &input);
108  NURBSPatch(KnotVector *kv0, KnotVector *kv1, int dim_);
109  NURBSPatch(KnotVector *kv0, KnotVector *kv1, KnotVector *kv2, int dim_);
110  NURBSPatch(Array<KnotVector *> &kv, int dim_);
111 
112  ~NURBSPatch();
113 
114  void Print(std::ostream &out);
115 
116  void DegreeElevate(int dir, int t);
117  void KnotInsert (int dir, const KnotVector &knot);
118  void KnotInsert (int dir, const Vector &knot);
119 
120  void KnotInsert(Array<KnotVector *> &knot);
121  void DegreeElevate(int t);
122  void UniformRefinement();
123 
124  KnotVector *GetKV(int i) { return kv[i]; }
125 
126  // Standard B-NET access functions
127  inline double &operator()(int i, int j, int l);
128  inline const double &operator()(int i, int j, int l) const;
129 
130  inline double &operator()(int i, int j, int k, int l);
131  inline const double &operator()(int i, int j, int k, int l) const;
132 
133  static void Get3DRotationMatrix(double n[], double angle, double r,
134  DenseMatrix &T);
135  void FlipDirection(int dir);
136  void SwapDirections(int dir1, int dir2);
137  void Rotate3D(double normal[], double angle);
138  int MakeUniformDegree();
139  friend NURBSPatch *Interpolate(NURBSPatch &p1, NURBSPatch &p2);
140  friend NURBSPatch *Revolve3D(NURBSPatch &patch, double n[], double ang,
141  int times);
142 };
143 
144 
145 #ifdef MFEM_USE_MPI
146 class ParNURBSExtension;
147 #endif
148 
149 class NURBSPatchMap;
150 
151 
153 {
154 #ifdef MFEM_USE_MPI
155  friend class ParNURBSExtension;
156 #endif
157  friend class NURBSPatchMap;
158 
159 protected:
160  int Order;
162  // global entity counts
164  // local entity counts
167 
168  Array<int> activeVert; // activeVert[glob_vert] = loc_vert or -1
171  Array<int> activeDof; // activeDof[glob_dof] = loc_dof + 1 or 0
172 
174  int own_topo;
178 
179  // global offsets, meshOffsets == meshVertexOffsets
184 
185  // global offsets, spaceOffsets == dofOffsets
190 
192 
195  Array2D<int> el_to_IJK; // IJK are "knot-span" indices!
196  Array2D<int> bel_to_IJK; // they are NOT element indices!
197 
199 
200  inline int KnotInd(int edge);
201  inline KnotVector *KnotVec(int edge);
202  inline KnotVector *KnotVec(int edge, int oedge, int *okv);
203 
204  void CheckPatches();
205  void CheckBdrPatches();
206 
207  void GetPatchKnotVectors (int p, Array<KnotVector *> &kv);
209 
210  // also count the global NumOfVertices and the global NumOfDofs
211  void GenerateOffsets();
212  // count the global NumOfElements
213  void CountElements();
214  // count the global NumOfBdrElements
215  void CountBdrElements();
216 
217  // generate the mesh elements
218  void Get2DElementTopo(Array<Element *> &elements);
219  void Get3DElementTopo(Array<Element *> &elements);
220 
221  // generate the boundary mesh elements
222  void Get2DBdrElementTopo(Array<Element *> &boundary);
223  void Get3DBdrElementTopo(Array<Element *> &boundary);
224 
225 
226  // FE space generation functions
227 
228  // based on activeElem, count NumOfActiveDofs, generate el_dof,
229  // el_to_patch, el_to_IJK, activeDof map (global-to-local)
231 
232  // generate elem_to_global-dof table for the active elements
233  // define el_to_patch, el_to_IJK, activeDof (as bool)
236 
237  // call after GenerateElementDofTable
239 
240  // generate the bdr-elem_to_global-dof table for the active bdr. elements
241  // define bel_to_patch, bel_to_IJK
244 
245  // Patch <--> FE translation functions
246  void GetPatchNets (const Vector &Nodes);
247  void Get2DPatchNets(const Vector &Nodes);
248  void Get3DPatchNets(const Vector &Nodes);
249 
250  void SetSolutionVector (Vector &Nodes);
251  void Set2DSolutionVector(Vector &Nodes);
252  void Set3DSolutionVector(Vector &Nodes);
253 
254  // determine activeVert, NumOfActiveVertices from the activeElem array
255  void GenerateActiveVertices();
256 
257  // determine activeBdrElem, NumOfActiveBdrElems
258  void GenerateActiveBdrElems();
259 
260  void MergeWeights(Mesh *mesh_array[], int num_pieces);
261 
262  // to be used by ParNURBSExtension constructor(s)
264 
265 public:
266  /// Read-in a NURBSExtension
267  NURBSExtension(std::istream &input);
268  /** Create a NURBSExtension with elevated order by repeating the endpoints
269  of the knot vectors and using uniform weights of 1. */
270  NURBSExtension(NURBSExtension *parent, int Order);
271  /// Construct a NURBSExtension by merging a partitioned NURBS mesh
272  NURBSExtension(Mesh *mesh_array[], int num_pieces);
273 
274  void MergeGridFunctions(GridFunction *gf_array[], int num_pieces,
275  GridFunction &merged);
276 
277  /// Destroy a NURBSExtension
278  virtual ~NURBSExtension();
279 
280  // Print functions
281  void Print(std::ostream &out) const;
282  void PrintCharacteristics(std::ostream &out);
283 
284  // Meta data functions
285  int Dimension() { return patchTopo->Dimension(); }
286  int GetNP() { return patchTopo->GetNE(); }
287  int GetNBP() { return patchTopo->GetNBE(); }
288  int GetOrder() { return Order; }
289  int GetNKV() { return NumOfKnotVectors; }
290 
291  int GetGNV() { return NumOfVertices; }
292  int GetNV() { return NumOfActiveVertices; }
293  int GetGNE() { return NumOfElements; }
294  int GetNE() { return NumOfActiveElems; }
295  int GetGNBE() { return NumOfBdrElements; }
296  int GetNBE() { return NumOfActiveBdrElems; }
297 
298  int GetNTotalDof() { return NumOfDofs; }
299  int GetNDof() { return NumOfActiveDofs; }
300 
301  // Knotvector access function
302  const KnotVector *GetKnotVector(int i) const { return knotVectors[i]; }
303 
304  // Mesh generation functions
305  void GetElementTopo (Array<Element *> &elements);
306  void GetBdrElementTopo(Array<Element *> &boundary);
307 
308  bool HavePatches() { return (patches.Size() != 0); }
309 
312 
313  void GetVertexLocalToGlobal(Array<int> &lvert_vert);
314  void GetElementLocalToGlobal(Array<int> &lelem_elem);
315 
316  // Load functions
317  void LoadFE(int i, const FiniteElement *FE);
318  void LoadBE(int i, const FiniteElement *BE);
319 
320  const Vector &GetWeights() const { return weights; }
321  Vector &GetWeights() { return weights; }
322 
323  // Translation functions: from FE coordinates into to IJK patch
324  // format and vice versa
325  void ConvertToPatches(const Vector &Nodes);
326  void SetKnotsFromPatches();
327  void SetCoordsFromPatches(Vector &Nodes);
328 
329  // Refinement methods
330  void DegreeElevate(int t);
331  void UniformRefinement();
333 };
334 
335 
336 #ifdef MFEM_USE_MPI
338 {
339 private:
340  int *partitioning;
341 
342  Table *GetGlobalElementDofTable();
343  Table *Get2DGlobalElementDofTable();
344  Table *Get3DGlobalElementDofTable();
345 
346  void SetActive(int *partitioning, const Array<bool> &active_bel);
347  void BuildGroups(int *partitioning, const Table &elem_dof);
348 
349 public:
351 
353 
354  ParNURBSExtension(MPI_Comm comm, NURBSExtension *parent, int *partitioning,
355  const Array<bool> &active_bel);
356 
357  // create a parallel version of 'parent' with partitioning as in
358  // 'par_parent'; the 'parent' object is destroyed
359  ParNURBSExtension(NURBSExtension *parent, ParNURBSExtension *par_parent);
360 
361  virtual ~ParNURBSExtension() { delete [] partitioning; }
362 };
363 #endif
364 
365 
367 {
368 private:
369  NURBSExtension *Ext;
370 
371  int I, J, K, pOffset, opatch;
372  Array<int> verts, edges, faces, oedge, oface;
373 
374  inline static int F(const int n, const int N)
375  { return (n < 0) ? 0 : ((n >= N) ? 2 : 1); }
376 
377  inline static int Or1D(const int n, const int N, const int Or)
378  { return (Or > 0) ? n : (N - 1 - n); }
379 
380  inline static int Or2D(const int n1, const int n2,
381  const int N1, const int N2, const int Or);
382 
383  // also set verts, edges, faces, orientations etc
384  void GetPatchKnotVectors (int p, KnotVector *kv[]);
385  void GetBdrPatchKnotVectors(int p, KnotVector *kv[], int *okv);
386 
387 public:
388  NURBSPatchMap(NURBSExtension *ext) { Ext = ext; }
389 
390  int nx() { return I + 1; }
391  int ny() { return J + 1; }
392  int nz() { return K + 1; }
393 
394  void SetPatchVertexMap(int p, KnotVector *kv[]);
395  void SetPatchDofMap (int p, KnotVector *kv[]);
396 
397  void SetBdrPatchVertexMap(int p, KnotVector *kv[], int *okv);
398  void SetBdrPatchDofMap (int p, KnotVector *kv[], int *okv);
399 
400  inline int operator()(const int i) const;
401  inline int operator[](const int i) const { return (*this)(i); }
402 
403  inline int operator()(const int i, const int j) const;
404 
405  inline int operator()(const int i, const int j, const int k) const;
406 };
407 
408 
409 // Inline function implementations
410 
411 inline double &NURBSPatch::operator()(int i, int j)
412 {
413  return data[j%sd + sd*(i + (j/sd)*nd)];
414 }
415 
416 inline const double &NURBSPatch::operator()(int i, int j) const
417 {
418  return data[j%sd + sd*(i + (j/sd)*nd)];
419 }
420 
421 inline double &NURBSPatch::operator()(int i, int j, int l)
422 {
423 #ifdef MFEM_DEBUG
424  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || nk > 0 ||
425  l < 0 || l >= Dim)
426  {
427  mfem_error("NURBSPatch::operator() 2D");
428  }
429 #endif
430 
431  return data[(i+j*ni)*Dim+l];
432 }
433 
434 inline const double &NURBSPatch::operator()(int i, int j, int l) const
435 {
436 #ifdef MFEM_DEBUG
437  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || nk > 0 ||
438  l < 0 || l >= Dim)
439  {
440  mfem_error("NURBSPatch::operator() const 2D");
441  }
442 #endif
443 
444  return data[(i+j*ni)*Dim+l];
445 }
446 
447 inline double &NURBSPatch::operator()(int i, int j, int k, int l)
448 {
449 #ifdef MFEM_DEBUG
450  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
451  k >= nk || l < 0 || l >= Dim)
452  {
453  mfem_error("NURBSPatch::operator() 3D");
454  }
455 #endif
456 
457  return data[(i+(j+k*nj)*ni)*Dim+l];
458 }
459 
460 inline const double &NURBSPatch::operator()(int i, int j, int k, int l) const
461 {
462 #ifdef MFEM_DEBUG
463  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
464  k >= nk || l < 0 || l >= Dim)
465  {
466  mfem_error("NURBSPatch::operator() const 3D");
467  }
468 #endif
469 
470  return data[(i+(j+k*nj)*ni)*Dim+l];
471 }
472 
473 
474 inline int NURBSExtension::KnotInd(int edge)
475 {
476  int kv = edge_to_knot[edge];
477  return (kv >= 0) ? kv : (-1-kv);
478 }
479 
481 {
482  return knotVectors[KnotInd(edge)];
483 }
484 
485 inline KnotVector *NURBSExtension::KnotVec(int edge, int oedge, int *okv)
486 {
487  int kv = edge_to_knot[edge];
488  if (kv >= 0)
489  {
490  *okv = oedge;
491  return knotVectors[kv];
492  }
493  else
494  {
495  *okv = -oedge;
496  return knotVectors[-1-kv];
497  }
498 }
499 
500 
501 inline int NURBSPatchMap::Or2D(const int n1, const int n2,
502  const int N1, const int N2, const int Or)
503 {
504  // Needs testing
505  switch (Or)
506  {
507  case 0: return n1 + n2*N1;
508  case 1: return n2 + n1*N2;
509  case 2: return n2 + (N1 - 1 - n1)*N2;
510  case 3: return (N1 - 1 - n1) + n2*N1;
511  case 4: return (N1 - 1 - n1) + (N2 - 1 - n2)*N1;
512  case 5: return (N2 - 1 - n2) + (N1 - 1 - n1)*N2;
513  case 6: return (N2 - 1 - n2) + n1*N2;
514  case 7: return n1 + (N2 - 1 - n2)*N1;
515  }
516 #ifdef MFEM_DEBUG
517  mfem_error("NURBSPatchMap::Or2D");
518 #endif
519  return -1;
520 }
521 
522 inline int NURBSPatchMap::operator()(const int i) const
523 {
524  int i1 = i - 1;
525  switch (F(i1, I))
526  {
527  case 0: return verts[0];
528  case 1: return pOffset + Or1D(i1, I, opatch);
529  case 2: return verts[1];
530  }
531 #ifdef MFEM_DEBUG
532  mfem_error("NURBSPatchMap::operator() const 1D");
533 #endif
534  return -1;
535 }
536 
537 inline int NURBSPatchMap::operator()(const int i, const int j) const
538 {
539  int i1 = i - 1, j1 = j - 1;
540  switch (3*F(j1, J) + F(i1, I))
541  {
542  case 0: return verts[0];
543  case 1: return edges[0] + Or1D(i1, I, oedge[0]);
544  case 2: return verts[1];
545  case 3: return edges[3] + Or1D(j1, J, -oedge[3]);
546  case 4: return pOffset + Or2D(i1, j1, I, J, opatch);
547  case 5: return edges[1] + Or1D(j1, J, oedge[1]);
548  case 6: return verts[3];
549  case 7: return edges[2] + Or1D(i1, I, -oedge[2]);
550  case 8: return verts[2];
551  }
552 #ifdef MFEM_DEBUG
553  mfem_error("NURBSPatchMap::operator() const 2D");
554 #endif
555  return -1;
556 }
557 
558 inline int NURBSPatchMap::operator()(const int i, const int j, const int k)
559 const
560 {
561  // Needs testing
562  int i1 = i - 1, j1 = j - 1, k1 = k - 1;
563  switch (3*(3*F(k1, K) + F(j1, J)) + F(i1, I))
564  {
565  case 0: return verts[0];
566  case 1: return edges[0] + Or1D(i1, I, oedge[0]);
567  case 2: return verts[1];
568  case 3: return edges[3] + Or1D(j1, J, oedge[3]);
569  case 4: return faces[0] + Or2D(i1, J - 1 - j1, I, J, oface[0]);
570  case 5: return edges[1] + Or1D(j1, J, oedge[1]);
571  case 6: return verts[3];
572  case 7: return edges[2] + Or1D(i1, I, oedge[2]);
573  case 8: return verts[2];
574  case 9: return edges[8] + Or1D(k1, K, oedge[8]);
575  case 10: return faces[1] + Or2D(i1, k1, I, K, oface[1]);
576  case 11: return edges[9] + Or1D(k1, K, oedge[9]);
577  case 12: return faces[4] + Or2D(J - 1 - j1, k1, J, K, oface[4]);
578  case 13: return pOffset + I*(J*k1 + j1) + i1;
579  case 14: return faces[2] + Or2D(j1, k1, J, K, oface[2]);
580  case 15: return edges[11] + Or1D(k1, K, oedge[11]);
581  case 16: return faces[3] + Or2D(I - 1 - i1, k1, I, K, oface[3]);
582  case 17: return edges[10] + Or1D(k1, K, oedge[10]);
583  case 18: return verts[4];
584  case 19: return edges[4] + Or1D(i1, I, oedge[4]);
585  case 20: return verts[5];
586  case 21: return edges[7] + Or1D(j1, J, oedge[7]);
587  case 22: return faces[5] + Or2D(i1, j1, I, J, oface[5]);
588  case 23: return edges[5] + Or1D(j1, J, oedge[5]);
589  case 24: return verts[7];
590  case 25: return edges[6] + Or1D(i1, I, oedge[6]);
591  case 26: return verts[6];
592  }
593 #ifdef MFEM_DEBUG
594  mfem_error("NURBSPatchMap::operator() const 3D");
595 #endif
596  return -1;
597 }
598 
599 }
600 
601 #endif
Array< KnotVector * > knotVectors
Definition: nurbs.hpp:176
Abstract class for Finite Elements.
Definition: fe.hpp:46
Array< KnotVector * > kv
Definition: nurbs.hpp:91
Array< int > f_meshOffsets
Definition: nurbs.hpp:182
KnotVector * DegreeElevate(int t) const
Definition: nurbs.cpp:57
void Get3DPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2473
void Set3DSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2542
NURBSPatch(NURBSPatch *parent, int dir, int Order, int NCP)
Definition: nurbs.cpp:391
Array2D< int > bel_to_IJK
Definition: nurbs.hpp:196
void SetCoordsFromPatches(Vector &Nodes)
Definition: nurbs.cpp:2342
int Size() const
Definition: nurbs.hpp:52
Array< int > activeVert
Definition: nurbs.hpp:168
KnotVector * KnotVec(int edge)
Definition: nurbs.hpp:480
const Vector & GetWeights() const
Definition: nurbs.hpp:320
void swap(NURBSPatch *np)
Definition: nurbs.cpp:406
void Get2DBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1943
Class for grid function - Vector with associated FE space.
Definition: gridfunc.hpp:27
void DegreeElevate(int dir, int t)
Definition: nurbs.cpp:684
int NumOfElements
Definition: nurbs.hpp:37
void SetPatchDofMap(int p, KnotVector *kv[])
Definition: nurbs.cpp:2934
void Generate2DElementDofTable()
Definition: nurbs.cpp:2042
void MergeGridFunctions(GridFunction *gf_array[], int num_pieces, GridFunction &merged)
Definition: nurbs.cpp:1568
Array< int > ldof_group
Definition: nurbs.hpp:352
virtual ~ParNURBSExtension()
Definition: nurbs.hpp:361
void Generate3DElementDofTable()
Definition: nurbs.cpp:2093
void KnotInsert(int dir, const KnotVector &knot)
Definition: nurbs.cpp:546
void MergeWeights(Mesh *mesh_array[], int num_pieces)
Definition: nurbs.cpp:1543
int GetNBE() const
Returns number of boundary elements.
Definition: mesh.hpp:587
void UniformRefinement()
Definition: nurbs.cpp:2399
NURBSPatchMap(NURBSExtension *ext)
Definition: nurbs.hpp:388
int GetNE() const
Definition: nurbs.hpp:48
void Print(std::ostream &out)
Definition: nurbs.cpp:445
void Rotate3D(double normal[], double angle)
Definition: nurbs.cpp:1010
Array< int > e_meshOffsets
Definition: nurbs.hpp:181
int GetNKS() const
Definition: nurbs.hpp:49
int operator()(const int i) const
Definition: nurbs.hpp:522
void GetElements()
Count the number of elements.
Definition: nurbs.cpp:98
Data type dense matrix using column-major storage.
Definition: densemat.hpp:22
int Size() const
Returns the size of the vector.
Definition: vector.hpp:106
void GetPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2434
void Generate3DBdrElementDofTable()
Definition: nurbs.cpp:2216
int GetNE() const
Returns number of elements.
Definition: mesh.hpp:584
int NumOfControlPoints
Definition: nurbs.hpp:37
Array< int > e_spaceOffsets
Definition: nurbs.hpp:187
void GenerateBdrElementDofTable()
Definition: nurbs.cpp:2156
const KnotVector * GetKnotVector(int i) const
Definition: nurbs.hpp:302
void Get2DElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1848
void GetElementLocalToGlobal(Array< int > &lelem_elem)
Definition: nurbs.cpp:2281
void init(int dim_)
Definition: nurbs.cpp:280
Array< int > edge_to_knot
Definition: nurbs.hpp:175
void GenerateActiveVertices()
Definition: nurbs.cpp:1454
Array< bool > activeElem
Definition: nurbs.hpp:169
void GetVertexLocalToGlobal(Array< int > &lvert_vert)
Definition: nurbs.cpp:2271
Vector knot
Definition: nurbs.hpp:36
friend NURBSPatch * Revolve3D(NURBSPatch &patch, double n[], double ang, int times)
Definition: nurbs.cpp:1102
Array< int > el_to_patch
Definition: nurbs.hpp:193
void SetBdrPatchVertexMap(int p, KnotVector *kv[], int *okv)
Definition: nurbs.cpp:2964
void SwapDirections(int dir1, int dir2)
Definition: nurbs.cpp:947
void Get3DElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1884
KnotVector()
Create KnotVector.
Definition: nurbs.hpp:41
void Get3DBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1974
static const int MaxOrder
Definition: nurbs.hpp:34
Array< int > v_spaceOffsets
Definition: nurbs.hpp:186
void UniformRefinement(Vector &newknots) const
Definition: nurbs.cpp:84
void LoadFE(int i, const FiniteElement *FE)
Definition: nurbs.cpp:2291
void GetBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1929
void GetElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1834
void Generate2DBdrElementDofTable()
Definition: nurbs.cpp:2175
void GetPatchKnotVectors(int p, Array< KnotVector * > &kv)
Definition: nurbs.cpp:1667
void GenerateActiveBdrElems()
Definition: nurbs.cpp:1521
double * data
Definition: nurbs.hpp:89
Vector & GetWeights()
Definition: nurbs.hpp:321
virtual ~NURBSExtension()
Destroy a NURBSExtension.
Definition: nurbs.cpp:1370
void GenerateOffsets()
Definition: nurbs.cpp:1707
Array< int > activeDof
Definition: nurbs.hpp:171
friend NURBSPatch * Interpolate(NURBSPatch &p1, NURBSPatch &p2)
Definition: nurbs.cpp:1055
static void Get3DRotationMatrix(double n[], double angle, double r, DenseMatrix &T)
Definition: nurbs.cpp:971
void SetKnotsFromPatches()
Definition: nurbs.cpp:2350
void CalcShape(Vector &shape, int i, double xi)
Definition: nurbs.cpp:130
void UniformRefinement()
Definition: nurbs.cpp:528
Array< int > f_spaceOffsets
Definition: nurbs.hpp:188
Array< bool > activeBdrElem
Definition: nurbs.hpp:170
int Dimension() const
Definition: mesh.hpp:611
KnotVector(const KnotVector &kv)
Definition: nurbs.hpp:44
int MakeUniformDegree()
Definition: nurbs.cpp:1036
KnotVector * GetKV(int i)
Definition: nurbs.hpp:124
int KnotInd(int edge)
Definition: nurbs.hpp:474
Array< int > v_meshOffsets
Definition: nurbs.hpp:180
void mfem_error(const char *msg)
Definition: error.cpp:106
void GetBdrPatchKnotVectors(int p, Array< KnotVector * > &kv)
Definition: nurbs.cpp:1688
Array< int > p_meshOffsets
Definition: nurbs.hpp:183
KnotVector & operator=(const KnotVector &kv)
Definition: nurbs.cpp:45
void Set2DSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2515
Table * GetElementDofTable()
Definition: nurbs.hpp:310
Table * GetBdrElementDofTable()
Definition: nurbs.hpp:311
Array2D< int > el_to_IJK
Definition: nurbs.hpp:195
void CountBdrElements()
Definition: nurbs.cpp:1814
ParNURBSExtension(MPI_Comm comm, NURBSExtension *parent, int *partitioning, const Array< bool > &active_bel)
Definition: nurbs.cpp:2574
bool isElement(int i) const
Definition: nurbs.hpp:57
Array< int > p_spaceOffsets
Definition: nurbs.hpp:189
int findKnotSpan(double u) const
Definition: nurbs.cpp:217
int GetNCP() const
Definition: nurbs.hpp:50
double & operator()(int i, int j)
Definition: nurbs.hpp:411
void GenerateElementDofTable()
Definition: nurbs.cpp:2012
Array< NURBSPatch * > patches
Definition: nurbs.hpp:198
const double & operator[](int i) const
Definition: nurbs.hpp:81
void SetBdrPatchDofMap(int p, KnotVector *kv[], int *okv)
Definition: nurbs.cpp:2992
~KnotVector()
Destroys KnotVector.
Definition: nurbs.hpp:78
void Difference(const KnotVector &kv, Vector &diff) const
Definition: nurbs.cpp:246
void CalcDShape(Vector &grad, int i, double xi)
Definition: nurbs.cpp:161
void DegreeElevate(int t)
Definition: nurbs.cpp:2391
void Get2DPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2446
Vector data type.
Definition: vector.hpp:36
int operator[](const int i) const
Definition: nurbs.hpp:401
void LoadBE(int i, const FiniteElement *BE)
Definition: nurbs.cpp:2311
void Print(std::ostream &out) const
Definition: nurbs.cpp:123
double getKnotLocation(double xi, int ni) const
Definition: nurbs.hpp:59
void PrintCharacteristics(std::ostream &out)
Definition: nurbs.cpp:1429
void CheckBdrPatches()
Definition: nurbs.cpp:1639
double & operator[](int i)
Definition: nurbs.hpp:80
void SetPatchVertexMap(int p, KnotVector *kv[])
Definition: nurbs.cpp:2904
void FlipDirection(int dir)
Definition: nurbs.cpp:935
void SetSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2503
GroupTopology gtopo
Definition: nurbs.hpp:350
int GetOrder() const
Definition: nurbs.hpp:51
Array< int > bel_to_patch
Definition: nurbs.hpp:194
void ConvertToPatches(const Vector &Nodes)
Definition: nurbs.cpp:2331
void KnotInsert(Array< KnotVector * > &kv)
Definition: nurbs.cpp:2407
void Print(std::ostream &out) const
Definition: nurbs.cpp:1394
int SetLoopDirection(int dir)
Definition: nurbs.cpp:469