MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
nurbs.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2024, Lawrence Livermore National Security, LLC. Produced
2// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3// LICENSE and NOTICE for details. LLNL-CODE-806117.
4//
5// This file is part of the MFEM library. For more information and source code
6// availability visit https://mfem.org.
7//
8// MFEM is free software; you can redistribute it and/or modify it under the
9// terms of the BSD-3 license. We welcome feedback and contributions, see file
10// CONTRIBUTING.md for details.
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#include "spacing.hpp"
21#ifdef MFEM_USE_MPI
23#endif
24#include <iostream>
25#include <set>
26
27namespace mfem
28{
29
30class GridFunction;
31
32
34{
35protected:
36 static const int MaxOrder;
37
38 Vector knot; // Values of knots
40
41public:
42 /// Create KnotVector
44 KnotVector(std::istream &input);
45 KnotVector(int Order_, int NCP);
46 KnotVector(const KnotVector &kv) { (*this) = kv; }
47
49
50 int GetNE() const { return NumOfElements; }
51 int GetNKS() const { return NumOfControlPoints - Order; }
52 int GetNCP() const { return NumOfControlPoints; }
53 int GetOrder() const { return Order; }
54 int Size() const { return knot.Size(); }
55
56 /// Count the number of elements
57 void GetElements();
58
59 bool isElement(int i) const { return (knot(Order+i) != knot(Order+i+1)); }
60
61 real_t getKnotLocation(real_t xi, int ni) const
62 { return (xi*knot(ni+1) + (1. - xi)*knot(ni)); }
63
64 int findKnotSpan(real_t u) const;
65
66 void CalcShape (Vector &shape, int i, real_t xi) const;
67 void CalcDShape (Vector &grad, int i, real_t xi) const;
68 void CalcDnShape(Vector &gradn, int n, int i, real_t xi) const;
69 void CalcD2Shape(Vector &grad2, int i, real_t xi) const
70 { CalcDnShape(grad2, 2, i, xi); }
71
72 /** Gives the locations of the maxima of the knotvector in reference space.
73 The function gives the knotspan @a ks, the coordinate in the knotspan
74 @a xi and the coordinate of the maximum in parameter space @a u */
75 void FindMaxima(Array<int> &ks, Vector &xi, Vector &u) const;
76 /** Global curve interpolation through the points @a x. @a x is an array with
77 the length of the spatial dimension containing vectors with spatial
78 coordinates. The control points of the interpolated curve are given in
79 @a x in the same form.*/
81
82 /// Finds the knots in the larger of this and kv, not contained in the other.
83 void Difference(const KnotVector &kv, Vector &diff) const;
84
85 /// Refine uniformly with refinement factor @a rf.
86 void UniformRefinement(Vector &newknots, int rf) const;
87 /// Refine with refinement factor @a rf.
88 void Refinement(Vector &newknots, int rf) const;
89
90 /** Returns the coarsening factor needed for non-nested nonuniform spacing
91 functions, to result in a single element from which refinement can be
92 done. The return value is 1 if uniform or nested spacing is used. */
93 int GetCoarseningFactor() const;
94
95 /** For a given coarsening factor @a cf, find the fine knots between the
96 coarse knots. */
97 Vector GetFineKnots(const int cf) const;
98
99 /** Return a new KnotVector with elevated degree by repeating the endpoints
100 of the knot vector. */
101 /// @note The returned object should be deleted by the caller.
102 KnotVector *DegreeElevate(int t) const;
103
104 void Flip();
105
106 void Print(std::ostream &os) const;
107
108 /** Prints the non-zero shape functions and their first and second
109 derivatives associated with the KnotVector per element. Use GetElements()
110 to count the elements before using this function. @a samples is the
111 number of samples of the shape functions per element.*/
112 void PrintFunctions(std::ostream &os, int samples=11) const;
113
114 /// Destroys KnotVector
116
117 real_t &operator[](int i) { return knot(i); }
118 const real_t &operator[](int i) const { return knot(i); }
119
120 /// Function to define the distribution of knots for any number of knot spans.
121 std::shared_ptr<SpacingFunction> spacing;
122
123 /** Flag to indicate whether the KnotVector has been coarsened, which means
124 it is ready for non-nested refinement. */
125 bool coarse;
126};
127
128
130{
131protected:
132 int ni, nj, nk, Dim;
133 real_t *data; // the layout of data is: (Dim x ni x nj x nk)
134 // Note that Dim is the spatial dimension plus 1 (homogeneous coordinates).
135
137
138 // Special B-NET access functions
139 // - SetLoopDirection(int dir) flattens the multi-dimensional B-NET in the
140 // requested direction. It effectively creates a 1D net in homogeneous
141 // coordinates.
142 // - The slice(int, int) operator is the access function in that flattened
143 // structure. The first int gives the slice and the second int the element
144 // in that slice.
145 // - Both routines are used in 'KnotInsert', `KnotRemove`, 'DegreeElevate',
146 // and 'UniformRefinement'.
147 // - In older implementations, slice(int, int) was implemented as
148 // operator()(int, int).
149 int nd; // Number of control points in flattened structure
150 int ls; // Number of variables per control point in flattened structure
151 int sd; // Stride for data access
152 int SetLoopDirection(int dir);
153 inline real_t &slice(int i, int j);
154 inline const real_t &slice(int i, int j) const;
155
156 NURBSPatch(NURBSPatch *parent, int dir, int Order, int NCP);
157 void swap(NURBSPatch *np);
158 void init(int dim_);
159
160public:
161 NURBSPatch(const NURBSPatch &orig);
162 NURBSPatch(std::istream &input);
163 NURBSPatch(const KnotVector *kv0, const KnotVector *kv1, int dim_);
164 NURBSPatch(const KnotVector *kv0, const KnotVector *kv1,
165 const KnotVector *kv2, int dim_);
167
168 NURBSPatch& operator=(const NURBSPatch&) = delete;
169
170 ~NURBSPatch();
171
172 void Print(std::ostream &os) const;
173
174 void DegreeElevate(int dir, int t);
175
176 /// Insert knots from @a knot determined by @a Difference, in direction @a dir.
177 void KnotInsert(int dir, const KnotVector &knot);
178 /// Insert knots from @a knot, in direction @a dir.
179 void KnotInsert(int dir, const Vector &knot);
180
181 /// Insert knots from @a knot, in each direction.
182 void KnotInsert(Array<Vector *> &knot);
183 /// Insert knots from @a knot determined by @a Difference, in each direction.
185
186 /** @brief Remove knot with value @a knot from direction @a dir.
187
188 The optional input parameter @a ntimes specifies the number of times the
189 knot should be removed, default 1. The knot is removed only if the new
190 curve (in direction @a dir) deviates from the old curve by less than
191 @a tol.
192
193 @returns The number of times the knot was successfully removed. */
194 int KnotRemove(int dir, real_t knot, int ntimes=1, real_t tol = 1.0e-12);
195
196 /// Remove all knots in @a knot once.
197 void KnotRemove(int dir, Vector const& knot, real_t tol = 1.0e-12);
198 /// Remove all knots in @a knot once, for each direction.
199 void KnotRemove(Array<Vector *> &knot, real_t tol = 1.0e-12);
200
201 void DegreeElevate(int t);
202
203 /** @brief Refine with optional refinement factor @a rf. Uniform means
204 refinement is done everywhere by the same factor, although nonuniform
205 spacing functions may be used.
206
207 @param[in] rf Optional refinement factor. If scalar, the factor is used
208 for all dimensions. If an array, factors can be specified
209 for each dimension. */
210 void UniformRefinement(int rf = 2);
211 void UniformRefinement(Array<int> const& rf);
212
213 /** @brief Coarsen with optional coarsening factor @a cf which divides the
214 number of elements in each dimension. Nonuniform spacing functions may be
215 used in each direction.
216
217 @param[in] cf Optional coarsening factor. If scalar, the factor is used
218 for all dimensions. If an array, factors can be specified
219 for each dimension.
220 @param[in] tol NURBS geometry deviation tolerance, cf. Algorithm A5.8 of
221 "The NURBS Book", 2nd ed, Piegl and Tiller. */
222 void Coarsen(int cf = 2, real_t tol = 1.0e-12);
223 void Coarsen(Array<int> const& cf, real_t tol = 1.0e-12);
224
225 /// Calls KnotVector::GetCoarseningFactor for each direction.
226 void GetCoarseningFactors(Array<int> & f) const;
227
228 /// Marks the KnotVector in each dimension as coarse.
229 void SetKnotVectorsCoarse(bool c);
230
231 // Return the number of components stored in the NURBSPatch
232 int GetNC() const { return Dim; }
233 int GetNKV() const { return kv.Size(); }
234 /// @note The returned object should NOT be deleted by the caller.
235 KnotVector *GetKV(int i) { return kv[i]; }
236
237 // Standard B-NET access functions
238 inline real_t &operator()(int i, int j);
239 inline const real_t &operator()(int i, int j) const;
240
241 inline real_t &operator()(int i, int j, int l);
242 inline const real_t &operator()(int i, int j, int l) const;
243
244 inline real_t &operator()(int i, int j, int k, int l);
245 inline const real_t &operator()(int i, int j, int k, int l) const;
246
247 static void Get2DRotationMatrix(real_t angle,
248 DenseMatrix &T);
249 static void Get3DRotationMatrix(real_t n[], real_t angle, real_t r,
250 DenseMatrix &T);
251 void FlipDirection(int dir);
252 void SwapDirections(int dir1, int dir2);
253
254 /// Rotate the NURBSPatch.
255 /** A rotation of a 2D NURBS-patch requires an angle only. Rotating
256 a 3D NURBS-patch requires a normal as well.*/
257 void Rotate(real_t angle, real_t normal[]= NULL);
258 void Rotate2D(real_t angle);
259 void Rotate3D(real_t normal[], real_t angle);
260
261 int MakeUniformDegree(int degree = -1);
262 /// @note The returned object should be deleted by the caller.
264 /// @note The returned object should be deleted by the caller.
265 friend NURBSPatch *Revolve3D(NURBSPatch &patch, real_t n[], real_t ang,
266 int times);
267};
268
269
270#ifdef MFEM_USE_MPI
271class ParNURBSExtension;
272#endif
273
274class NURBSPatchMap;
275
276
278{
279#ifdef MFEM_USE_MPI
280 friend class ParNURBSExtension;
281#endif
282 friend class NURBSPatchMap;
283
284protected:
285 int mOrder; // see GetOrder() for description
288 // global entity counts
290 // local entity counts
293
294 Array<int> activeVert; // activeVert[glob_vert] = loc_vert or -1
297 Array<int> activeDof; // activeDof[glob_dof] = loc_dof + 1 or 0
298
302 /** Set of knotvectors containing unique KnotVectors only */
304 /** Comprehensive set of knotvectors. This set contains a KnotVector for
305 every edge.*/
308
309 // periodic BC info:
310 // - dof 2 dof map
311 // - master and slave boundary indices
315
316 // global offsets, meshOffsets == meshVertexOffsets
321
322 // global offsets, spaceOffsets == dofOffsets
327
329
332 Array2D<int> el_to_IJK; // IJK are "knot-span" indices!
333 Array2D<int> bel_to_IJK; // they are NOT element indices!
334
335 std::vector<Array<int>> patch_to_el;
336 std::vector<Array<int>> patch_to_bel;
337
339
340 inline int KnotInd(int edge) const;
341 /// @note The returned object should NOT be deleted by the caller.
342 inline KnotVector *KnotVec(int edge);
343 inline const KnotVector *KnotVec(int edge) const;
344 inline const KnotVector *KnotVec(int edge, int oedge, int *okv) const;
345
346 void CheckPatches();
347 void CheckBdrPatches();
348
349 /** Checks the direction of the knotvectors in the patch based on
350 the patch orientation for patch @a p returns the direction of
351 the Knotvectors in @a kvdir.*/
352 void CheckKVDirection(int p, Array <int> &kvdir);
353 /** Creates the comprehensive set of KnotVectors. They are the same for 1D. */
355 /** Updates the unique set of KnotVectors */
356 void UpdateUniqueKV();
357
358 /** Checks if the comprehensive array of KnotVectors agrees with
359 the reduced set of KnotVectors. Returns false if it finds
360 a difference. */
361 bool ConsistentKVSets();
362
365
366 void SetOrderFromOrders();
368
369 // periodic BC helper functions
370 void InitDofMap();
371 void ConnectBoundaries();
372 void ConnectBoundaries1D(int bnd0, int bnd1);
373 void ConnectBoundaries2D(int bnd0, int bnd1);
374 void ConnectBoundaries3D(int bnd0, int bnd1);
375
376 // also count the global NumOfVertices and the global NumOfDofs
377 void GenerateOffsets();
378 // count the global NumOfElements
379 void CountElements();
380 // count the global NumOfBdrElements
381 void CountBdrElements();
382
383 // generate the mesh elements
384 void Get1DElementTopo(Array<Element *> &elements) const;
385 void Get2DElementTopo(Array<Element *> &elements) const;
386 void Get3DElementTopo(Array<Element *> &elements) const;
387
388 // generate the boundary mesh elements
389 void Get1DBdrElementTopo(Array<Element *> &boundary) const;
390 void Get2DBdrElementTopo(Array<Element *> &boundary) const;
391 void Get3DBdrElementTopo(Array<Element *> &boundary) const;
392
393 // FE space generation functions
394
395 // based on activeElem, count NumOfActiveDofs, generate el_dof,
396 // el_to_patch, el_to_IJK, activeDof map (global-to-local)
398
399 // generate elem_to_global-dof table for the active elements
400 // define el_to_patch, el_to_IJK, activeDof (as bool)
404
405 // call after GenerateElementDofTable
407
408 // generate the bdr-elem_to_global-dof table for the active bdr. elements
409 // define bel_to_patch, bel_to_IJK
413
414 // FE --> Patch translation functions
415 void GetPatchNets (const Vector &Nodes, int vdim);
416 void Get1DPatchNets(const Vector &Nodes, int vdim);
417 void Get2DPatchNets(const Vector &Nodes, int vdim);
418 void Get3DPatchNets(const Vector &Nodes, int vdim);
419
420 // Patch --> FE translation functions
421 // Side effects: delete the patches, update the weights from the patches
422 void SetSolutionVector (Vector &Nodes, int vdim);
423 void Set1DSolutionVector(Vector &Nodes, int vdim);
424 void Set2DSolutionVector(Vector &Nodes, int vdim);
425 void Set3DSolutionVector(Vector &Nodes, int vdim);
426
427 // determine activeVert, NumOfActiveVertices from the activeElem array
429
430 // determine activeBdrElem, NumOfActiveBdrElems
432
433 void MergeWeights(Mesh *mesh_array[], int num_pieces);
434
435 void SetPatchToElements();
437
438 // to be used by ParNURBSExtension constructor(s)
440
441public:
442 /// Copy constructor: deep copy
443 NURBSExtension(const NURBSExtension &orig);
444 /// Read-in a NURBSExtension
445 NURBSExtension(std::istream &input, bool spacing=false);
446 /** @brief Create a NURBSExtension with elevated order by repeating the
447 endpoints of the knot vectors and using uniform weights of 1. */
448 /** If a knot vector in @a parent already has order greater than or equal to
449 @a newOrder, it will be used unmodified. */
450 NURBSExtension(NURBSExtension *parent, int newOrder);
451 /** @brief Create a NURBSExtension with elevated knot vector orders (by
452 repeating the endpoints of the knot vectors and using uniform weights of
453 1) as given by the array @a newOrders. */
454 /** If a knot vector in @a parent already has order greater than or equal to
455 the corresponding entry in @a newOrder, it will be used unmodified. */
456 NURBSExtension(NURBSExtension *parent, const Array<int> &newOrders);
457 /// Construct a NURBSExtension by merging a partitioned NURBS mesh
458 NURBSExtension(Mesh *mesh_array[], int num_pieces);
459
460 /// Copy assignment not supported
462
463 // Generate connections between boundaries, such as periodic BCs
465 const Array<int> &GetMaster() const { return master; };
467 const Array<int> &GetSlave() const { return slave; };
468 Array<int> &GetSlave() { return slave; };
469 void MergeGridFunctions(GridFunction *gf_array[], int num_pieces,
470 GridFunction &merged);
471
472 /// Destroy a NURBSExtension
473 virtual ~NURBSExtension();
474
475 // Print functions
476 void Print(std::ostream &os, const std::string &comments = "") const;
477 void PrintCharacteristics(std::ostream &os) const;
478 void PrintFunctions(const char *filename, int samples=11) const;
479
480 // Meta data functions
481 int Dimension() const { return patchTopo->Dimension(); }
482 int GetNP() const { return patchTopo->GetNE(); }
483 int GetNBP() const { return patchTopo->GetNBE(); }
484
485 /// Read-only access to the orders of all knot vectors.
486 const Array<int> &GetOrders() const { return mOrders; }
487 /** @brief If all orders are identical, return that number. Otherwise, return
488 NURBSFECollection::VariableOrder. */
489 int GetOrder() const { return mOrder; }
490
491 int GetNKV() const { return NumOfKnotVectors; }
492
493 int GetGNV() const { return NumOfVertices; }
494 int GetNV() const { return NumOfActiveVertices; }
495 int GetGNE() const { return NumOfElements; }
496 int GetNE() const { return NumOfActiveElems; }
497 int GetGNBE() const { return NumOfBdrElements; }
498 int GetNBE() const { return NumOfActiveBdrElems; }
499
500 int GetNTotalDof() const { return NumOfDofs; }
501 int GetNDof() const { return NumOfActiveDofs; }
502
503 /// Returns the local dof number
504 int GetActiveDof(int glob) const { return activeDof[glob]; };
505
506 /// Returns the dof index whilst accounting for periodic boundaries
507 int DofMap(int dof) const
508 {
509 return (d_to_d.Size() > 0 )? d_to_d[dof] : dof;
510 };
511
512 /// Returns knotvectors in each dimension for patch @a p.
514
516
517 // Knotvector read-only access function
518 const KnotVector *GetKnotVector(int i) const { return knotVectors[i]; }
519
520 // Mesh generation functions
521 void GetElementTopo (Array<Element *> &elements) const;
522 void GetBdrElementTopo(Array<Element *> &boundary) const;
523
524 bool HavePatches() const { return (patches.Size() != 0); }
525
526 /// @note The returned object should NOT be deleted by the caller.
528 /// @note The returned object should NOT be deleted by the caller.
530
531 void GetVertexLocalToGlobal(Array<int> &lvert_vert);
532 void GetElementLocalToGlobal(Array<int> &lelem_elem);
533
534 // Set the attribute for patch @a i, which is set to all elements in the
535 // patch.
536 void SetPatchAttribute(int i, int attr) { patchTopo->SetAttribute(i, attr); }
537
538 // Get the attribute for patch @a i, which is set to all elements in the
539 // patch.
540 int GetPatchAttribute(int i) const { return patchTopo->GetAttribute(i); }
541
542 // Set the attribute for patch boundary element @a i, which is set to all
543 // boundary elements in the patch.
544 void SetPatchBdrAttribute(int i, int attr)
545 { patchTopo->SetBdrAttribute(i, attr); }
546 // Get the attribute for patch boundary element @a i, which is set to all
547 // boundary elements in the patch.
548 int GetPatchBdrAttribute(int i) const
549 { return patchTopo->GetBdrAttribute(i); }
550
551 // Load functions
552 void LoadFE(int i, const FiniteElement *FE) const;
553 void LoadBE(int i, const FiniteElement *BE) const;
554
555 const Vector &GetWeights() const { return weights; }
556 Vector &GetWeights() { return weights; }
557
558 // Translation functions: from FE coordinates to IJK patch
559 // format and vice versa
560 void ConvertToPatches(const Vector &Nodes);
561 void SetKnotsFromPatches();
562 void SetCoordsFromPatches(Vector &Nodes);
563
564 // Read a GridFunction written patch-by-patch, e.g. with PrintSolution().
565 void LoadSolution(std::istream &input, GridFunction &sol) const;
566 // Write a GridFunction patch-by-patch.
567 void PrintSolution(const GridFunction &sol, std::ostream &os) const;
568
569 // Refinement methods
570 // new_degree = max(old_degree, min(old_degree + rel_degree, degree))
571 void DegreeElevate(int rel_degree, int degree = 16);
572
573 /** @brief Refine with optional refinement factor @a rf. Uniform means
574 refinement is done everywhere by the same factor, although nonuniform
575 spacing functions may be used.
576 */
577 void UniformRefinement(int rf = 2);
578 void UniformRefinement(Array<int> const& rf);
579 void Coarsen(int cf = 2, real_t tol = 1.0e-12);
580 void Coarsen(Array<int> const& cf, real_t tol = 1.0e-12);
582 void KnotInsert(Array<Vector *> &kv);
583
584 void KnotRemove(Array<Vector *> &kv, real_t tol = 1.0e-12);
585
586 /** Calls GetCoarseningFactors for each patch and finds the minimum factor
587 for each direction that ensures refinement will work in the case of
588 non-nested spacing functions. */
589 void GetCoarseningFactors(Array<int> & f) const;
590
591 /// Returns the index of the patch containing element @a elem.
592 int GetElementPatch(int elem) const { return el_to_patch[elem]; }
593
594 /** Returns the Cartesian indices (i,j) in 2D or (i,j,k) in 3D of element
595 @a elem, in the knot-span tensor product ordering for its patch. */
596 void GetElementIJK(int elem, Array<int> & ijk);
597
598 // Returns the degrees of freedom on the patch, in Cartesian order.
599 void GetPatchDofs(const int patch, Array<int> &dofs);
600
601 const Array<int>& GetPatchElements(int patch);
602 const Array<int>& GetPatchBdrElements(int patch);
603};
604
605
606#ifdef MFEM_USE_MPI
608{
609private:
610 int *partitioning;
611
612 Table *GetGlobalElementDofTable();
613 Table *Get1DGlobalElementDofTable();
614 Table *Get2DGlobalElementDofTable();
615 Table *Get3DGlobalElementDofTable();
616
617 void SetActive(const int *partitioning, const Array<bool> &active_bel);
618 void BuildGroups(const int *partitioning, const Table &elem_dof);
619
620public:
622
624
626
627 ParNURBSExtension(MPI_Comm comm, NURBSExtension *parent, int *partitioning,
628 const Array<bool> &active_bel);
629
630 // Create a parallel version of 'parent' with partitioning as in
631 // 'par_parent'; the 'parent' object is destroyed.
632 // The 'parent' can be either a local NURBSExtension or a global one.
634 const ParNURBSExtension *par_parent);
635
636 virtual ~ParNURBSExtension() { delete [] partitioning; }
637};
638#endif
639
640
642{
643private:
644 const NURBSExtension *Ext;
645
646 int I, J, K, pOffset, opatch;
647 Array<int> verts, edges, faces, oedge, oface;
648
649 inline static int F(const int n, const int N)
650 { return (n < 0) ? 0 : ((n >= N) ? 2 : 1); }
651
652 inline static int Or1D(const int n, const int N, const int Or)
653 { return (Or > 0) ? n : (N - 1 - n); }
654
655 inline static int Or2D(const int n1, const int n2,
656 const int N1, const int N2, const int Or);
657
658 // also set verts, edges, faces, orientations etc
659 void GetPatchKnotVectors (int p, const KnotVector *kv[]);
660 void GetBdrPatchKnotVectors(int p, const KnotVector *kv[], int *okv);
661
662public:
663 NURBSPatchMap(const NURBSExtension *ext) { Ext = ext; }
664
665 int nx() { return I + 1; }
666 int ny() { return J + 1; }
667 int nz() { return K + 1; }
668
669 void SetPatchVertexMap(int p, const KnotVector *kv[]);
670 void SetPatchDofMap (int p, const KnotVector *kv[]);
671
672 void SetBdrPatchVertexMap(int p, const KnotVector *kv[], int *okv);
673 void SetBdrPatchDofMap (int p, const KnotVector *kv[], int *okv);
674
675 inline int operator()(const int i) const;
676 inline int operator[](const int i) const { return (*this)(i); }
677
678 inline int operator()(const int i, const int j) const;
679
680 inline int operator()(const int i, const int j, const int k) const;
681};
682
683
684// Inline function implementations
685
686inline real_t &NURBSPatch::slice(int i, int j)
687{
688#ifdef MFEM_DEBUG
689 if (data == 0 || i < 0 || i >= nd || j < 0 || j > ls)
690 {
691 mfem_error("NURBSPatch::slice()");
692 }
693#endif
694 return data[j%sd + sd*(i + (j/sd)*nd)];
695}
696
697inline const real_t &NURBSPatch::slice(int i, int j) const
698{
699#ifdef MFEM_DEBUG
700 if (data == 0 || i < 0 || i >= nd || j < 0 || j > ls)
701 {
702 mfem_error("NURBSPatch::slice()");
703 }
704#endif
705 return data[j%sd + sd*(i + (j/sd)*nd)];
706}
707
708
709inline real_t &NURBSPatch::operator()(int i, int l)
710{
711#ifdef MFEM_DEBUG
712 if (data == 0 || i < 0 || i >= ni || nj > 0 || nk > 0 ||
713 l < 0 || l >= Dim)
714 {
715 mfem_error("NURBSPatch::operator() 1D");
716 }
717#endif
718
719 return data[i*Dim+l];
720}
721
722inline const real_t &NURBSPatch::operator()(int i, int l) const
723{
724#ifdef MFEM_DEBUG
725 if (data == 0 || i < 0 || i >= ni || nj > 0 || nk > 0 ||
726 l < 0 || l >= Dim)
727 {
728 mfem_error("NURBSPatch::operator() const 1D");
729 }
730#endif
731
732 return data[i*Dim+l];
733}
734
735inline real_t &NURBSPatch::operator()(int i, int j, int l)
736{
737#ifdef MFEM_DEBUG
738 if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || nk > 0 ||
739 l < 0 || l >= Dim)
740 {
741 mfem_error("NURBSPatch::operator() 2D");
742 }
743#endif
744
745 return data[(i+j*ni)*Dim+l];
746}
747
748inline const real_t &NURBSPatch::operator()(int i, int j, int l) const
749{
750#ifdef MFEM_DEBUG
751 if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || nk > 0 ||
752 l < 0 || l >= Dim)
753 {
754 mfem_error("NURBSPatch::operator() const 2D");
755 }
756#endif
757
758 return data[(i+j*ni)*Dim+l];
759}
760
761inline real_t &NURBSPatch::operator()(int i, int j, int k, int l)
762{
763#ifdef MFEM_DEBUG
764 if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
765 k >= nk || l < 0 || l >= Dim)
766 {
767 mfem_error("NURBSPatch::operator() 3D");
768 }
769#endif
770
771 return data[(i+(j+k*nj)*ni)*Dim+l];
772}
773
774inline const real_t &NURBSPatch::operator()(int i, int j, int k, int l) const
775{
776#ifdef MFEM_DEBUG
777 if (data == 0 || i < 0 || i >= ni || j < 0 || j >= nj || k < 0 ||
778 k >= nk || l < 0 || l >= Dim)
779 {
780 mfem_error("NURBSPatch::operator() const 3D");
781 }
782#endif
783
784 return data[(i+(j+k*nj)*ni)*Dim+l];
785}
786
787
788inline int NURBSExtension::KnotInd(int edge) const
789{
790 int kv = edge_to_knot[edge];
791 return (kv >= 0) ? kv : (-1-kv);
792}
793
795{
796 return knotVectors[KnotInd(edge)];
797}
798
799inline const KnotVector *NURBSExtension::KnotVec(int edge) const
800{
801 return knotVectors[KnotInd(edge)];
802}
803
804inline const KnotVector *NURBSExtension::KnotVec(int edge, int oedge, int *okv)
805const
806{
807 int kv = edge_to_knot[edge];
808 if (kv >= 0)
809 {
810 *okv = oedge;
811 return knotVectors[kv];
812 }
813 else
814 {
815 *okv = -oedge;
816 return knotVectors[-1-kv];
817 }
818}
819
820
821// static method
822inline int NURBSPatchMap::Or2D(const int n1, const int n2,
823 const int N1, const int N2, const int Or)
824{
825 // Needs testing
826 switch (Or)
827 {
828 case 0: return n1 + n2*N1;
829 case 1: return n2 + n1*N2;
830 case 2: return n2 + (N1 - 1 - n1)*N2;
831 case 3: return (N1 - 1 - n1) + n2*N1;
832 case 4: return (N1 - 1 - n1) + (N2 - 1 - n2)*N1;
833 case 5: return (N2 - 1 - n2) + (N1 - 1 - n1)*N2;
834 case 6: return (N2 - 1 - n2) + n1*N2;
835 case 7: return n1 + (N2 - 1 - n2)*N1;
836 }
837#ifdef MFEM_DEBUG
838 mfem_error("NURBSPatchMap::Or2D");
839#endif
840 return -1;
841}
842
843inline int NURBSPatchMap::operator()(const int i) const
844{
845 const int i1 = i - 1;
846 switch (F(i1, I))
847 {
848 case 0: return verts[0];
849 case 1: return pOffset + Or1D(i1, I, opatch);
850 case 2: return verts[1];
851 }
852#ifdef MFEM_DEBUG
853 mfem_error("NURBSPatchMap::operator() const 1D");
854#endif
855 return -1;
856}
857
858inline int NURBSPatchMap::operator()(const int i, const int j) const
859{
860 const int i1 = i - 1, j1 = j - 1;
861 switch (3*F(j1, J) + F(i1, I))
862 {
863 case 0: return verts[0];
864 case 1: return edges[0] + Or1D(i1, I, oedge[0]);
865 case 2: return verts[1];
866 case 3: return edges[3] + Or1D(j1, J, -oedge[3]);
867 case 4: return pOffset + Or2D(i1, j1, I, J, opatch);
868 case 5: return edges[1] + Or1D(j1, J, oedge[1]);
869 case 6: return verts[3];
870 case 7: return edges[2] + Or1D(i1, I, -oedge[2]);
871 case 8: return verts[2];
872 }
873#ifdef MFEM_DEBUG
874 mfem_error("NURBSPatchMap::operator() const 2D");
875#endif
876 return -1;
877}
878
879inline int NURBSPatchMap::operator()(const int i, const int j, const int k)
880const
881{
882 // Needs testing
883 const int i1 = i - 1, j1 = j - 1, k1 = k - 1;
884 switch (3*(3*F(k1, K) + F(j1, J)) + F(i1, I))
885 {
886 case 0: return verts[0];
887 case 1: return edges[0] + Or1D(i1, I, oedge[0]);
888 case 2: return verts[1];
889 case 3: return edges[3] + Or1D(j1, J, oedge[3]);
890 case 4: return faces[0] + Or2D(i1, J - 1 - j1, I, J, oface[0]);
891 case 5: return edges[1] + Or1D(j1, J, oedge[1]);
892 case 6: return verts[3];
893 case 7: return edges[2] + Or1D(i1, I, oedge[2]);
894 case 8: return verts[2];
895 case 9: return edges[8] + Or1D(k1, K, oedge[8]);
896 case 10: return faces[1] + Or2D(i1, k1, I, K, oface[1]);
897 case 11: return edges[9] + Or1D(k1, K, oedge[9]);
898 case 12: return faces[4] + Or2D(J - 1 - j1, k1, J, K, oface[4]);
899 case 13: return pOffset + I*(J*k1 + j1) + i1;
900 case 14: return faces[2] + Or2D(j1, k1, J, K, oface[2]);
901 case 15: return edges[11] + Or1D(k1, K, oedge[11]);
902 case 16: return faces[3] + Or2D(I - 1 - i1, k1, I, K, oface[3]);
903 case 17: return edges[10] + Or1D(k1, K, oedge[10]);
904 case 18: return verts[4];
905 case 19: return edges[4] + Or1D(i1, I, oedge[4]);
906 case 20: return verts[5];
907 case 21: return edges[7] + Or1D(j1, J, oedge[7]);
908 case 22: return faces[5] + Or2D(i1, j1, I, J, oface[5]);
909 case 23: return edges[5] + Or1D(j1, J, oedge[5]);
910 case 24: return verts[7];
911 case 25: return edges[6] + Or1D(i1, I, oedge[6]);
912 case 26: return verts[6];
913 }
914#ifdef MFEM_DEBUG
915 mfem_error("NURBSPatchMap::operator() const 3D");
916#endif
917 return -1;
918}
919
920}
921
922#endif
Dynamic 2D array using row-major layout.
Definition array.hpp:372
int Size() const
Return the logical size of the array.
Definition array.hpp:144
Data type dense matrix using column-major storage.
Definition densemat.hpp:24
Abstract class for all finite elements.
Definition fe_base.hpp:239
Class for grid function - Vector with associated FE space.
Definition gridfunc.hpp:31
~KnotVector()
Destroys KnotVector.
Definition nurbs.hpp:115
std::shared_ptr< SpacingFunction > spacing
Function to define the distribution of knots for any number of knot spans.
Definition nurbs.hpp:121
void FindMaxima(Array< int > &ks, Vector &xi, Vector &u) const
Definition nurbs.cpp:482
int findKnotSpan(real_t u) const
Definition nurbs.cpp:576
void PrintFunctions(std::ostream &os, int samples=11) const
Definition nurbs.cpp:260
void CalcDnShape(Vector &gradn, int n, int i, real_t xi) const
Definition nurbs.cpp:381
KnotVector & operator=(const KnotVector &kv)
Definition nurbs.cpp:48
void UniformRefinement(Vector &newknots, int rf) const
Refine uniformly with refinement factor rf.
Definition nurbs.cpp:92
bool isElement(int i) const
Definition nurbs.hpp:59
void CalcShape(Vector &shape, int i, real_t xi) const
Definition nurbs.cpp:297
void FindInterpolant(Array< Vector * > &x)
Definition nurbs.cpp:543
const real_t & operator[](int i) const
Definition nurbs.hpp:118
real_t getKnotLocation(real_t xi, int ni) const
Definition nurbs.hpp:61
int GetNKS() const
Definition nurbs.hpp:51
void GetElements()
Count the number of elements.
Definition nurbs.cpp:229
KnotVector * DegreeElevate(int t) const
Definition nurbs.cpp:63
void Refinement(Vector &newknots, int rf) const
Refine with refinement factor rf.
Definition nurbs.cpp:169
KnotVector()
Create KnotVector.
Definition nurbs.hpp:43
static const int MaxOrder
Definition nurbs.hpp:36
void CalcD2Shape(Vector &grad2, int i, real_t xi) const
Definition nurbs.hpp:69
int GetOrder() const
Definition nurbs.hpp:53
int GetNCP() const
Definition nurbs.hpp:52
int NumOfControlPoints
Definition nurbs.hpp:39
void CalcDShape(Vector &grad, int i, real_t xi) const
Definition nurbs.cpp:324
int Size() const
Definition nurbs.hpp:54
void Difference(const KnotVector &kv, Vector &diff) const
Finds the knots in the larger of this and kv, not contained in the other.
Definition nurbs.cpp:605
int GetCoarseningFactor() const
Definition nurbs.cpp:113
Vector GetFineKnots(const int cf) const
Definition nurbs.cpp:132
real_t & operator[](int i)
Definition nurbs.hpp:117
int GetNE() const
Definition nurbs.hpp:50
KnotVector(const KnotVector &kv)
Definition nurbs.hpp:46
void Print(std::ostream &os) const
Definition nurbs.cpp:254
Mesh data type.
Definition mesh.hpp:56
int GetAttribute(int i) const
Return the attribute of element i.
Definition mesh.hpp:1333
int GetBdrAttribute(int i) const
Return the attribute of boundary element i.
Definition mesh.hpp:1339
void SetAttribute(int i, int attr)
Set the attribute of element i.
Definition mesh.hpp:1336
int GetNE() const
Returns number of elements.
Definition mesh.hpp:1226
int Dimension() const
Dimension of the reference space used within the elements.
Definition mesh.hpp:1160
int GetNBE() const
Returns number of boundary elements.
Definition mesh.hpp:1229
void SetBdrAttribute(int i, int attr)
Set the attribute of boundary element i.
Definition mesh.hpp:1342
int GetNP() const
Definition nurbs.hpp:482
int GetNBE() const
Definition nurbs.hpp:498
void GetCoarseningFactors(Array< int > &f) const
Definition nurbs.cpp:4277
void Generate3DElementDofTable()
Definition nurbs.cpp:3754
void SetPatchAttribute(int i, int attr)
Definition nurbs.hpp:536
Array< NURBSPatch * > patches
Definition nurbs.hpp:338
Vector & GetWeights()
Definition nurbs.hpp:556
const Array< int > & GetPatchElements(int patch)
Definition nurbs.cpp:4704
void Set2DSolutionVector(Vector &Nodes, int vdim)
Definition nurbs.cpp:4617
std::vector< Array< int > > patch_to_bel
Definition nurbs.hpp:336
void UniformRefinement(int rf=2)
Refine with optional refinement factor rf. Uniform means refinement is done everywhere by the same fa...
Definition nurbs.cpp:4248
Array< int > p_meshOffsets
Definition nurbs.hpp:320
int GetGNE() const
Definition nurbs.hpp:495
Array< int > mOrders
Definition nurbs.hpp:286
void Print(std::ostream &os, const std::string &comments="") const
Definition nurbs.cpp:2354
void SetSolutionVector(Vector &Nodes, int vdim)
Definition nurbs.cpp:4574
void SetPatchBdrAttribute(int i, int attr)
Definition nurbs.hpp:544
void PrintSolution(const GridFunction &sol, std::ostream &os) const
Definition nurbs.cpp:4186
friend class ParNURBSExtension
Definition nurbs.hpp:280
int DofMap(int dof) const
Returns the dof index whilst accounting for periodic boundaries.
Definition nurbs.hpp:507
void PrintFunctions(const char *filename, int samples=11) const
Definition nurbs.cpp:2439
void Set3DSolutionVector(Vector &Nodes, int vdim)
Definition nurbs.cpp:4645
Array< bool > activeBdrElem
Definition nurbs.hpp:296
int GetNBP() const
Definition nurbs.hpp:483
void SetCoordsFromPatches(Vector &Nodes)
Definition nurbs.cpp:4100
void SetOrderFromOrders()
Definition nurbs.cpp:3224
void GetElementIJK(int elem, Array< int > &ijk)
Definition nurbs.cpp:4676
void MergeGridFunctions(GridFunction *gf_array[], int num_pieces, GridFunction &merged)
Definition nurbs.cpp:2783
const Vector & GetWeights() const
Definition nurbs.hpp:555
void GenerateActiveVertices()
Definition nurbs.cpp:2663
Array< int > el_to_patch
Definition nurbs.hpp:330
void Coarsen(int cf=2, real_t tol=1.0e-12)
Definition nurbs.cpp:4270
int GetPatchAttribute(int i) const
Definition nurbs.hpp:540
Array< int > activeDof
Definition nurbs.hpp:297
const Array< int > & GetSlave() const
Definition nurbs.hpp:467
Array< int > slave
Definition nurbs.hpp:314
void Get2DBdrElementTopo(Array< Element * > &boundary) const
Definition nurbs.cpp:3552
void GetElementTopo(Array< Element * > &elements) const
Definition nurbs.cpp:3382
const Array< int > & GetPatchBdrElements(int patch)
Definition nurbs.cpp:4711
void Get1DElementTopo(Array< Element * > &elements) const
Definition nurbs.cpp:3400
int KnotInd(int edge) const
Definition nurbs.hpp:788
int GetNKV() const
Definition nurbs.hpp:491
void GetVertexLocalToGlobal(Array< int > &lvert_vert)
Definition nurbs.cpp:4025
void LoadBE(int i, const FiniteElement *BE) const
Definition nurbs.cpp:4066
void Get2DElementTopo(Array< Element * > &elements) const
Definition nurbs.cpp:3430
Table * GetElementDofTable()
Definition nurbs.hpp:527
void GenerateElementDofTable()
Definition nurbs.cpp:3621
void Generate3DBdrElementDofTable()
Definition nurbs.cpp:3967
int GetGNV() const
Definition nurbs.hpp:493
void Get3DPatchNets(const Vector &Nodes, int vdim)
Definition nurbs.cpp:4544
KnotVector * KnotVec(int edge)
Definition nurbs.hpp:794
bool HavePatches() const
Definition nurbs.hpp:524
std::vector< Array< int > > patch_to_el
Definition nurbs.hpp:335
void Get2DPatchNets(const Vector &Nodes, int vdim)
Definition nurbs.cpp:4517
Array< int > v_meshOffsets
Definition nurbs.hpp:317
void GetPatchNets(const Vector &Nodes, int vdim)
Definition nurbs.cpp:4476
NURBSExtension & operator=(const NURBSExtension &)=delete
Copy assignment not supported.
void CheckKVDirection(int p, Array< int > &kvdir)
Definition nurbs.cpp:2873
void GetBdrElementTopo(Array< Element * > &boundary) const
Definition nurbs.cpp:3511
void SetOrdersFromKnotVectors()
Definition nurbs.cpp:3238
Array< KnotVector * > knotVectorsCompr
Definition nurbs.hpp:306
Array2D< int > el_to_IJK
Definition nurbs.hpp:332
void GenerateBdrElementDofTable()
Definition nurbs.cpp:3869
Array< int > & GetMaster()
Definition nurbs.hpp:466
Array< int > f_spaceOffsets
Definition nurbs.hpp:325
void MergeWeights(Mesh *mesh_array[], int num_pieces)
Definition nurbs.cpp:2758
void Generate2DBdrElementDofTable()
Definition nurbs.cpp:3924
Array< int > master
Definition nurbs.hpp:313
void Set1DSolutionVector(Vector &Nodes, int vdim)
Definition nurbs.cpp:4590
void ConnectBoundaries2D(int bnd0, int bnd1)
Definition nurbs.cpp:2546
Array2D< int > bel_to_IJK
Definition nurbs.hpp:333
int GetNTotalDof() const
Definition nurbs.hpp:500
void SetPatchToElements()
Definition nurbs.cpp:4682
int GetElementPatch(int elem) const
Returns the index of the patch containing element elem.
Definition nurbs.hpp:592
Array< int > & GetSlave()
Definition nurbs.hpp:468
void ConnectBoundaries3D(int bnd0, int bnd1)
Definition nurbs.cpp:2592
Array< int > edge_to_knot
Definition nurbs.hpp:301
const Array< int > & GetMaster() const
Definition nurbs.hpp:465
void KnotRemove(Array< Vector * > &kv, real_t tol=1.0e-12)
Definition nurbs.cpp:4416
void LoadFE(int i, const FiniteElement *FE) const
Definition nurbs.cpp:4045
void GetElementLocalToGlobal(Array< int > &lelem_elem)
Definition nurbs.cpp:4035
void GenerateActiveBdrElems()
Definition nurbs.cpp:2736
Array< bool > activeElem
Definition nurbs.hpp:295
Array< int > d_to_d
Definition nurbs.hpp:312
void CreateComprehensiveKV()
Definition nurbs.cpp:2941
void GetPatchDofs(const int patch, Array< int > &dofs)
Definition nurbs.cpp:3820
Array< int > bel_to_patch
Definition nurbs.hpp:331
void GetPatchKnotVectors(int p, Array< KnotVector * > &kv)
Definition nurbs.cpp:3136
Table * GetBdrElementDofTable()
Definition nurbs.hpp:529
void Generate2DElementDofTable()
Definition nurbs.cpp:3700
void PrintCharacteristics(std::ostream &os) const
Definition nurbs.cpp:2409
int GetNDof() const
Definition nurbs.hpp:501
void KnotInsert(Array< KnotVector * > &kv)
Definition nurbs.cpp:4304
int GetOrder() const
If all orders are identical, return that number. Otherwise, return NURBSFECollection::VariableOrder.
Definition nurbs.hpp:489
Array< int > e_meshOffsets
Definition nurbs.hpp:318
void GetBdrPatchKnotVectors(int p, Array< KnotVector * > &kv)
Definition nurbs.cpp:3183
const Array< int > & GetOrders() const
Read-only access to the orders of all knot vectors.
Definition nurbs.hpp:486
int GetActiveDof(int glob) const
Returns the local dof number.
Definition nurbs.hpp:504
int GetGNBE() const
Definition nurbs.hpp:497
Array< int > activeVert
Definition nurbs.hpp:294
void ConnectBoundaries1D(int bnd0, int bnd1)
Definition nurbs.cpp:2532
void Get1DPatchNets(const Vector &Nodes, int vdim)
Definition nurbs.cpp:4492
int GetNV() const
Definition nurbs.hpp:494
void ConvertToPatches(const Vector &Nodes)
Definition nurbs.cpp:4089
void Generate1DBdrElementDofTable()
Definition nurbs.cpp:3894
int Dimension() const
Definition nurbs.hpp:481
Array< int > f_meshOffsets
Definition nurbs.hpp:319
void Get3DBdrElementTopo(Array< Element * > &boundary) const
Definition nurbs.cpp:3583
void SetKnotsFromPatches()
Definition nurbs.cpp:4108
Array< KnotVector * > knotVectors
Definition nurbs.hpp:303
Array< int > p_spaceOffsets
Definition nurbs.hpp:326
void Generate1DElementDofTable()
Definition nurbs.cpp:3657
void SetPatchToBdrElements()
Definition nurbs.cpp:4693
Array< int > v_spaceOffsets
Definition nurbs.hpp:323
int GetNE() const
Definition nurbs.hpp:496
int GetPatchBdrAttribute(int i) const
Definition nurbs.hpp:548
void DegreeElevate(int rel_degree, int degree=16)
Definition nurbs.cpp:4224
const KnotVector * GetKnotVector(int i) const
Definition nurbs.hpp:518
void LoadSolution(std::istream &input, GridFunction &sol) const
Definition nurbs.cpp:4149
void Get1DBdrElementTopo(Array< Element * > &boundary) const
Definition nurbs.cpp:3529
virtual ~NURBSExtension()
Destroy a NURBSExtension.
Definition nurbs.cpp:2325
Array< int > e_spaceOffsets
Definition nurbs.hpp:324
void Get3DElementTopo(Array< Element * > &elements) const
Definition nurbs.cpp:3466
void SetBdrPatchDofMap(int p, const KnotVector *kv[], int *okv)
Definition nurbs.cpp:5265
NURBSPatchMap(const NURBSExtension *ext)
Definition nurbs.hpp:663
void SetPatchDofMap(int p, const KnotVector *kv[])
Definition nurbs.cpp:5201
void SetBdrPatchVertexMap(int p, const KnotVector *kv[], int *okv)
Definition nurbs.cpp:5232
int operator[](const int i) const
Definition nurbs.hpp:676
void SetPatchVertexMap(int p, const KnotVector *kv[])
Definition nurbs.cpp:5169
int operator()(const int i) const
Definition nurbs.hpp:843
void UniformRefinement(int rf=2)
Refine with optional refinement factor rf. Uniform means refinement is done everywhere by the same fa...
Definition nurbs.cpp:948
int MakeUniformDegree(int degree=-1)
Definition nurbs.cpp:1779
int GetNKV() const
Definition nurbs.hpp:233
friend NURBSPatch * Revolve3D(NURBSPatch &patch, real_t n[], real_t ang, int times)
Definition nurbs.cpp:1849
void GetCoarseningFactors(Array< int > &f) const
Calls KnotVector::GetCoarseningFactor for each direction.
Definition nurbs.cpp:984
void Coarsen(int cf=2, real_t tol=1.0e-12)
Coarsen with optional coarsening factor cf which divides the number of elements in each dimension....
Definition nurbs.cpp:977
int KnotRemove(int dir, real_t knot, int ntimes=1, real_t tol=1.0e-12)
Remove knot with value knot from direction dir.
Definition nurbs.cpp:1161
void Rotate2D(real_t angle)
Definition nurbs.cpp:1688
NURBSPatch & operator=(const NURBSPatch &)=delete
void Rotate3D(real_t normal[], real_t angle)
Definition nurbs.cpp:1753
void KnotInsert(int dir, const KnotVector &knot)
Insert knots from knot determined by Difference, in direction dir.
Definition nurbs.cpp:1001
real_t & slice(int i, int j)
Definition nurbs.hpp:686
static void Get3DRotationMatrix(real_t n[], real_t angle, real_t r, DenseMatrix &T)
Definition nurbs.cpp:1714
void SwapDirections(int dir1, int dir2)
Definition nurbs.cpp:1634
real_t & operator()(int i, int j)
Definition nurbs.hpp:709
void init(int dim_)
Definition nurbs.cpp:640
static void Get2DRotationMatrix(real_t angle, DenseMatrix &T)
Definition nurbs.cpp:1676
KnotVector * GetKV(int i)
Definition nurbs.hpp:235
int SetLoopDirection(int dir)
Definition nurbs.cpp:860
int GetNC() const
Definition nurbs.hpp:232
void Print(std::ostream &os) const
Definition nurbs.cpp:836
friend NURBSPatch * Interpolate(NURBSPatch &p1, NURBSPatch &p2)
Definition nurbs.cpp:1802
Array< KnotVector * > kv
Definition nurbs.hpp:136
void FlipDirection(int dir)
Definition nurbs.cpp:1622
void swap(NURBSPatch *np)
Definition nurbs.cpp:797
NURBSPatch(NURBSPatch *parent, int dir, int Order, int NCP)
Definition nurbs.cpp:782
void SetKnotVectorsCoarse(bool c)
Marks the KnotVector in each dimension as coarse.
Definition nurbs.cpp:1909
void Rotate(real_t angle, real_t normal[]=NULL)
Rotate the NURBSPatch.
Definition nurbs.cpp:1659
void DegreeElevate(int dir, int t)
Definition nurbs.cpp:1368
real_t * data
Definition nurbs.hpp:133
virtual ~ParNURBSExtension()
Definition nurbs.hpp:636
GroupTopology gtopo
Definition nurbs.hpp:621
Array< int > ldof_group
Definition nurbs.hpp:623
Vector data type.
Definition vector.hpp:80
int Size() const
Returns the size of the vector.
Definition vector.hpp:218
real_t u(const Vector &xvec)
Definition lor_mms.hpp:22
void mfem_error(const char *msg)
Definition error.cpp:154
float real_t
Definition config.hpp:43
std::function< real_t(const Vector &)> f(real_t mass_coeff)
Definition lor_mms.hpp:30
real_t p(const Vector &x, real_t t)
RefCoord t[3]