MFEM  v3.0
 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.googlecode.com.
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 acces 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 acces 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 acces 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  mfem_error("NURBSPatch::operator() 2D");
425 #endif
426 
427  return data[(i+j*ni)*Dim+l];
428 }
429 
430 inline const double &NURBSPatch::operator()(int i, int j, int l) const
431 {
432 #ifdef MFEM_DEBUG
433  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || nk > 0 ||
434  l < 0 || l >= Dim)
435  mfem_error("NURBSPatch::operator() const 2D");
436 #endif
437 
438  return data[(i+j*ni)*Dim+l];
439 }
440 
441 inline double &NURBSPatch::operator()(int i, int j, int k, int l)
442 {
443 #ifdef MFEM_DEBUG
444  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
445  k >= nk || l < 0 || l >= Dim)
446  mfem_error("NURBSPatch::operator() 3D");
447 #endif
448 
449  return data[(i+(j+k*nj)*ni)*Dim+l];
450 }
451 
452 inline const double &NURBSPatch::operator()(int i, int j, int k, int l) const
453 {
454 #ifdef MFEM_DEBUG
455  if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
456  k >= nk || l < 0 || l >= Dim)
457  mfem_error("NURBSPatch::operator() const 3D");
458 #endif
459 
460  return data[(i+(j+k*nj)*ni)*Dim+l];
461 }
462 
463 
464 inline int NURBSExtension::KnotInd(int edge)
465 {
466  int kv = edge_to_knot[edge];
467  return (kv >= 0) ? kv : (-1-kv);
468 }
469 
471 {
472  return knotVectors[KnotInd(edge)];
473 }
474 
475 inline KnotVector *NURBSExtension::KnotVec(int edge, int oedge, int *okv)
476 {
477  int kv = edge_to_knot[edge];
478  if (kv >= 0)
479  {
480  *okv = oedge;
481  return knotVectors[kv];
482  }
483  else
484  {
485  *okv = -oedge;
486  return knotVectors[-1-kv];
487  }
488 }
489 
490 
491 inline int NURBSPatchMap::Or2D(const int n1, const int n2,
492  const int N1, const int N2, const int Or)
493 {
494  // Needs testing
495  switch (Or)
496  {
497  case 0: return n1 + n2*N1;
498  case 1: return n2 + n1*N2;
499  case 2: return n2 + (N1 - 1 - n1)*N2;
500  case 3: return (N1 - 1 - n1) + n2*N1;
501  case 4: return (N1 - 1 - n1) + (N2 - 1 - n2)*N1;
502  case 5: return (N2 - 1 - n2) + (N1 - 1 - n1)*N2;
503  case 6: return (N2 - 1 - n2) + n1*N2;
504  case 7: return n1 + (N2 - 1 - n2)*N1;
505  }
506 #ifdef MFEM_DEBUG
507  mfem_error("NURBSPatchMap::Or2D");
508 #endif
509  return -1;
510 }
511 
512 inline int NURBSPatchMap::operator()(const int i) const
513 {
514  int i1 = i - 1;
515  switch (F(i1, I))
516  {
517  case 0: return verts[0];
518  case 1: return pOffset + Or1D(i1, I, opatch);
519  case 2: return verts[1];
520  }
521 #ifdef MFEM_DEBUG
522  mfem_error("NURBSPatchMap::operator() const 1D");
523 #endif
524  return -1;
525 }
526 
527 inline int NURBSPatchMap::operator()(const int i, const int j) const
528 {
529  int i1 = i - 1, j1 = j - 1;
530  switch (3*F(j1, J) + F(i1, I))
531  {
532  case 0: return verts[0];
533  case 1: return edges[0] + Or1D(i1, I, oedge[0]);
534  case 2: return verts[1];
535  case 3: return edges[3] + Or1D(j1, J, -oedge[3]);
536  case 4: return pOffset + Or2D(i1, j1, I, J, opatch);
537  case 5: return edges[1] + Or1D(j1, J, oedge[1]);
538  case 6: return verts[3];
539  case 7: return edges[2] + Or1D(i1, I, -oedge[2]);
540  case 8: return verts[2];
541  }
542 #ifdef MFEM_DEBUG
543  mfem_error("NURBSPatchMap::operator() const 2D");
544 #endif
545  return -1;
546 }
547 
548 inline int NURBSPatchMap::operator()(const int i, const int j, const int k)
549  const
550 {
551  // Needs testing
552  int i1 = i - 1, j1 = j - 1, k1 = k - 1;
553  switch (3*(3*F(k1, K) + F(j1, J)) + F(i1, I))
554  {
555  case 0: return verts[0];
556  case 1: return edges[0] + Or1D(i1, I, oedge[0]);
557  case 2: return verts[1];
558  case 3: return edges[3] + Or1D(j1, J, oedge[3]);
559  case 4: return faces[0] + Or2D(i1, J - 1 - j1, I, J, oface[0]);
560  case 5: return edges[1] + Or1D(j1, J, oedge[1]);
561  case 6: return verts[3];
562  case 7: return edges[2] + Or1D(i1, I, oedge[2]);
563  case 8: return verts[2];
564  case 9: return edges[8] + Or1D(k1, K, oedge[8]);
565  case 10: return faces[1] + Or2D(i1, k1, I, K, oface[1]);
566  case 11: return edges[9] + Or1D(k1, K, oedge[9]);
567  case 12: return faces[4] + Or2D(J - 1 - j1, k1, J, K, oface[4]);
568  case 13: return pOffset + I*(J*k1 + j1) + i1;
569  case 14: return faces[2] + Or2D(j1, k1, J, K, oface[2]);
570  case 15: return edges[11] + Or1D(k1, K, oedge[11]);
571  case 16: return faces[3] + Or2D(I - 1 - i1, k1, I, K, oface[3]);
572  case 17: return edges[10] + Or1D(k1, K, oedge[10]);
573  case 18: return verts[4];
574  case 19: return edges[4] + Or1D(i1, I, oedge[4]);
575  case 20: return verts[5];
576  case 21: return edges[7] + Or1D(j1, J, oedge[7]);
577  case 22: return faces[5] + Or2D(i1, j1, I, J, oface[5]);
578  case 23: return edges[5] + Or1D(j1, J, oedge[5]);
579  case 24: return verts[7];
580  case 25: return edges[6] + Or1D(i1, I, oedge[6]);
581  case 26: return verts[6];
582  }
583 #ifdef MFEM_DEBUG
584  mfem_error("NURBSPatchMap::operator() const 3D");
585 #endif
586  return -1;
587 }
588 
589 }
590 
591 #endif
Array< KnotVector * > knotVectors
Definition: nurbs.hpp:174
Abstract class for Finite Elements.
Definition: fe.hpp:42
Array< KnotVector * > kv
Definition: nurbs.hpp:89
Array< int > f_meshOffsets
Definition: nurbs.hpp:180
KnotVector * DegreeElevate(int t) const
Definition: nurbs.cpp:50
void Get3DPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2318
void Set3DSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2387
NURBSPatch(NURBSPatch *parent, int dir, int Order, int NCP)
Definition: nurbs.cpp:364
Array2D< int > bel_to_IJK
Definition: nurbs.hpp:194
void SetCoordsFromPatches(Vector &Nodes)
Definition: nurbs.cpp:2189
int Size() const
Definition: nurbs.hpp:50
Array< int > activeVert
Definition: nurbs.hpp:166
KnotVector * KnotVec(int edge)
Definition: nurbs.hpp:470
const Vector & GetWeights() const
Definition: nurbs.hpp:318
void swap(NURBSPatch *np)
Definition: nurbs.cpp:375
void Get2DBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1796
Class for grid function - Vector with associated FE space.
Definition: gridfunc.hpp:26
void DegreeElevate(int dir, int t)
Definition: nurbs.cpp:629
int NumOfElements
Definition: nurbs.hpp:35
void SetPatchDofMap(int p, KnotVector *kv[])
Definition: nurbs.cpp:2759
void Generate2DElementDofTable()
Definition: nurbs.cpp:1895
void MergeGridFunctions(GridFunction *gf_array[], int num_pieces, GridFunction &merged)
Definition: nurbs.cpp:1429
Array< int > ldof_group
Definition: nurbs.hpp:350
virtual ~ParNURBSExtension()
Definition: nurbs.hpp:359
void Generate3DElementDofTable()
Definition: nurbs.cpp:1946
void KnotInsert(int dir, const KnotVector &knot)
Definition: nurbs.cpp:509
void MergeWeights(Mesh *mesh_array[], int num_pieces)
Definition: nurbs.cpp:1406
int GetNBE() const
Returns number of boundary elements.
Definition: mesh.hpp:399
void UniformRefinement()
Definition: nurbs.cpp:2244
NURBSPatchMap(NURBSExtension *ext)
Definition: nurbs.hpp:386
int GetNE() const
Definition: nurbs.hpp:46
void Print(std::ostream &out)
Definition: nurbs.cpp:410
void Rotate3D(double normal[], double angle)
Definition: nurbs.cpp:917
Array< int > e_meshOffsets
Definition: nurbs.hpp:179
int GetNKS() const
Definition: nurbs.hpp:47
int operator()(const int i) const
Definition: nurbs.hpp:512
void GetElements()
Count the number of elements.
Definition: nurbs.cpp:91
Data type dense matrix.
Definition: densemat.hpp:22
int Size() const
Returns the size of the vector.
Definition: vector.hpp:76
void GetPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2279
void Generate3DBdrElementDofTable()
Definition: nurbs.cpp:2069
int GetNE() const
Returns number of elements.
Definition: mesh.hpp:396
int NumOfControlPoints
Definition: nurbs.hpp:35
Array< int > e_spaceOffsets
Definition: nurbs.hpp:185
void GenerateBdrElementDofTable()
Definition: nurbs.cpp:2009
const KnotVector * GetKnotVector(int i) const
Definition: nurbs.hpp:300
void Get2DElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1701
void GetElementLocalToGlobal(Array< int > &lelem_elem)
Definition: nurbs.cpp:2132
void init(int dim_)
Definition: nurbs.cpp:265
Array< int > edge_to_knot
Definition: nurbs.hpp:173
void GenerateActiveVertices()
Definition: nurbs.cpp:1321
Array< bool > activeElem
Definition: nurbs.hpp:167
void GetVertexLocalToGlobal(Array< int > &lvert_vert)
Definition: nurbs.cpp:2124
Vector knot
Definition: nurbs.hpp:34
friend NURBSPatch * Revolve3D(NURBSPatch &patch, double n[], double ang, int times)
Definition: nurbs.cpp:999
Array< int > el_to_patch
Definition: nurbs.hpp:191
void SetBdrPatchVertexMap(int p, KnotVector *kv[], int *okv)
Definition: nurbs.cpp:2783
void SwapDirections(int dir1, int dir2)
Definition: nurbs.cpp:856
void Get3DElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1737
KnotVector()
Create KnotVector.
Definition: nurbs.hpp:39
void Get3DBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1827
static const int MaxOrder
Definition: nurbs.hpp:32
Array< int > v_spaceOffsets
Definition: nurbs.hpp:184
void UniformRefinement(Vector &newknots) const
Definition: nurbs.cpp:77
void LoadFE(int i, const FiniteElement *FE)
Definition: nurbs.cpp:2140
void GetBdrElementTopo(Array< Element * > &boundary)
Definition: nurbs.cpp:1782
void GetElementTopo(Array< Element * > &elements)
Definition: nurbs.cpp:1687
void Generate2DBdrElementDofTable()
Definition: nurbs.cpp:2028
void GetPatchKnotVectors(int p, Array< KnotVector * > &kv)
Definition: nurbs.cpp:1524
void GenerateActiveBdrElems()
Definition: nurbs.cpp:1384
double * data
Definition: nurbs.hpp:87
Vector & GetWeights()
Definition: nurbs.hpp:319
virtual ~NURBSExtension()
Destroy a NURBSExtension.
Definition: nurbs.cpp:1260
void GenerateOffsets()
Definition: nurbs.cpp:1564
Array< int > activeDof
Definition: nurbs.hpp:169
friend NURBSPatch * Interpolate(NURBSPatch &p1, NURBSPatch &p2)
Definition: nurbs.cpp:954
static void Get3DRotationMatrix(double n[], double angle, double r, DenseMatrix &T)
Definition: nurbs.cpp:878
void SetKnotsFromPatches()
Definition: nurbs.cpp:2197
void CalcShape(Vector &shape, int i, double xi)
Definition: nurbs.cpp:123
void UniformRefinement()
Definition: nurbs.cpp:491
Array< int > f_spaceOffsets
Definition: nurbs.hpp:186
Array< bool > activeBdrElem
Definition: nurbs.hpp:168
int Dimension() const
Definition: mesh.hpp:417
KnotVector(const KnotVector &kv)
Definition: nurbs.hpp:42
int MakeUniformDegree()
Definition: nurbs.cpp:939
KnotVector * GetKV(int i)
Definition: nurbs.hpp:122
int KnotInd(int edge)
Definition: nurbs.hpp:464
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:1545
Array< int > p_meshOffsets
Definition: nurbs.hpp:181
KnotVector & operator=(const KnotVector &kv)
Definition: nurbs.cpp:38
void Set2DSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2360
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:1669
ParNURBSExtension(MPI_Comm comm, NURBSExtension *parent, int *partitioning, const Array< bool > &active_bel)
Definition: nurbs.cpp:2419
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:202
int GetNCP() const
Definition: nurbs.hpp:48
double & operator()(int i, int j)
Definition: nurbs.hpp:409
void GenerateElementDofTable()
Definition: nurbs.cpp:1865
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:2807
~KnotVector()
Destroys KnotVector.
Definition: nurbs.hpp:76
void Difference(const KnotVector &kv, Vector &diff) const
Definition: nurbs.cpp:231
void CalcDShape(Vector &grad, int i, double xi)
Definition: nurbs.cpp:152
void DegreeElevate(int t)
Definition: nurbs.cpp:2236
void Get2DPatchNets(const Vector &Nodes)
Definition: nurbs.cpp:2291
Vector data type.
Definition: vector.hpp:29
int operator[](const int i) const
Definition: nurbs.hpp:399
void LoadBE(int i, const FiniteElement *BE)
Definition: nurbs.cpp:2160
void Print(std::ostream &out) const
Definition: nurbs.cpp:116
double getKnotLocation(double xi, int ni) const
Definition: nurbs.hpp:57
void PrintCharacteristics(std::ostream &out)
Definition: nurbs.cpp:1296
void CheckBdrPatches()
Definition: nurbs.cpp:1498
double & operator[](int i)
Definition: nurbs.hpp:78
void SetPatchVertexMap(int p, KnotVector *kv[])
Definition: nurbs.cpp:2735
void FlipDirection(int dir)
Definition: nurbs.cpp:846
void SetSolutionVector(Vector &Nodes)
Definition: nurbs.cpp:2348
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:2180
void KnotInsert(Array< KnotVector * > &kv)
Definition: nurbs.cpp:2252
void Print(std::ostream &out) const
Definition: nurbs.cpp:1275
int SetLoopDirection(int dir)
Definition: nurbs.cpp:432