MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::ParNURBSExtension Class Reference

Parallel version of NURBSExtension. More...

#include <nurbs.hpp>

Inheritance diagram for mfem::ParNURBSExtension:
[legend]
Collaboration diagram for mfem::ParNURBSExtension:
[legend]

Public Member Functions

 ParNURBSExtension (const ParNURBSExtension &orig)
 Copy constructor.
 
 ParNURBSExtension (MPI_Comm comm, NURBSExtension *parent, const int *partitioning_, const Array< bool > &active_bel)
 Constructor for an MPI communicator comm, a global NURBSExtension parent, a partitioning partitioning_ of the global elements by MPI rank, and a marker active_bel of active global boundary elements on this rank. The partitioning is deep-copied and will not be deleted by this object.
 
 ParNURBSExtension (NURBSExtension *parent, const ParNURBSExtension *par_parent)
 Create a parallel version of parent with partitioning as in par_parent; the parent object is destroyed. The parent can be either a local NURBSExtension or a global one.
 
- Public Member Functions inherited from mfem::NURBSExtension
 NURBSExtension (const NURBSExtension &orig)
 Copy constructor: deep copy.
 
 NURBSExtension (std::istream &input, bool spacing=false)
 Read-in a NURBSExtension from a stream input..
 
 NURBSExtension (NURBSExtension *parent, int newOrder)
 Create a NURBSExtension with elevated order by repeating the endpoints of the KnotVectors and using uniform weights of 1.
 
 NURBSExtension (NURBSExtension *parent, const Array< int > &newOrders, Mode mode=Mode::H_1)
 Create a NURBSExtension with elevated KnotVector orders (by repeating the endpoints of the KnotVectors and using uniform weights of 1) as given by the array newOrders.
 
 NURBSExtension (Mesh *mesh_array[], int num_pieces)
 Construct a NURBSExtension by merging a partitioned NURBS mesh.
 
 NURBSExtension (const Mesh *patch_topology, const Array< const NURBSPatch * > p)
 
NURBSExtensionoperator= (const NURBSExtension &)=delete
 Copy assignment not supported.
 
void ConnectBoundaries (Array< int > &master, Array< int > &slave)
 Generate connections between boundaries, such as periodic BCs.
 
const Array< int > & GetMaster () const
 
Array< int > & GetMaster ()
 
const Array< int > & GetSlave () const
 
Array< int > & GetSlave ()
 
void MergeGridFunctions (GridFunction *gf_array[], int num_pieces, GridFunction &merged)
 Set the DOFs of merged to values from active elements in num_pieces of Gridfunctions gf_array.
 
virtual ~NURBSExtension ()
 Destroy a NURBSExtension.
 
void Print (std::ostream &os, const std::string &comments="") const
 Writes all patch data to the stream os.
 
void PrintCharacteristics (std::ostream &os) const
 Print various mesh characteristics to the stream os.
 
void PrintFunctions (const char *basename, int samples=11) const
 Call KnotVector::PrintFunctions for all KnotVectors, using a separate, newly created ofstream with filename "basename_i.dat" for KnotVector i.
 
int Dimension () const
 Return the dimension of the reference space (not physical space).
 
int GetNP () const
 Return the number of patches.
 
int GetNBP () const
 Return the number of boundary patches.
 
const Array< int > & GetOrders () const
 Read-only access to the orders of all KnotVectors.
 
int GetOrder () const
 If all KnotVector orders are identical, return that number. Otherwise, return NURBSFECollection::VariableOrder.
 
int GetNKV () const
 Return the number of KnotVectors.
 
int GetGNV () const
 Return the global number of vertices.
 
int GetNV () const
 Return the local number of active vertices.
 
int GetGNE () const
 Return the global number of elements.
 
int GetNE () const
 Return the number of active elements.
 
int GetGNBE () const
 Return the global number of boundary elements.
 
int GetNBE () const
 Return the number of active boundary elements.
 
int GetNTotalDof () const
 Return the total number of DOFs.
 
int GetNDof () const
 Return the number of active DOFs.
 
int GetActiveDof (int glob) const
 Return the local DOF number for a given global DOF number glob.
 
int DofMap (int dof) const
 Return the dof index whilst accounting for periodic boundaries.
 
void GetPatchKnotVectors (int p, Array< const KnotVector * > &kv) const
 Return KnotVectors in kv in each dimension for patch p.
 
void GetBdrPatchKnotVectors (int bp, Array< const KnotVector * > &kv) const
 Return KnotVectors in kv in each dimension for boundary patch bp.
 
const KnotVectorGetKnotVector (int i) const
 KnotVector read-only access function.
 
void GetElementTopo (Array< Element * > &elements) const
 Generate the active mesh elements and return them in elements.
 
void GetBdrElementTopo (Array< Element * > &boundary) const
 Generate the active mesh boundary elements and return them in boundary.
 
bool HavePatches () const
 Return true if at least 1 patch is defined, false otherwise.
 
TableGetElementDofTable ()
 
TableGetBdrElementDofTable ()
 
void GetVertexLocalToGlobal (Array< int > &lvert_vert)
 Get the local to global vertex index map lvert_vert.
 
void GetElementLocalToGlobal (Array< int > &lelem_elem)
 Get the local to global element index map lelem_elem.
 
void SetPatchAttribute (int i, int attr)
 Set the attribute for patch i, which is set to all elements in the patch.
 
int GetPatchAttribute (int i) const
 Get the attribute for patch i, which is set to all elements in the patch.
 
void SetPatchBdrAttribute (int i, int attr)
 Set the attribute for patch boundary element i to attr, which is set to all boundary elements in the patch.
 
int GetPatchBdrAttribute (int i) const
 Get the attribute for boundary patch element i, which is set to all boundary elements in the patch.
 
void LoadFE (int i, const FiniteElement *FE) const
 Load element i into FE.
 
void LoadBE (int i, const FiniteElement *BE) const
 Load boundary element i into BE.
 
const VectorGetWeights () const
 Access function to the vector of weights weights.
 
VectorGetWeights ()
 
void ConvertToPatches (const Vector &Nodes)
 Define patches in IKJ (B-net) format, using FE coordinates in Nodes.
 
void SetKnotsFromPatches ()
 Set KnotVectors from patches and construct mesh and space data.
 
void SetCoordsFromPatches (Vector &Nodes)
 Set FE coordinates in Nodes, using data from patches, and erase patches.
 
void LoadSolution (std::istream &input, GridFunction &sol) const
 Read a GridFunction sol from stream input, written patch-by-patch, e.g. with PrintSolution().
 
void PrintSolution (const GridFunction &sol, std::ostream &os) const
 Write a GridFunction sol patch-by-patch to stream os.
 
void DegreeElevate (int rel_degree, int degree=16)
 Call DegreeElevate for all KnotVectors of all patches. For each KnotVector, the new degree is max(old_degree, min(old_degree + rel_degree, degree)).
 
void UniformRefinement (int rf=2)
 Refine with optional refinement factor rf. Uniform means refinement is done everywhere by the same factor, although nonuniform spacing functions may be used.
 
void UniformRefinement (Array< int > const &rf)
 
void Coarsen (int cf=2, real_t tol=1.0e-12)
 
void Coarsen (Array< int > const &cf, real_t tol=1.0e-12)
 
void KnotInsert (Array< KnotVector * > &kv)
 Insert knots from kv into all KnotVectors in all patches. The size of kv should be the same as knotVectors.
 
void KnotInsert (Array< Vector * > &kv)
 
NURBSExtensionGetDivExtension (int component)
 
NURBSExtensionGetCurlExtension (int component)
 
void KnotRemove (Array< Vector * > &kv, real_t tol=1.0e-12)
 
void GetCoarseningFactors (Array< int > &f) const
 
int GetElementPatch (int elem) const
 Returns the index of the patch containing element elem.
 
void GetElementIJK (int elem, Array< int > &ijk)
 Return Cartesian indices (i,j) in 2D or (i,j,k) in 3D of element elem, in the knot-span tensor product ordering for its patch.
 
void GetPatchDofs (const int patch, Array< int > &dofs)
 Return the degrees of freedom in dofs on patch patch, in Cartesian order.
 
const Array< int > & GetPatchElements (int patch)
 Return the array of indices of all elements in patch patch.
 
const Array< int > & GetPatchBdrElements (int patch)
 Return the array of indices of all boundary elements in patch patch.
 

Public Attributes

GroupTopology gtopo
 
Array< int > ldof_group
 

Additional Inherited Members

- Protected Types inherited from mfem::NURBSExtension
enum class  Mode { H_1 , H_DIV , H_CURL }
 Flag for indicating what type of NURBS fespace this extension is used for. More...
 
- Protected Member Functions inherited from mfem::NURBSExtension
int KnotInd (int edge) const
 Return the unsigned index of the KnotVector for edge edge.
 
KnotVectorKnotVec (int edge)
 
const KnotVectorKnotVec (int edge) const
 
const KnotVectorKnotVec (int edge, int oedge, int *okv) const
 
void CheckPatches ()
 Throw an error if any patch has an inconsistent edge-to-knot mapping.
 
void CheckBdrPatches ()
 Throw an error if any boundary patch has invalid KnotVector orientation.
 
void CheckKVDirection (int p, Array< int > &kvdir)
 Return the directions in kvdir of the KnotVectors in patch p based on the patch edge orientations. Each entry of kvdir is -1 if the KnotVector direction is flipped, +1 otherwise.
 
void CreateComprehensiveKV ()
 Create the comprehensive set of KnotVectors. In 1D, this set is identical to the unique set of KnotVectors.
 
void UpdateUniqueKV ()
 
bool ConsistentKVSets ()
 Check if the comprehensive array of KnotVectors agrees with the unique set of KnotVectors, on each patch. Return false if there is a difference, true otherwise. This function throws an error in 1D.
 
void GetPatchKnotVectors (int p, Array< KnotVector * > &kv)
 Return KnotVectors in kv in each dimension for patch p.
 
void GetBdrPatchKnotVectors (int bp, Array< KnotVector * > &kv)
 Return KnotVectors in kv in each dimension for boundary patch bp.
 
void SetOrderFromOrders ()
 Set overall order mOrder based on KnotVector orders.
 
void SetOrdersFromKnotVectors ()
 Set orders from KnotVector orders.
 
void InitDofMap ()
 Set DOF map sizes to 0.
 
void ConnectBoundaries ()
 Set DOF maps for periodic BC.
 
void ConnectBoundaries1D (int bnd0, int bnd1)
 
void ConnectBoundaries2D (int bnd0, int bnd1)
 
void ConnectBoundaries3D (int bnd0, int bnd1)
 
void GenerateOffsets ()
 Set the mesh and space offsets, and also count the global NumOfVertices and the global NumOfDofs.
 
void CountElements ()
 Count the global NumOfElements.
 
void CountBdrElements ()
 Count the global NumOfBdrElements.
 
void Get1DElementTopo (Array< Element * > &elements) const
 Generate the active mesh elements and return them in elements.
 
void Get2DElementTopo (Array< Element * > &elements) const
 
void Get3DElementTopo (Array< Element * > &elements) const
 
void Get1DBdrElementTopo (Array< Element * > &boundary) const
 Generate the active mesh boundary elements and return them in boundary.
 
void Get2DBdrElementTopo (Array< Element * > &boundary) const
 
void Get3DBdrElementTopo (Array< Element * > &boundary) const
 
void GenerateElementDofTable ()
 Based on activeElem, count NumOfActiveDofs and generate el_dof, el_to_patch, el_to_IJK, activeDof map (global-to-local).
 
void Generate1DElementDofTable ()
 Generate elem_to_global-dof table for the active elements, and define el_to_patch, el_to_IJK, activeDof (as bool).
 
void Generate2DElementDofTable ()
 
void Generate3DElementDofTable ()
 
void GenerateBdrElementDofTable ()
 Call after GenerateElementDofTable to set boundary element DOF table.
 
void Generate1DBdrElementDofTable ()
 Generate the table of global DOFs for active boundary elements, and define bel_to_patch, bel_to_IJK.
 
void Generate2DBdrElementDofTable ()
 
void Generate3DBdrElementDofTable ()
 
void GetPatchNets (const Vector &coords, int vdim)
 Set the B-NET on each patch using values from coords.
 
void Get1DPatchNets (const Vector &coords, int vdim)
 
void Get2DPatchNets (const Vector &coords, int vdim)
 
void Get3DPatchNets (const Vector &coords, int vdim)
 
void SetSolutionVector (Vector &coords, int vdim)
 Return in coords the coordinates from each patch. Side effects: delete the patches and update the weights from the patches.
 
void Set1DSolutionVector (Vector &coords, int vdim)
 
void Set2DSolutionVector (Vector &coords, int vdim)
 
void Set3DSolutionVector (Vector &coords, int vdim)
 
void GenerateActiveVertices ()
 Determine activeVert, NumOfActiveVertices from the activeElem array.
 
void GenerateActiveBdrElems ()
 Determine activeBdrElem, NumOfActiveBdrElems.
 
void MergeWeights (Mesh *mesh_array[], int num_pieces)
 Set the weights in this object to values from active elements in num_pieces meshes in mesh_array.
 
void SetPatchToElements ()
 Set patch_to_el.
 
void SetPatchToBdrElements ()
 Set patch_to_bel.
 
 NURBSExtension ()
 To be used by ParNURBSExtension constructor(s)
 
- Protected Attributes inherited from mfem::NURBSExtension
Mode mode = Mode::H_1
 
int mOrder
 Order of KnotVectors, see GetOrder() for description.
 
Array< int > mOrders
 Orders of all KnotVectors.
 
int NumOfKnotVectors
 Number of KnotVectors.
 
int NumOfVertices
 Global entity counts.
 
int NumOfElements
 
int NumOfBdrElements
 
int NumOfDofs
 
int NumOfActiveVertices
 Local entity counts.
 
int NumOfActiveElems
 
int NumOfActiveBdrElems
 
int NumOfActiveDofs
 
Array< int > activeVert
 
Array< bool > activeElem
 
Array< bool > activeBdrElem
 
Array< int > activeDof
 
MeshpatchTopo
 Patch topology mesh.
 
bool own_topo
 Whether this object owns patchTopo.
 
Array< int > edge_to_knot
 Map from edge indices to KnotVector indices.
 
Array< KnotVector * > knotVectors
 Set of unique KnotVectors.
 
Array< KnotVector * > knotVectorsCompr
 Comprehensive set of all KnotVectors, one for every edge.
 
Vector weights
 Weights for each control point or DOF.
 
Array< int > d_to_d
 Periodic BC info:
 
Array< int > master
 
Array< int > slave
 
Array< int > v_meshOffsets
 Global mesh offsets, meshOffsets == meshVertexOffsets.
 
Array< int > e_meshOffsets
 
Array< int > f_meshOffsets
 
Array< int > p_meshOffsets
 
Array< int > v_spaceOffsets
 Global space offsets, spaceOffsets == dofOffsets.
 
Array< int > e_spaceOffsets
 
Array< int > f_spaceOffsets
 
Array< int > p_spaceOffsets
 
Tableel_dof
 Table of DOFs for each element (el_dof) or boundary element (bel_dof).
 
Tablebel_dof
 
Array< int > el_to_patch
 Map from element indices to patch indices.
 
Array< int > bel_to_patch
 Map from boundary element indices to patch indices.
 
Array2D< int > el_to_IJK
 Map from element indices to IJK knot span indices.
 
Array2D< int > bel_to_IJK
 
std::vector< Array< int > > patch_to_el
 For each patch p, patch_to_el[p] lists all elements in the patch.
 
std::vector< Array< int > > patch_to_bel
 For each patch p, patch_to_bel[p] lists all boundary elements in the patch.
 
Array< NURBSPatch * > patches
 Array of all patches in the mesh.
 

Detailed Description

Parallel version of NURBSExtension.

Definition at line 923 of file nurbs.hpp.

Constructor & Destructor Documentation

◆ ParNURBSExtension() [1/3]

mfem::ParNURBSExtension::ParNURBSExtension ( const ParNURBSExtension & orig)

Copy constructor.

Definition at line 4954 of file nurbs.cpp.

◆ ParNURBSExtension() [2/3]

mfem::ParNURBSExtension::ParNURBSExtension ( MPI_Comm comm,
NURBSExtension * parent,
const int * partitioning_,
const Array< bool > & active_bel )

Constructor for an MPI communicator comm, a global NURBSExtension parent, a partitioning partitioning_ of the global elements by MPI rank, and a marker active_bel of active global boundary elements on this rank. The partitioning is deep-copied and will not be deleted by this object.

Definition at line 4962 of file nurbs.cpp.

◆ ParNURBSExtension() [3/3]

mfem::ParNURBSExtension::ParNURBSExtension ( NURBSExtension * parent,
const ParNURBSExtension * par_parent )

Create a parallel version of parent with partitioning as in par_parent; the parent object is destroyed. The parent can be either a local NURBSExtension or a global one.

Definition at line 5036 of file nurbs.cpp.

Member Data Documentation

◆ gtopo

GroupTopology mfem::ParNURBSExtension::gtopo

Definition at line 943 of file nurbs.hpp.

◆ ldof_group

Array<int> mfem::ParNURBSExtension::ldof_group

Definition at line 945 of file nurbs.hpp.


The documentation for this class was generated from the following files: