Nektar++
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Nektar::MultiRegions::AssemblyMap Class Reference

Base class for constructing local to global mapping of degrees of freedom. More...

#include <AssemblyMap.h>

Inheritance diagram for Nektar::MultiRegions::AssemblyMap:
[legend]

Public Member Functions

 AssemblyMap ()
 Default constructor. More...
 
 AssemblyMap (const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &comm, const std::string variable="DefaultVar")
 Constructor with a communicator. More...
 
 AssemblyMap (AssemblyMap *oldLevelMap, const BottomUpSubStructuredGraphSharedPtr &multiLevelGraph)
 Constructor for next level in multi-level static condensation. More...
 
virtual ~AssemblyMap ()
 Destructor. More...
 
LibUtilities::CommSharedPtr GetComm ()
 Retrieves the communicator. More...
 
std::string GetVariable ()
 Retrieves the variable string. More...
 
size_t GetHash () const
 Retrieves the hash of this map. More...
 
int GetLocalToGlobalMap (const int i) const
 
int GetGlobalToUniversalMap (const int i) const
 
int GetGlobalToUniversalMapUnique (const int i) const
 
const Array< OneD, const int > & GetLocalToGlobalMap ()
 
const Array< OneD, const int > & GetGlobalToUniversalMap ()
 
const Array< OneD, const int > & GetGlobalToUniversalMapUnique ()
 
NekDouble GetLocalToGlobalSign (const int i) const
 
const Array< OneD, NekDouble > & GetLocalToGlobalSign () const
 
void LocalToGlobal (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm=true) const
 
void LocalToGlobal (const NekVector< NekDouble > &loc, NekVector< NekDouble > &global, bool useComm=true) const
 
void GlobalToLocal (const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
 
void GlobalToLocal (const NekVector< NekDouble > &global, NekVector< NekDouble > &loc) const
 
void Assemble (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
 
void Assemble (const NekVector< NekDouble > &loc, NekVector< NekDouble > &global) const
 
void UniversalAssemble (Array< OneD, NekDouble > &pGlobal) const
 
void UniversalAssemble (NekVector< NekDouble > &pGlobal) const
 
void UniversalAssemble (Array< OneD, NekDouble > &pGlobal, int offset) const
 
void UniversalAbsMaxBnd (Array< OneD, NekDouble > &bndvals)
 
int GetLocalToGlobalBndMap (const int i) const
 Retrieve the global index of a given local boundary mode. More...
 
const Array< OneD, const int > & GetLocalToGlobalBndMap ()
 Retrieve the global indices of the local boundary modes. More...
 
const Array< OneD, const int > & GetGlobalToUniversalBndMap ()
 
const Array< OneD, const int > & GetGlobalToUniversalBndMapUnique ()
 
bool GetSignChange ()
 Returns true if using a modal expansion requiring a change of sign of some modes. More...
 
NekDouble GetLocalToGlobalBndSign (const int i) const
 Retrieve the sign change of a given local boundary mode. More...
 
Array< OneD, const NekDoubleGetLocalToGlobalBndSign () const
 Retrieve the sign change for all local boundary modes. More...
 
const Array< OneD, const int > & GetBndCondCoeffsToLocalCoeffsMap ()
 Retrieves the local indices corresponding to the boundary expansion modes. More...
 
const Array< OneD, NekDouble > & GetBndCondCoeffsToLocalCoeffsSign ()
 Returns the modal sign associated with a given boundary expansion mode. More...
 
const Array< OneD, const int > & GetBndCondCoeffsToLocalTraceMap ()
 Retrieves the local indices corresponding to the boundary expansion modes to global trace. More...
 
int GetBndCondIDToGlobalTraceID (const int i)
 Returns the global index of the boundary trace giving the index on the boundary expansion. More...
 
const Array< OneD, const int > & GetBndCondIDToGlobalTraceID ()
 
int GetNumGlobalDirBndCoeffs () const
 Returns the number of global Dirichlet boundary coefficients. More...
 
int GetNumLocalDirBndCoeffs () const
 Returns the number of local Dirichlet boundary coefficients. More...
 
int GetNumGlobalBndCoeffs () const
 Returns the total number of global boundary coefficients. More...
 
int GetNumLocalBndCoeffs () const
 Returns the total number of local boundary coefficients. More...
 
int GetNumLocalCoeffs () const
 Returns the total number of local coefficients. More...
 
int GetNumGlobalCoeffs () const
 Returns the total number of global coefficients. More...
 
bool GetSingularSystem () const
 Retrieves if the system is singular (true) or not (false) More...
 
void GlobalToLocalBnd (const NekVector< NekDouble > &global, NekVector< NekDouble > &loc, int offset) const
 
void GlobalToLocalBnd (const NekVector< NekDouble > &global, NekVector< NekDouble > &loc) const
 
void GlobalToLocalBnd (const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc, int offset) const
 
void GlobalToLocalBnd (const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
 
void LocalBndToGlobal (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, int offset, bool UseComm=true) const
 
void LocalBndToGlobal (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool UseComm=true) const
 
void LocalToLocalBnd (const Array< OneD, const NekDouble > &local, Array< OneD, NekDouble > &locbnd) const
 
void LocalToLocalInt (const Array< OneD, const NekDouble > &local, Array< OneD, NekDouble > &locint) const
 
void LocalBndToLocal (const Array< OneD, const NekDouble > &locbnd, Array< OneD, NekDouble > &local) const
 
void LocalIntToLocal (const Array< OneD, const NekDouble > &locbnd, Array< OneD, NekDouble > &local) const
 
void AssembleBnd (const NekVector< NekDouble > &loc, NekVector< NekDouble > &global, int offset) const
 
void AssembleBnd (const NekVector< NekDouble > &loc, NekVector< NekDouble > &global) const
 
void AssembleBnd (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, int offset) const
 
void AssembleBnd (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
 
void UniversalAssembleBnd (Array< OneD, NekDouble > &pGlobal) const
 
void UniversalAssembleBnd (NekVector< NekDouble > &pGlobal) const
 
void UniversalAssembleBnd (Array< OneD, NekDouble > &pGlobal, int offset) const
 
int GetFullSystemBandWidth () const
 
int GetNumNonDirVertexModes () const
 
int GetNumNonDirEdgeModes () const
 
int GetNumNonDirFaceModes () const
 
int GetNumDirEdges () const
 
int GetNumDirFaces () const
 
int GetNumNonDirEdges () const
 
int GetNumNonDirFaces () const
 
void PrintStats (std::ostream &out, std::string variable, bool printHeader=true) const
 
const Array< OneD, const int > & GetExtraDirEdges ()
 
std::shared_ptr< AssemblyMapLinearSpaceMap (const ExpList &locexp, GlobalSysSolnType solnType)
 
int GetBndSystemBandWidth () const
 Returns the bandwidth of the boundary system. More...
 
int GetStaticCondLevel () const
 Returns the level of static condensation for this map. More...
 
int GetNumPatches () const
 Returns the number of patches in this static condensation level. More...
 
const Array< OneD, const unsigned int > & GetNumLocalBndCoeffsPerPatch ()
 Returns the number of local boundary coefficients in each patch. More...
 
const Array< OneD, const unsigned int > & GetNumLocalIntCoeffsPerPatch ()
 Returns the number of local interior coefficients in each patch. More...
 
const AssemblyMapSharedPtr GetNextLevelLocalToGlobalMap () const
 Returns the local to global mapping for the next level in the multi-level static condensation. More...
 
void SetNextLevelLocalToGlobalMap (AssemblyMapSharedPtr pNextLevelLocalToGlobalMap)
 
const PatchMapSharedPtrGetPatchMapFromPrevLevel (void) const
 Returns the patch map from the previous level of the multi-level static condensation. More...
 
bool AtLastLevel () const
 Returns true if this is the last level in the multi-level static condensation. More...
 
GlobalSysSolnType GetGlobalSysSolnType () const
 Returns the method of solving global systems. More...
 
std::string GetPreconType () const
 
bool IsAbsoluteTolerance () const
 
int GetSuccessiveRHS () const
 
std::string GetLinSysIterSolver () const
 
int GetLowestStaticCondLevel () const
 
void PatchLocalToGlobal (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
 
void PatchGlobalToLocal (const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
 
void PatchAssemble (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
 

Protected Member Functions

void CalculateBndSystemBandWidth ()
 Calculates the bandwidth of the boundary system. More...
 
void GlobalToLocalBndWithoutSign (const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc)
 
virtual int v_GetLocalToGlobalMap (const int i) const
 
virtual int v_GetGlobalToUniversalMap (const int i) const
 
virtual int v_GetGlobalToUniversalMapUnique (const int i) const
 
virtual const Array< OneD, const int > & v_GetLocalToGlobalMap ()
 
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMap ()
 
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMapUnique ()
 
virtual NekDouble v_GetLocalToGlobalSign (const int i) const
 
virtual const Array< OneD, NekDouble > & v_GetLocalToGlobalSign () const
 
virtual void v_LocalToGlobal (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm) const
 
virtual void v_LocalToGlobal (const NekVector< NekDouble > &loc, NekVector< NekDouble > &global, bool useComm) const
 
virtual void v_GlobalToLocal (const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const
 
virtual void v_GlobalToLocal (const NekVector< NekDouble > &global, NekVector< NekDouble > &loc) const
 
virtual void v_Assemble (const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const
 
virtual void v_Assemble (const NekVector< NekDouble > &loc, NekVector< NekDouble > &global) const
 
virtual void v_UniversalAssemble (Array< OneD, NekDouble > &pGlobal) const
 
virtual void v_UniversalAssemble (NekVector< NekDouble > &pGlobal) const
 
virtual void v_UniversalAssemble (Array< OneD, NekDouble > &pGlobal, int offset) const
 
virtual int v_GetFullSystemBandWidth () const
 
virtual int v_GetNumNonDirVertexModes () const
 
virtual int v_GetNumNonDirEdgeModes () const
 
virtual int v_GetNumNonDirFaceModes () const
 
virtual int v_GetNumDirEdges () const
 
virtual int v_GetNumDirFaces () const
 
virtual int v_GetNumNonDirEdges () const
 
virtual int v_GetNumNonDirFaces () const
 
virtual const Array< OneD, const int > & v_GetExtraDirEdges ()
 
virtual std::shared_ptr< AssemblyMapv_LinearSpaceMap (const ExpList &locexp, GlobalSysSolnType solnType)
 Generate a linear space mapping from existing mapping. More...
 

Protected Attributes

LibUtilities::SessionReaderSharedPtr m_session
 Session object. More...
 
LibUtilities::CommSharedPtr m_comm
 Communicator. More...
 
std::string m_variable
 Variable string identifier. More...
 
size_t m_hash
 Hash for map. More...
 
int m_numLocalBndCoeffs
 Number of local boundary coefficients. More...
 
int m_numGlobalBndCoeffs
 Total number of global boundary coefficients. More...
 
int m_numLocalDirBndCoeffs
 Number of Local Dirichlet Boundary Coefficients. More...
 
int m_numGlobalDirBndCoeffs
 Number of Global Dirichlet Boundary Coefficients. More...
 
bool m_systemSingular
 Flag indicating if the system is singular or not. More...
 
int m_numLocalCoeffs
 Total number of local coefficients. More...
 
int m_numGlobalCoeffs
 Total number of global coefficients. More...
 
bool m_signChange
 Flag indicating if modes require sign reversal. More...
 
Array< OneD, int > m_localToGlobalBndMap
 Integer map of local coeffs to global Boundary Dofs. More...
 
Array< OneD, NekDoublem_localToGlobalBndSign
 Integer sign of local boundary coeffs to global space. More...
 
Array< OneD, int > m_localToLocalBndMap
 Integer map of local boundary coeffs to local boundary system numbering. More...
 
Array< OneD, int > m_localToLocalIntMap
 Integer map of local boundary coeffs to local interior system numbering. More...
 
Array< OneD, int > m_bndCondCoeffsToLocalCoeffsMap
 Integer map of bnd cond coeffs to local coefficients. More...
 
Array< OneD, NekDoublem_bndCondCoeffsToLocalCoeffsSign
 Integer map of sign of bnd cond coeffs to local coefficients. More...
 
Array< OneD, int > m_bndCondCoeffsToLocalTraceMap
 Integer map of bnd cond coeff to local trace coeff. More...
 
Array< OneD, int > m_bndCondIDToGlobalTraceID
 Integer map of bnd cond trace number to global trace number. More...
 
Array< OneD, int > m_globalToUniversalBndMap
 Integer map of process coeffs to universal space. More...
 
Array< OneD, int > m_globalToUniversalBndMapUnique
 Integer map of unique process coeffs to universal space (signed) More...
 
GlobalSysSolnType m_solnType
 The solution type of the global system. More...
 
int m_bndSystemBandWidth
 The bandwith of the global bnd system. More...
 
std::string m_preconType
 Type type of preconditioner to use in iterative solver. More...
 
NekDouble m_iterativeTolerance
 Tolerance for iterative solver. More...
 
bool m_isAbsoluteTolerance
 
int m_successiveRHS
 sucessive RHS for iterative solver More...
 
std::string m_linSysIterSolver
 Iterative solver: Conjugate Gradient, GMRES. More...
 
Gs::gs_datam_gsh
 
Gs::gs_datam_bndGsh
 
Gs::gs_datam_dirBndGsh
 gs gather communication to impose Dirhichlet BCs. More...
 
int m_staticCondLevel
 The level of recursion in the case of multi-level static condensation. More...
 
int m_numPatches
 The number of patches (~elements) in the current level. More...
 
Array< OneD, unsigned int > m_numLocalBndCoeffsPerPatch
 The number of bnd dofs per patch. More...
 
Array< OneD, unsigned int > m_numLocalIntCoeffsPerPatch
 The number of int dofs per patch. More...
 
AssemblyMapSharedPtr m_nextLevelLocalToGlobalMap
 Map from the patches of the previous level to the patches of the current level. More...
 
int m_lowestStaticCondLevel
 Lowest static condensation level. More...
 

Private Attributes

PatchMapSharedPtr m_patchMapFromPrevLevel
 Mapping information for previous level in MultiLevel Solver. More...
 

Detailed Description

Base class for constructing local to global mapping of degrees of freedom.

This class acts as a base class for constructing mappings between local, global and boundary degrees of freedom. It holds the storage for the maps and provides the accessors needed to retrieve them.

There are two derived classes: AssemblyMapCG and AssemblyMapDG. These perform the actual construction of the maps within their specific contexts.

Definition at line 55 of file AssemblyMap.h.

Constructor & Destructor Documentation

◆ AssemblyMap() [1/3]

Nektar::MultiRegions::AssemblyMap::AssemblyMap ( )

Default constructor.

Initialises an empty mapping.

Definition at line 79 of file AssemblyMap.cpp.

84 m_linSysIterSolver("ConjugateGradient"), m_gsh(nullptr), m_bndGsh(nullptr)
85{
86}
GlobalSysSolnType m_solnType
The solution type of the global system.
Definition: AssemblyMap.h:399
std::string m_linSysIterSolver
Iterative solver: Conjugate Gradient, GMRES.
Definition: AssemblyMap.h:414
int m_successiveRHS
sucessive RHS for iterative solver
Definition: AssemblyMap.h:411
LibUtilities::SessionReaderSharedPtr m_session
Session object.
Definition: AssemblyMap.h:330
int m_numLocalBndCoeffs
Number of local boundary coefficients.
Definition: AssemblyMap.h:342
int m_bndSystemBandWidth
The bandwith of the global bnd system.
Definition: AssemblyMap.h:401
int m_numLocalDirBndCoeffs
Number of Local Dirichlet Boundary Coefficients.
Definition: AssemblyMap.h:346
int m_numGlobalDirBndCoeffs
Number of Global Dirichlet Boundary Coefficients.
Definition: AssemblyMap.h:348
LibUtilities::CommSharedPtr m_comm
Communicator.
Definition: AssemblyMap.h:333
int m_numGlobalBndCoeffs
Total number of global boundary coefficients.
Definition: AssemblyMap.h:344
@ eNoSolnType
No Solution type specified.

◆ AssemblyMap() [2/3]

Nektar::MultiRegions::AssemblyMap::AssemblyMap ( const LibUtilities::SessionReaderSharedPtr pSession,
const LibUtilities::CommSharedPtr comm,
const std::string  variable = "DefaultVar" 
)

Constructor with a communicator.

Definition at line 88 of file AssemblyMap.cpp.

91 : m_session(pSession), m_comm(comm), m_variable(variable), m_hash(0),
95 m_linSysIterSolver("ConjugateGradient"), m_gsh(nullptr), m_bndGsh(nullptr)
96{
97 // Default value from Solver Info
99 pSession->GetSolverInfoAsEnum<GlobalSysSolnType>("GlobalSysSoln");
100
101 // Override values with data from GlobalSysSolnInfo section
102 if (pSession->DefinesGlobalSysSolnInfo(variable, "GlobalSysSoln"))
103 {
104 std::string sysSoln =
105 pSession->GetGlobalSysSolnInfo(variable, "GlobalSysSoln");
106 m_solnType = pSession->GetValueAsEnum<GlobalSysSolnType>(
107 "GlobalSysSoln", sysSoln);
108 }
109
110 // Set up preconditioner with SysSoln as override then solverinfo otherwise
111 // set a default as diagonal
112 if (pSession->DefinesGlobalSysSolnInfo(variable, "Preconditioner"))
113 {
115 pSession->GetGlobalSysSolnInfo(variable, "Preconditioner");
116 }
117 else if (pSession->DefinesSolverInfo("Preconditioner"))
118 {
119 m_preconType = pSession->GetSolverInfo("Preconditioner");
120 }
121 else
122 { // Possibly preconditioner is default registered in
123 // GlobLinSysIterative.cpp
124 m_preconType = "Diagonal";
125 }
126
127 if (pSession->DefinesGlobalSysSolnInfo(variable, "AbsoluteTolerance"))
128 {
129 std::string abstol =
130 pSession->GetGlobalSysSolnInfo(variable, "AbsoluteTolerance");
132 boost::iequals(boost::to_upper_copy(abstol), "TRUE");
133 }
134 else
135 {
136 m_isAbsoluteTolerance = false;
137 }
138
139 if (pSession->DefinesGlobalSysSolnInfo(variable, "SuccessiveRHS"))
140 {
141 m_successiveRHS = boost::lexical_cast<int>(
142 pSession->GetGlobalSysSolnInfo(variable, "SuccessiveRHS").c_str());
143 }
144 else
145 {
146 pSession->LoadParameter("SuccessiveRHS", m_successiveRHS, 0);
147 }
148
149 if (pSession->DefinesGlobalSysSolnInfo(variable, "LinSysIterSolver"))
150 {
152 pSession->GetGlobalSysSolnInfo(variable, "LinSysIterSolver");
153 }
154 else if (pSession->DefinesSolverInfo("LinSysIterSolver"))
155 {
156 m_linSysIterSolver = pSession->GetSolverInfo("LinSysIterSolver");
157 }
158 else
159 {
160 m_linSysIterSolver = "ConjugateGradient";
161 }
162}
std::string m_variable
Variable string identifier.
Definition: AssemblyMap.h:336
std::string m_preconType
Type type of preconditioner to use in iterative solver.
Definition: AssemblyMap.h:404

References m_isAbsoluteTolerance, m_linSysIterSolver, m_preconType, m_solnType, and m_successiveRHS.

◆ AssemblyMap() [3/3]

Nektar::MultiRegions::AssemblyMap::AssemblyMap ( AssemblyMap oldLevelMap,
const BottomUpSubStructuredGraphSharedPtr multiLevelGraph 
)

Constructor for next level in multi-level static condensation.

Create a new level of mapping using the information in multiLevelGraph and performing the following steps:

  • STEP 1: setup a mask array to determine to which patch of the new level every patch of the current level belongs. To do so we make four arrays, #gloPatchMask, #globHomPatchMask, #locPatchMask_NekDouble and #locPatchMask. These arrays are then used to check which local dofs of the old level belong to which patch of the new level
  • STEP 2: We calculate how many local bnd dofs of the old level belong to the boundaries of each patch at the new level. We need this information to set up the mapping between different levels.

Definition at line 168 of file AssemblyMap.cpp.

171 : m_session(oldLevelMap->m_session), m_comm(oldLevelMap->GetComm()),
172 m_hash(0), m_solnType(oldLevelMap->m_solnType),
173 m_preconType(oldLevelMap->m_preconType),
174 m_successiveRHS(oldLevelMap->m_successiveRHS),
175 m_linSysIterSolver(oldLevelMap->m_linSysIterSolver),
176 m_gsh(oldLevelMap->m_gsh), m_bndGsh(oldLevelMap->m_bndGsh),
177 m_lowestStaticCondLevel(oldLevelMap->m_lowestStaticCondLevel)
178{
179 int i;
180 int j;
181 int cnt;
182
183 //--------------------------------------------------------------
184 // -- Extract information from the input argument
185 int numGlobalBndCoeffsOld = oldLevelMap->GetNumGlobalBndCoeffs();
186 int numGlobalDirBndCoeffsOld = oldLevelMap->GetNumGlobalDirBndCoeffs();
187 int numLocalBndCoeffsOld = oldLevelMap->GetNumLocalBndCoeffs();
188 int numLocalDirBndCoeffsOld = oldLevelMap->GetNumLocalDirBndCoeffs();
189 bool signChangeOld = oldLevelMap->GetSignChange();
190
191 int staticCondLevelOld = oldLevelMap->GetStaticCondLevel();
192 int numPatchesOld = oldLevelMap->GetNumPatches();
193 GlobalSysSolnType solnTypeOld = oldLevelMap->GetGlobalSysSolnType();
194 const Array<OneD, const unsigned int> &numLocalBndCoeffsPerPatchOld =
195 oldLevelMap->GetNumLocalBndCoeffsPerPatch();
196 //--------------------------------------------------------------
197
198 //--------------------------------------------------------------
199 int newLevel = staticCondLevelOld + 1;
200 /** - STEP 1: setup a mask array to determine to which patch
201 * of the new level every patch of the current
202 * level belongs. To do so we make four arrays,
203 * #gloPatchMask, #globHomPatchMask,
204 * #locPatchMask_NekDouble and #locPatchMask.
205 * These arrays are then used to check which local
206 * dofs of the old level belong to which patch of
207 * the new level
208 */
209 Array<OneD, NekDouble> globPatchMask(numGlobalBndCoeffsOld, -1.0);
210 Array<OneD, NekDouble> globHomPatchMask(globPatchMask +
211 numGlobalDirBndCoeffsOld);
212 Array<OneD, NekDouble> locPatchMask_NekDouble(numLocalBndCoeffsOld, -3.0);
213 Array<OneD, int> locPatchMask(numLocalBndCoeffsOld);
214
215 // Fill the array globPatchMask as follows:
216 // - The first part (i.e. the glob bnd dofs) is filled with the
217 // value -1
218 // - The second part (i.e. the glob interior dofs) is numbered
219 // according to the patch it belongs to (i.e. dofs in first block
220 // all are numbered 0, the second block numbered are 1, etc...)
221 multiLevelGraph->MaskPatches(newLevel, globHomPatchMask);
222
223 // Map from Global Dofs to Local Dofs
224 // As a result, we know for each local dof whether
225 // it is mapped to the boundary of the next level, or to which
226 // patch. Based upon this, we can than later associate every patch
227 // of the current level with a patch in the next level.
228 oldLevelMap->GlobalToLocalBndWithoutSign(globPatchMask,
229 locPatchMask_NekDouble);
230
231 // Convert the result to an array of integers rather than doubles
232 RoundNekDoubleToInt(locPatchMask_NekDouble, locPatchMask);
233
234 /** - STEP 2: We calculate how many local bnd dofs of the
235 * old level belong to the boundaries of each patch at
236 * the new level. We need this information to set up the
237 * mapping between different levels.
238 */
239
240 // Retrieve the number of patches at the next level
241 int numPatchesWithIntNew =
242 multiLevelGraph->GetNpatchesWithInterior(newLevel);
243 int numPatchesNew = numPatchesWithIntNew;
244
245 // Allocate memory to store the number of local dofs associated to
246 // each of elemental boundaries of these patches
247 std::map<int, int> numLocalBndCoeffsPerPatchNew;
248 for (int i = 0; i < numPatchesNew; i++)
249 {
250 numLocalBndCoeffsPerPatchNew[i] = 0;
251 }
252
253 int minval;
254 int maxval;
255 int curPatch;
256 for (i = cnt = 0; i < numPatchesOld; i++)
257 {
258 // For every patch at the current level, the mask array
259 // locPatchMask should be filled with
260 // - the same (positive) number for each entry (which will
261 // correspond to the patch at the next level it belongs to)
262 // - the same (positive) number for each entry, except some
263 // entries that are -1 (the enties correspond to -1, will be
264 // mapped to the local boundary of the next level patch given
265 // by the positive number)
266 // - -1 for all entries. In this case, we will make an
267 // additional patch only consisting of boundaries at the next
268 // level
269 minval =
270 *min_element(&locPatchMask[cnt],
271 &locPatchMask[cnt] + numLocalBndCoeffsPerPatchOld[i]);
272 maxval =
273 *max_element(&locPatchMask[cnt],
274 &locPatchMask[cnt] + numLocalBndCoeffsPerPatchOld[i]);
275 ASSERTL0((minval == maxval) || (minval == -1),
276 "These values should never be the same");
277
278 if (maxval == -1)
279 {
280 curPatch = numPatchesNew;
281 numLocalBndCoeffsPerPatchNew[curPatch] = 0;
282 numPatchesNew++;
283 }
284 else
285 {
286 curPatch = maxval;
287 }
288
289 for (j = 0; j < numLocalBndCoeffsPerPatchOld[i]; j++)
290 {
291 ASSERTL0((locPatchMask[cnt] == maxval) ||
292 (locPatchMask[cnt] == minval),
293 "These values should never be the same");
294 if (locPatchMask[cnt] == -1)
295 {
296 ++numLocalBndCoeffsPerPatchNew[curPatch];
297 }
298 cnt++;
299 }
300 }
301
302 // Count how many local dofs of the old level are mapped
303 // to the local boundary dofs of the new level
306 m_numPatches = numLocalBndCoeffsPerPatchNew.size();
307 m_numLocalBndCoeffsPerPatch = Array<OneD, unsigned int>(m_numPatches);
308 m_numLocalIntCoeffsPerPatch = Array<OneD, unsigned int>(m_numPatches, 0u);
309 multiLevelGraph->GetNintDofsPerPatch(newLevel, m_numLocalIntCoeffsPerPatch);
310
311 for (int i = 0; i < m_numPatches; i++)
312 {
314 (unsigned int)numLocalBndCoeffsPerPatchNew[i];
318 }
319
320 // Also initialise some more data members
321 m_solnType = solnTypeOld;
326 "This method should only be called for in "
327 "case of multi-level static condensation.");
328 m_staticCondLevel = newLevel;
329 m_signChange = signChangeOld;
330 m_numLocalDirBndCoeffs = numLocalDirBndCoeffsOld;
331 m_numGlobalDirBndCoeffs = numGlobalDirBndCoeffsOld;
333 multiLevelGraph->GetInteriorOffset(newLevel) + m_numGlobalDirBndCoeffs;
335 multiLevelGraph->GetNumGlobalDofs(newLevel) + m_numGlobalDirBndCoeffs;
336 m_localToGlobalBndMap = Array<OneD, int>(m_numLocalBndCoeffs);
337
338 m_localToLocalBndMap = Array<OneD, int>(m_numLocalBndCoeffs);
340 Array<OneD, int>(m_numLocalCoeffs - m_numLocalBndCoeffs);
341
342 // local to bnd map is just a copy
343 for (int i = 0; i < m_numLocalBndCoeffs; ++i)
344 {
346 }
347
348 // local to int map is just a copy plus offset
349 for (int i = m_numLocalBndCoeffs; i < m_numLocalCoeffs; ++i)
350 {
352 }
353
354 if (m_signChange)
355 {
356 m_localToGlobalBndSign = Array<OneD, NekDouble>(m_numLocalBndCoeffs);
357 }
358
360 MemoryManager<PatchMap>::AllocateSharedPtr(numLocalBndCoeffsOld);
361
362 m_globalToUniversalBndMap = Array<OneD, int>(
363 m_numGlobalBndCoeffs, oldLevelMap->GetGlobalToUniversalBndMap());
364 m_globalToUniversalBndMapUnique = Array<OneD, int>(
365 m_numGlobalBndCoeffs, oldLevelMap->GetGlobalToUniversalBndMapUnique());
366
367 // Set up an offset array that denotes the offset of the local
368 // boundary degrees of freedom of the next level
369 Array<OneD, int> numLocalBndCoeffsPerPatchOffset(m_numPatches + 1, 0);
370 for (int i = 1; i < m_numPatches + 1; i++)
371 {
372 numLocalBndCoeffsPerPatchOffset[i] +=
373 numLocalBndCoeffsPerPatchOffset[i - 1] +
374 numLocalBndCoeffsPerPatchNew[i - 1];
375 }
376
377 int additionalPatchCnt = numPatchesWithIntNew;
378 int newid;
379 int blockid;
380 bool isBndDof;
382 Array<OneD, int> bndDofPerPatchCnt(m_numPatches, 0);
383
384 for (i = cnt = 0; i < numPatchesOld; i++)
385 {
386 minval =
387 *min_element(&locPatchMask[cnt],
388 &locPatchMask[cnt] + numLocalBndCoeffsPerPatchOld[i]);
389 maxval =
390 *max_element(&locPatchMask[cnt],
391 &locPatchMask[cnt] + numLocalBndCoeffsPerPatchOld[i]);
392 ASSERTL0((minval == maxval) || (minval == -1),
393 "These values should never be the same");
394
395 if (maxval == -1)
396 {
397 curPatch = additionalPatchCnt;
398 additionalPatchCnt++;
399 }
400 else
401 {
402 curPatch = maxval;
403 }
404
405 for (j = 0; j < numLocalBndCoeffsPerPatchOld[i]; j++)
406 {
407 ASSERTL0((locPatchMask[cnt] == maxval) ||
408 (locPatchMask[cnt] == minval),
409 "These values should never be the same");
410
411 sign = oldLevelMap->GetLocalToGlobalBndSign(cnt);
412
413 if (locPatchMask[cnt] == -1)
414 {
415 newid = numLocalBndCoeffsPerPatchOffset[curPatch];
416
417 m_localToGlobalBndMap[newid] =
418 oldLevelMap->GetLocalToGlobalBndMap(cnt);
419
420 if (m_signChange)
421 {
423 }
424
425 blockid = bndDofPerPatchCnt[curPatch];
426 isBndDof = true;
427
428 numLocalBndCoeffsPerPatchOffset[curPatch]++;
429 bndDofPerPatchCnt[curPatch]++;
430 }
431 else
432 {
433 newid = oldLevelMap->GetLocalToGlobalBndMap(cnt) -
435
436 blockid =
437 oldLevelMap->GetLocalToGlobalBndMap(cnt) -
439 multiLevelGraph->GetInteriorOffset(newLevel, curPatch);
440 isBndDof = false;
441 }
442
443 sign = isBndDof ? 1.0 : sign;
444
445 m_patchMapFromPrevLevel->SetPatchMap(cnt, curPatch, blockid,
446 isBndDof, sign);
447 cnt++;
448 }
449 }
450
451 // set up local to local mapping from previous to new level
454
456
457 // Postprocess the computed information - Update the old
458 // level with the mapping to new level
459 // oldLevelMap->SetLocalBndToNextLevelMap(oldLocalBndToNewLevelMap,oldLocalBndToNewLevelSign);
460
461 // - Construct the next level mapping object
462 if (m_staticCondLevel < (multiLevelGraph->GetNlevels() - 1))
463 {
466 multiLevelGraph);
467 }
468}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:47
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
int m_lowestStaticCondLevel
Lowest static condensation level.
Definition: AssemblyMap.h:436
int m_numLocalCoeffs
Total number of local coefficients.
Definition: AssemblyMap.h:361
bool m_signChange
Flag indicating if modes require sign reversal.
Definition: AssemblyMap.h:375
PatchMapSharedPtr m_patchMapFromPrevLevel
Mapping information for previous level in MultiLevel Solver.
Definition: AssemblyMap.h:511
Array< OneD, int > m_localToLocalIntMap
Integer map of local boundary coeffs to local interior system numbering.
Definition: AssemblyMap.h:384
int m_numGlobalCoeffs
Total number of global coefficients.
Definition: AssemblyMap.h:372
Array< OneD, int > m_globalToUniversalBndMap
Integer map of process coeffs to universal space.
Definition: AssemblyMap.h:394
void CalculateBndSystemBandWidth()
Calculates the bandwidth of the boundary system.
Array< OneD, NekDouble > m_localToGlobalBndSign
Integer sign of local boundary coeffs to global space.
Definition: AssemblyMap.h:380
Array< OneD, unsigned int > m_numLocalBndCoeffsPerPatch
The number of bnd dofs per patch.
Definition: AssemblyMap.h:427
AssemblyMapSharedPtr m_nextLevelLocalToGlobalMap
Map from the patches of the previous level to the patches of the current level.
Definition: AssemblyMap.h:434
int m_staticCondLevel
The level of recursion in the case of multi-level static condensation.
Definition: AssemblyMap.h:423
Array< OneD, unsigned int > m_numLocalIntCoeffsPerPatch
The number of int dofs per patch.
Definition: AssemblyMap.h:429
Array< OneD, int > m_localToGlobalBndMap
Integer map of local coeffs to global Boundary Dofs.
Definition: AssemblyMap.h:378
Array< OneD, int > m_globalToUniversalBndMapUnique
Integer map of unique process coeffs to universal space (signed)
Definition: AssemblyMap.h:396
Array< OneD, int > m_localToLocalBndMap
Integer map of local boundary coeffs to local boundary system numbering.
Definition: AssemblyMap.h:382
int m_numPatches
The number of patches (~elements) in the current level.
Definition: AssemblyMap.h:425
int RoundNekDoubleToInt(NekDouble x)
Rounds a double precision number to an integer.
Definition: AssemblyMap.cpp:56
double NekDouble

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, ASSERTL1, CalculateBndSystemBandWidth(), Nektar::MultiRegions::eDirectMultiLevelStaticCond, Nektar::MultiRegions::eIterativeMultiLevelStaticCond, Nektar::MultiRegions::ePETScMultiLevelStaticCond, Nektar::MultiRegions::eXxtMultiLevelStaticCond, GetGlobalSysSolnType(), GetGlobalToUniversalBndMap(), GetGlobalToUniversalBndMapUnique(), GetLocalToGlobalBndMap(), GetLocalToGlobalBndSign(), GetNumGlobalBndCoeffs(), GetNumGlobalDirBndCoeffs(), GetNumLocalBndCoeffs(), GetNumLocalBndCoeffsPerPatch(), GetNumLocalDirBndCoeffs(), GetNumPatches(), GetSignChange(), GetStaticCondLevel(), GlobalToLocalBndWithoutSign(), m_globalToUniversalBndMap, m_globalToUniversalBndMapUnique, m_localToGlobalBndMap, m_localToGlobalBndSign, m_localToLocalBndMap, m_localToLocalIntMap, m_nextLevelLocalToGlobalMap, m_numGlobalBndCoeffs, m_numGlobalCoeffs, m_numGlobalDirBndCoeffs, m_numLocalBndCoeffs, m_numLocalBndCoeffsPerPatch, m_numLocalCoeffs, m_numLocalDirBndCoeffs, m_numLocalIntCoeffsPerPatch, m_numPatches, m_patchMapFromPrevLevel, m_signChange, m_solnType, m_staticCondLevel, Nektar::MultiRegions::RoundNekDoubleToInt(), and sign.

◆ ~AssemblyMap()

Nektar::MultiRegions::AssemblyMap::~AssemblyMap ( void  )
virtual

Destructor.

Definition at line 470 of file AssemblyMap.cpp.

471{
472}

Member Function Documentation

◆ Assemble() [1/2]

void Nektar::MultiRegions::AssemblyMap::Assemble ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global 
) const

Definition at line 789 of file AssemblyMap.cpp.

791{
792 v_Assemble(loc, global);
793}
virtual void v_Assemble(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global) const

References CG_Iterations::loc, and v_Assemble().

Referenced by Nektar::MultiRegions::AssemblyMapCG::v_Assemble().

◆ Assemble() [2/2]

void Nektar::MultiRegions::AssemblyMap::Assemble ( const NekVector< NekDouble > &  loc,
NekVector< NekDouble > &  global 
) const

Definition at line 795 of file AssemblyMap.cpp.

797{
798 v_Assemble(loc, global);
799}

References CG_Iterations::loc, and v_Assemble().

◆ AssembleBnd() [1/4]

void Nektar::MultiRegions::AssemblyMap::AssembleBnd ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global 
) const

Definition at line 1244 of file AssemblyMap.cpp.

1246{
1248 "Local vector is not of correct dimension");
1249 ASSERTL1(global.size() >= m_numGlobalBndCoeffs,
1250 "Global vector is not of correct dimension");
1251
1252 Vmath::Zero(m_numGlobalBndCoeffs, global.get(), 1);
1253
1254 if (m_signChange)
1255 {
1257 loc.get(), m_localToGlobalBndMap.get(), global.get());
1258 }
1259 else
1260 {
1262 m_localToGlobalBndMap.get(), global.get());
1263 }
1264 UniversalAssembleBnd(global);
1265}
void UniversalAssembleBnd(Array< OneD, NekDouble > &pGlobal) const
void Assmb(int n, const T *x, const int *y, T *z)
Assemble z[y[i]] += x[i]; z should be zero'd first.
Definition: Vmath.hpp:577
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.hpp:273

References ASSERTL1, Vmath::Assmb(), CG_Iterations::loc, m_localToGlobalBndMap, m_localToGlobalBndSign, m_numGlobalBndCoeffs, m_numLocalBndCoeffs, m_signChange, UniversalAssembleBnd(), and Vmath::Zero().

◆ AssembleBnd() [2/4]

void Nektar::MultiRegions::AssemblyMap::AssembleBnd ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global,
int  offset 
) const

Definition at line 1220 of file AssemblyMap.cpp.

1222{
1224 "Local array is not of correct dimension");
1225 ASSERTL1(global.size() >= m_numGlobalBndCoeffs - offset,
1226 "Global array is not of correct dimension");
1227 Array<OneD, NekDouble> tmp(m_numGlobalBndCoeffs, 0.0);
1228
1229 if (m_signChange)
1230 {
1232 loc.get(), m_localToGlobalBndMap.get(), tmp.get());
1233 }
1234 else
1235 {
1237 m_localToGlobalBndMap.get(), tmp.get());
1238 }
1240 Vmath::Vcopy(m_numGlobalBndCoeffs - offset, tmp.get() + offset, 1,
1241 global.get(), 1);
1242}
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References ASSERTL1, Vmath::Assmb(), CG_Iterations::loc, m_localToGlobalBndMap, m_localToGlobalBndSign, m_numGlobalBndCoeffs, m_numLocalBndCoeffs, m_signChange, UniversalAssembleBnd(), and Vmath::Vcopy().

◆ AssembleBnd() [3/4]

void Nektar::MultiRegions::AssemblyMap::AssembleBnd ( const NekVector< NekDouble > &  loc,
NekVector< NekDouble > &  global 
) const

Definition at line 1214 of file AssemblyMap.cpp.

1216{
1217 AssembleBnd(loc.GetPtr(), global.GetPtr());
1218}
void AssembleBnd(const NekVector< NekDouble > &loc, NekVector< NekDouble > &global, int offset) const
Array< OneD, DataType > & GetPtr()
Definition: NekVector.cpp:217

References AssembleBnd(), Nektar::NekVector< DataType >::GetPtr(), and CG_Iterations::loc.

◆ AssembleBnd() [4/4]

void Nektar::MultiRegions::AssemblyMap::AssembleBnd ( const NekVector< NekDouble > &  loc,
NekVector< NekDouble > &  global,
int  offset 
) const

Definition at line 1208 of file AssemblyMap.cpp.

1210{
1211 AssembleBnd(loc.GetPtr(), global.GetPtr(), offset);
1212}

References AssembleBnd(), Nektar::NekVector< DataType >::GetPtr(), and CG_Iterations::loc.

Referenced by AssembleBnd(), and Nektar::MultiRegions::AssemblyMapDG::v_Assemble().

◆ AtLastLevel()

bool Nektar::MultiRegions::AssemblyMap::AtLastLevel ( ) const

Returns true if this is the last level in the multi-level static condensation.

Definition at line 1335 of file AssemblyMap.cpp.

1336{
1337 return !(m_nextLevelLocalToGlobalMap.get());
1338}

References m_nextLevelLocalToGlobalMap.

◆ CalculateBndSystemBandWidth()

void Nektar::MultiRegions::AssemblyMap::CalculateBndSystemBandWidth ( )
protected

Calculates the bandwidth of the boundary system.

The bandwidth calculated corresponds to what is referred to as half-bandwidth. If the elements of the matrix are designated as a_ij, it corresponds to the maximum value of |i-j| for non-zero a_ij. As a result, the value also corresponds to the number of sub- or super-diagonals.

The bandwith can be calculated elementally as it corresponds to the maximal elemental bandwith (i.e. the maximal difference in global DOF index for every element).

We here calculate the bandwith of the global boundary system (as used for static condensation).

Definition at line 488 of file AssemblyMap.cpp.

489{
490 int i, j;
491 int cnt = 0;
492 int locSize;
493 int maxId;
494 int minId;
495 int bwidth = -1;
496 for (i = 0; i < m_numPatches; ++i)
497 {
498 locSize = m_numLocalBndCoeffsPerPatch[i];
499 maxId = -1;
500 minId = m_numLocalBndCoeffs + 1;
501 for (j = 0; j < locSize; j++)
502 {
504 {
505 if (m_localToGlobalBndMap[cnt + j] > maxId)
506 {
507 maxId = m_localToGlobalBndMap[cnt + j];
508 }
509
510 if (m_localToGlobalBndMap[cnt + j] < minId)
511 {
512 minId = m_localToGlobalBndMap[cnt + j];
513 }
514 }
515 }
516 bwidth = (bwidth > (maxId - minId)) ? bwidth : (maxId - minId);
517
518 cnt += locSize;
519 }
520
521 m_bndSystemBandWidth = bwidth;
522}

References m_bndSystemBandWidth, m_localToGlobalBndMap, m_numGlobalDirBndCoeffs, m_numLocalBndCoeffs, m_numLocalBndCoeffsPerPatch, and m_numPatches.

Referenced by AssemblyMap(), Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), and Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG().

◆ GetBndCondCoeffsToLocalCoeffsMap()

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetBndCondCoeffsToLocalCoeffsMap ( )

Retrieves the local indices corresponding to the boundary expansion modes.

Definition at line 974 of file AssemblyMap.cpp.

975{
977}
Array< OneD, int > m_bndCondCoeffsToLocalCoeffsMap
Integer map of bnd cond coeffs to local coefficients.
Definition: AssemblyMap.h:386

References m_bndCondCoeffsToLocalCoeffsMap.

◆ GetBndCondCoeffsToLocalCoeffsSign()

const Array< OneD, NekDouble > & Nektar::MultiRegions::AssemblyMap::GetBndCondCoeffsToLocalCoeffsSign ( )

Returns the modal sign associated with a given boundary expansion mode.

Definition at line 979 of file AssemblyMap.cpp.

980{
982}
Array< OneD, NekDouble > m_bndCondCoeffsToLocalCoeffsSign
Integer map of sign of bnd cond coeffs to local coefficients.
Definition: AssemblyMap.h:388

References m_bndCondCoeffsToLocalCoeffsSign.

◆ GetBndCondCoeffsToLocalTraceMap()

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetBndCondCoeffsToLocalTraceMap ( )

Retrieves the local indices corresponding to the boundary expansion modes to global trace.

Definition at line 984 of file AssemblyMap.cpp.

985{
987}
Array< OneD, int > m_bndCondCoeffsToLocalTraceMap
Integer map of bnd cond coeff to local trace coeff.
Definition: AssemblyMap.h:390

References m_bndCondCoeffsToLocalTraceMap.

◆ GetBndCondIDToGlobalTraceID() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetBndCondIDToGlobalTraceID ( )

Definition at line 995 of file AssemblyMap.cpp.

996{
998}
Array< OneD, int > m_bndCondIDToGlobalTraceID
Integer map of bnd cond trace number to global trace number.
Definition: AssemblyMap.h:392

References m_bndCondIDToGlobalTraceID.

◆ GetBndCondIDToGlobalTraceID() [2/2]

int Nektar::MultiRegions::AssemblyMap::GetBndCondIDToGlobalTraceID ( const int  i)

Returns the global index of the boundary trace giving the index on the boundary expansion.

Definition at line 989 of file AssemblyMap.cpp.

990{
991 ASSERTL1(i < m_bndCondIDToGlobalTraceID.size(), "Index out of range.");
993}

References ASSERTL1, and m_bndCondIDToGlobalTraceID.

◆ GetBndSystemBandWidth()

int Nektar::MultiRegions::AssemblyMap::GetBndSystemBandWidth ( ) const

Returns the bandwidth of the boundary system.

Definition at line 1298 of file AssemblyMap.cpp.

1299{
1300 return m_bndSystemBandWidth;
1301}

References m_bndSystemBandWidth.

Referenced by Nektar::MultiRegions::AssemblyMapDG::v_GetFullSystemBandWidth().

◆ GetComm()

LibUtilities::CommSharedPtr Nektar::MultiRegions::AssemblyMap::GetComm ( )

Retrieves the communicator.

Definition at line 708 of file AssemblyMap.cpp.

709{
710 return m_comm;
711}

References m_comm.

◆ GetExtraDirEdges()

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetExtraDirEdges ( )

Definition at line 921 of file AssemblyMap.cpp.

922{
923 return v_GetExtraDirEdges();
924}
virtual const Array< OneD, const int > & v_GetExtraDirEdges()

References v_GetExtraDirEdges().

◆ GetFullSystemBandWidth()

int Nektar::MultiRegions::AssemblyMap::GetFullSystemBandWidth ( ) const

Definition at line 881 of file AssemblyMap.cpp.

882{
884}
virtual int v_GetFullSystemBandWidth() const

References v_GetFullSystemBandWidth().

◆ GetGlobalSysSolnType()

GlobalSysSolnType Nektar::MultiRegions::AssemblyMap::GetGlobalSysSolnType ( ) const

Returns the method of solving global systems.

Definition at line 1340 of file AssemblyMap.cpp.

1341{
1342 return m_solnType;
1343}

References m_solnType.

Referenced by AssemblyMap().

◆ GetGlobalToUniversalBndMap()

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetGlobalToUniversalBndMap ( )

Definition at line 952 of file AssemblyMap.cpp.

953{
955}

References m_globalToUniversalBndMap.

Referenced by AssemblyMap().

◆ GetGlobalToUniversalBndMapUnique()

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetGlobalToUniversalBndMapUnique ( )

Definition at line 957 of file AssemblyMap.cpp.

958{
960}

References m_globalToUniversalBndMapUnique.

Referenced by AssemblyMap().

◆ GetGlobalToUniversalMap() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetGlobalToUniversalMap ( )

Definition at line 743 of file AssemblyMap.cpp.

744{
746}
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMap()

References v_GetGlobalToUniversalMap().

◆ GetGlobalToUniversalMap() [2/2]

int Nektar::MultiRegions::AssemblyMap::GetGlobalToUniversalMap ( const int  i) const

Definition at line 728 of file AssemblyMap.cpp.

729{
731}

References v_GetGlobalToUniversalMap().

◆ GetGlobalToUniversalMapUnique() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetGlobalToUniversalMapUnique ( )

Definition at line 748 of file AssemblyMap.cpp.

749{
751}
virtual const Array< OneD, const int > & v_GetGlobalToUniversalMapUnique()

References v_GetGlobalToUniversalMapUnique().

◆ GetGlobalToUniversalMapUnique() [2/2]

int Nektar::MultiRegions::AssemblyMap::GetGlobalToUniversalMapUnique ( const int  i) const

Definition at line 733 of file AssemblyMap.cpp.

734{
736}

References v_GetGlobalToUniversalMapUnique().

◆ GetHash()

size_t Nektar::MultiRegions::AssemblyMap::GetHash ( ) const

Retrieves the hash of this map.

Definition at line 718 of file AssemblyMap.cpp.

719{
720 return m_hash;
721}

References m_hash.

◆ GetLinSysIterSolver()

std::string Nektar::MultiRegions::AssemblyMap::GetLinSysIterSolver ( ) const

Definition at line 1360 of file AssemblyMap.cpp.

1361{
1362 return m_linSysIterSolver;
1363}

References m_linSysIterSolver.

◆ GetLocalToGlobalBndMap() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalBndMap ( void  )

Retrieve the global indices of the local boundary modes.

Definition at line 937 of file AssemblyMap.cpp.

938{
940}

References m_localToGlobalBndMap.

◆ GetLocalToGlobalBndMap() [2/2]

int Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalBndMap ( const int  i) const

Retrieve the global index of a given local boundary mode.

Definition at line 932 of file AssemblyMap.cpp.

933{
934 return m_localToGlobalBndMap[i];
935}

References m_localToGlobalBndMap.

Referenced by AssemblyMap().

◆ GetLocalToGlobalBndSign() [1/2]

Array< OneD, const NekDouble > Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalBndSign ( void  ) const

Retrieve the sign change for all local boundary modes.

Definition at line 947 of file AssemblyMap.cpp.

948{
950}

References m_localToGlobalBndSign.

Referenced by Nektar::MultiRegions::AssemblyMapDG::v_GetLocalToGlobalSign().

◆ GetLocalToGlobalBndSign() [2/2]

NekDouble Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalBndSign ( const int  i) const

Retrieve the sign change of a given local boundary mode.

Definition at line 962 of file AssemblyMap.cpp.

963{
964 if (m_signChange)
965 {
966 return m_localToGlobalBndSign[i];
967 }
968 else
969 {
970 return 1.0;
971 }
972}

References m_localToGlobalBndSign, and m_signChange.

Referenced by AssemblyMap().

◆ GetLocalToGlobalMap() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalMap ( )

Definition at line 738 of file AssemblyMap.cpp.

739{
740 return v_GetLocalToGlobalMap();
741}
virtual const Array< OneD, const int > & v_GetLocalToGlobalMap()

References v_GetLocalToGlobalMap().

◆ GetLocalToGlobalMap() [2/2]

int Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalMap ( const int  i) const

Definition at line 723 of file AssemblyMap.cpp.

724{
725 return v_GetLocalToGlobalMap(i);
726}

References v_GetLocalToGlobalMap().

◆ GetLocalToGlobalSign() [1/2]

const Array< OneD, NekDouble > & Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalSign ( ) const

Definition at line 758 of file AssemblyMap.cpp.

759{
760 return v_GetLocalToGlobalSign();
761}
virtual const Array< OneD, NekDouble > & v_GetLocalToGlobalSign() const

References v_GetLocalToGlobalSign().

◆ GetLocalToGlobalSign() [2/2]

NekDouble Nektar::MultiRegions::AssemblyMap::GetLocalToGlobalSign ( const int  i) const

Definition at line 753 of file AssemblyMap.cpp.

754{
755 return v_GetLocalToGlobalSign(i);
756}

References v_GetLocalToGlobalSign().

◆ GetLowestStaticCondLevel()

int Nektar::MultiRegions::AssemblyMap::GetLowestStaticCondLevel ( ) const
inline

Definition at line 311 of file AssemblyMap.h.

312 {
314 }

References m_lowestStaticCondLevel.

◆ GetNextLevelLocalToGlobalMap()

const AssemblyMapSharedPtr Nektar::MultiRegions::AssemblyMap::GetNextLevelLocalToGlobalMap ( ) const

Returns the local to global mapping for the next level in the multi-level static condensation.

Definition at line 1325 of file AssemblyMap.cpp.

1326{
1328}

References m_nextLevelLocalToGlobalMap.

◆ GetNumDirEdges()

int Nektar::MultiRegions::AssemblyMap::GetNumDirEdges ( ) const

Definition at line 901 of file AssemblyMap.cpp.

902{
903 return v_GetNumDirEdges();
904}
virtual int v_GetNumDirEdges() const

References v_GetNumDirEdges().

◆ GetNumDirFaces()

int Nektar::MultiRegions::AssemblyMap::GetNumDirFaces ( ) const

Definition at line 906 of file AssemblyMap.cpp.

907{
908 return v_GetNumDirFaces();
909}
virtual int v_GetNumDirFaces() const

References v_GetNumDirFaces().

◆ GetNumGlobalBndCoeffs()

int Nektar::MultiRegions::AssemblyMap::GetNumGlobalBndCoeffs ( ) const

Returns the total number of global boundary coefficients.

Definition at line 1015 of file AssemblyMap.cpp.

1016{
1017 return m_numGlobalBndCoeffs;
1018}

References m_numGlobalBndCoeffs.

Referenced by AssemblyMap().

◆ GetNumGlobalCoeffs()

int Nektar::MultiRegions::AssemblyMap::GetNumGlobalCoeffs ( ) const

Returns the total number of global coefficients.

Definition at line 1025 of file AssemblyMap.cpp.

1026{
1027 return m_numGlobalCoeffs;
1028}

References m_numGlobalCoeffs.

◆ GetNumGlobalDirBndCoeffs()

int Nektar::MultiRegions::AssemblyMap::GetNumGlobalDirBndCoeffs ( ) const

Returns the number of global Dirichlet boundary coefficients.

Definition at line 1000 of file AssemblyMap.cpp.

1001{
1003}

References m_numGlobalDirBndCoeffs.

Referenced by AssemblyMap().

◆ GetNumLocalBndCoeffs()

int Nektar::MultiRegions::AssemblyMap::GetNumLocalBndCoeffs ( ) const

Returns the total number of local boundary coefficients.

Definition at line 1010 of file AssemblyMap.cpp.

1011{
1012 return m_numLocalBndCoeffs;
1013}

References m_numLocalBndCoeffs.

Referenced by AssemblyMap().

◆ GetNumLocalBndCoeffsPerPatch()

const Array< OneD, const unsigned int > & Nektar::MultiRegions::AssemblyMap::GetNumLocalBndCoeffsPerPatch ( )

Returns the number of local boundary coefficients in each patch.

Definition at line 1313 of file AssemblyMap.cpp.

1315{
1317}

References m_numLocalBndCoeffsPerPatch.

Referenced by AssemblyMap().

◆ GetNumLocalCoeffs()

int Nektar::MultiRegions::AssemblyMap::GetNumLocalCoeffs ( ) const

Returns the total number of local coefficients.

Definition at line 1020 of file AssemblyMap.cpp.

1021{
1022 return m_numLocalCoeffs;
1023}

References m_numLocalCoeffs.

◆ GetNumLocalDirBndCoeffs()

int Nektar::MultiRegions::AssemblyMap::GetNumLocalDirBndCoeffs ( ) const

Returns the number of local Dirichlet boundary coefficients.

Definition at line 1005 of file AssemblyMap.cpp.

1006{
1008}

References m_numLocalDirBndCoeffs.

Referenced by AssemblyMap().

◆ GetNumLocalIntCoeffsPerPatch()

const Array< OneD, const unsigned int > & Nektar::MultiRegions::AssemblyMap::GetNumLocalIntCoeffsPerPatch ( )

Returns the number of local interior coefficients in each patch.

Definition at line 1319 of file AssemblyMap.cpp.

1321{
1323}

References m_numLocalIntCoeffsPerPatch.

◆ GetNumNonDirEdgeModes()

int Nektar::MultiRegions::AssemblyMap::GetNumNonDirEdgeModes ( ) const

Definition at line 891 of file AssemblyMap.cpp.

892{
894}
virtual int v_GetNumNonDirEdgeModes() const

References v_GetNumNonDirEdgeModes().

◆ GetNumNonDirEdges()

int Nektar::MultiRegions::AssemblyMap::GetNumNonDirEdges ( ) const

Definition at line 911 of file AssemblyMap.cpp.

912{
913 return v_GetNumNonDirEdges();
914}
virtual int v_GetNumNonDirEdges() const

References v_GetNumNonDirEdges().

◆ GetNumNonDirFaceModes()

int Nektar::MultiRegions::AssemblyMap::GetNumNonDirFaceModes ( ) const

Definition at line 896 of file AssemblyMap.cpp.

897{
899}
virtual int v_GetNumNonDirFaceModes() const

References v_GetNumNonDirFaceModes().

◆ GetNumNonDirFaces()

int Nektar::MultiRegions::AssemblyMap::GetNumNonDirFaces ( ) const

Definition at line 916 of file AssemblyMap.cpp.

917{
918 return v_GetNumNonDirFaces();
919}
virtual int v_GetNumNonDirFaces() const

References v_GetNumNonDirFaces().

◆ GetNumNonDirVertexModes()

int Nektar::MultiRegions::AssemblyMap::GetNumNonDirVertexModes ( ) const

Definition at line 886 of file AssemblyMap.cpp.

887{
889}
virtual int v_GetNumNonDirVertexModes() const

References v_GetNumNonDirVertexModes().

◆ GetNumPatches()

int Nektar::MultiRegions::AssemblyMap::GetNumPatches ( ) const

Returns the number of patches in this static condensation level.

Definition at line 1308 of file AssemblyMap.cpp.

1309{
1310 return m_numPatches;
1311}

References m_numPatches.

Referenced by AssemblyMap().

◆ GetPatchMapFromPrevLevel()

const PatchMapSharedPtr & Nektar::MultiRegions::AssemblyMap::GetPatchMapFromPrevLevel ( void  ) const

Returns the patch map from the previous level of the multi-level static condensation.

Definition at line 1330 of file AssemblyMap.cpp.

1331{
1333}

References m_patchMapFromPrevLevel.

◆ GetPreconType()

std::string Nektar::MultiRegions::AssemblyMap::GetPreconType ( ) const

Definition at line 1345 of file AssemblyMap.cpp.

1346{
1347 return m_preconType;
1348}

References m_preconType.

◆ GetSignChange()

bool Nektar::MultiRegions::AssemblyMap::GetSignChange ( )

Returns true if using a modal expansion requiring a change of sign of some modes.

Definition at line 942 of file AssemblyMap.cpp.

943{
944 return m_signChange;
945}

References m_signChange.

Referenced by AssemblyMap().

◆ GetSingularSystem()

bool Nektar::MultiRegions::AssemblyMap::GetSingularSystem ( ) const

Retrieves if the system is singular (true) or not (false)

Definition at line 1030 of file AssemblyMap.cpp.

1031{
1032 return m_systemSingular;
1033}
bool m_systemSingular
Flag indicating if the system is singular or not.
Definition: AssemblyMap.h:350

References m_systemSingular.

◆ GetStaticCondLevel()

int Nektar::MultiRegions::AssemblyMap::GetStaticCondLevel ( ) const

Returns the level of static condensation for this map.

Definition at line 1303 of file AssemblyMap.cpp.

1304{
1305 return m_staticCondLevel;
1306}

References m_staticCondLevel.

Referenced by AssemblyMap().

◆ GetSuccessiveRHS()

int Nektar::MultiRegions::AssemblyMap::GetSuccessiveRHS ( ) const

Definition at line 1355 of file AssemblyMap.cpp.

1356{
1357 return m_successiveRHS;
1358}

References m_successiveRHS.

◆ GetVariable()

std::string Nektar::MultiRegions::AssemblyMap::GetVariable ( )

Retrieves the variable string.

Definition at line 713 of file AssemblyMap.cpp.

714{
715 return m_variable;
716}

References m_variable.

◆ GlobalToLocal() [1/2]

void Nektar::MultiRegions::AssemblyMap::GlobalToLocal ( const Array< OneD, const NekDouble > &  global,
Array< OneD, NekDouble > &  loc 
) const

Definition at line 777 of file AssemblyMap.cpp.

779{
780 v_GlobalToLocal(global, loc);
781}
virtual void v_GlobalToLocal(const Array< OneD, const NekDouble > &global, Array< OneD, NekDouble > &loc) const

References CG_Iterations::loc, and v_GlobalToLocal().

Referenced by Nektar::MultiRegions::AssemblyMapCG::v_GlobalToLocal().

◆ GlobalToLocal() [2/2]

void Nektar::MultiRegions::AssemblyMap::GlobalToLocal ( const NekVector< NekDouble > &  global,
NekVector< NekDouble > &  loc 
) const

Definition at line 783 of file AssemblyMap.cpp.

785{
786 v_GlobalToLocal(global, loc);
787}

References CG_Iterations::loc, and v_GlobalToLocal().

◆ GlobalToLocalBnd() [1/4]

void Nektar::MultiRegions::AssemblyMap::GlobalToLocalBnd ( const Array< OneD, const NekDouble > &  global,
Array< OneD, NekDouble > &  loc 
) const

Definition at line 1073 of file AssemblyMap.cpp.

1075{
1077 "Local vector is not of correct dimension");
1078 ASSERTL1(global.size() >= m_numGlobalBndCoeffs,
1079 "Global vector is not of correct dimension");
1080
1081 Array<OneD, const NekDouble> glo;
1082 if (global.data() == loc.data())
1083 {
1084 glo = Array<OneD, NekDouble>(m_numLocalBndCoeffs, global.data());
1085 }
1086 else
1087 {
1088 glo = global; // create reference
1089 }
1090
1091 if (m_signChange)
1092 {
1094 glo.get(), m_localToGlobalBndMap.get(), loc.get());
1095 }
1096 else
1097 {
1099 m_localToGlobalBndMap.get(), loc.get());
1100 }
1101}
void Gathr(I n, const T *x, const I *y, T *z)
Gather vector z[i] = x[y[i]].
Definition: Vmath.hpp:507

References ASSERTL1, Vmath::Gathr(), CG_Iterations::loc, m_localToGlobalBndMap, m_localToGlobalBndSign, m_numGlobalBndCoeffs, m_numLocalBndCoeffs, and m_signChange.

◆ GlobalToLocalBnd() [2/4]

void Nektar::MultiRegions::AssemblyMap::GlobalToLocalBnd ( const Array< OneD, const NekDouble > &  global,
Array< OneD, NekDouble > &  loc,
int  offset 
) const

Definition at line 1047 of file AssemblyMap.cpp.

1050{
1052 "Local vector is not of correct dimension");
1053 ASSERTL1(global.size() >= m_numGlobalBndCoeffs - offset,
1054 "Global vector is not of correct dimension");
1055
1056 // offset input data by length "offset" for Dirichlet boundary conditions.
1057 Array<OneD, NekDouble> tmp(m_numGlobalBndCoeffs, 0.0);
1058 Vmath::Vcopy(m_numGlobalBndCoeffs - offset, global.get(), 1,
1059 tmp.get() + offset, 1);
1060
1061 if (m_signChange)
1062 {
1064 tmp.get(), m_localToGlobalBndMap.get(), loc.get());
1065 }
1066 else
1067 {
1069 m_localToGlobalBndMap.get(), loc.get());
1070 }
1071}

References ASSERTL1, Vmath::Gathr(), CG_Iterations::loc, m_localToGlobalBndMap, m_localToGlobalBndSign, m_numGlobalBndCoeffs, m_numLocalBndCoeffs, m_signChange, and Vmath::Vcopy().

◆ GlobalToLocalBnd() [3/4]

void Nektar::MultiRegions::AssemblyMap::GlobalToLocalBnd ( const NekVector< NekDouble > &  global,
NekVector< NekDouble > &  loc 
) const

Definition at line 1041 of file AssemblyMap.cpp.

1043{
1044 GlobalToLocalBnd(global.GetPtr(), loc.GetPtr());
1045}
void GlobalToLocalBnd(const NekVector< NekDouble > &global, NekVector< NekDouble > &loc, int offset) const

References Nektar::NekVector< DataType >::GetPtr(), GlobalToLocalBnd(), and CG_Iterations::loc.

◆ GlobalToLocalBnd() [4/4]

void Nektar::MultiRegions::AssemblyMap::GlobalToLocalBnd ( const NekVector< NekDouble > &  global,
NekVector< NekDouble > &  loc,
int  offset 
) const

◆ GlobalToLocalBndWithoutSign()

void Nektar::MultiRegions::AssemblyMap::GlobalToLocalBndWithoutSign ( const Array< OneD, const NekDouble > &  global,
Array< OneD, NekDouble > &  loc 
)
protected

Definition at line 1365 of file AssemblyMap.cpp.

1367{
1369 "Local vector is not of correct dimension");
1370 ASSERTL1(global.size() >= m_numGlobalBndCoeffs,
1371 "Global vector is not of correct dimension");
1372
1374 loc.get());
1375}

References ASSERTL1, Vmath::Gathr(), CG_Iterations::loc, m_localToGlobalBndMap, m_numGlobalBndCoeffs, and m_numLocalBndCoeffs.

Referenced by AssemblyMap().

◆ IsAbsoluteTolerance()

bool Nektar::MultiRegions::AssemblyMap::IsAbsoluteTolerance ( ) const

Definition at line 1350 of file AssemblyMap.cpp.

1351{
1352 return m_isAbsoluteTolerance;
1353}

References m_isAbsoluteTolerance.

◆ LinearSpaceMap()

std::shared_ptr< AssemblyMap > Nektar::MultiRegions::AssemblyMap::LinearSpaceMap ( const ExpList locexp,
GlobalSysSolnType  solnType 
)

Definition at line 926 of file AssemblyMap.cpp.

928{
929 return v_LinearSpaceMap(locexp, solnType);
930}
virtual std::shared_ptr< AssemblyMap > v_LinearSpaceMap(const ExpList &locexp, GlobalSysSolnType solnType)
Generate a linear space mapping from existing mapping.

References v_LinearSpaceMap().

◆ LocalBndToGlobal() [1/2]

void Nektar::MultiRegions::AssemblyMap::LocalBndToGlobal ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global,
bool  UseComm = true 
) const

Definition at line 1135 of file AssemblyMap.cpp.

1138{
1140 "Local vector is not of correct dimension");
1141 ASSERTL1(global.size() >= m_numGlobalBndCoeffs,
1142 "Global vector is not of correct dimension");
1143
1144 if (m_signChange)
1145 {
1147 loc.get(), m_localToGlobalBndMap.get(), global.get());
1148 }
1149 else
1150 {
1152 m_localToGlobalBndMap.get(), global.get());
1153 }
1154 if (UseComm)
1155 {
1156 Gs::Gather(global, Gs::gs_max, m_bndGsh);
1157 }
1158}
static void Gather(Nektar::Array< OneD, NekDouble > pU, gs_op pOp, gs_data *pGsh, Nektar::Array< OneD, NekDouble > pBuffer=NullNekDouble1DArray)
Performs a gather-scatter operation of the provided values.
Definition: GsLib.hpp:278
@ gs_max
Definition: GsLib.hpp:63
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
Definition: Vmath.hpp:539

References ASSERTL1, Gs::Gather(), Gs::gs_max, CG_Iterations::loc, m_bndGsh, m_localToGlobalBndMap, m_localToGlobalBndSign, m_numGlobalBndCoeffs, m_numLocalBndCoeffs, m_signChange, and Vmath::Scatr().

◆ LocalBndToGlobal() [2/2]

void Nektar::MultiRegions::AssemblyMap::LocalBndToGlobal ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global,
int  offset,
bool  UseComm = true 
) const

Definition at line 1103 of file AssemblyMap.cpp.

1106{
1108 "Local vector is not of correct dimension");
1109 ASSERTL1(global.size() >= m_numGlobalBndCoeffs - offset,
1110 "Global vector is not of correct dimension");
1111
1112 // offset input data by length "offset" for Dirichlet boundary conditions.
1113 Array<OneD, NekDouble> tmp(m_numGlobalBndCoeffs, 0.0);
1114
1115 if (m_signChange)
1116 {
1118 loc.get(), m_localToGlobalBndMap.get(), tmp.get());
1119 }
1120 else
1121 {
1123 m_localToGlobalBndMap.get(), tmp.get());
1124 }
1125
1126 // Ensure each processor has unique value with a max gather.
1127 if (UseComm)
1128 {
1130 }
1131 Vmath::Vcopy(m_numGlobalBndCoeffs - offset, tmp.get() + offset, 1,
1132 global.get(), 1);
1133}

References ASSERTL1, Gs::Gather(), Gs::gs_max, CG_Iterations::loc, m_bndGsh, m_localToGlobalBndMap, m_localToGlobalBndSign, m_numGlobalBndCoeffs, m_numLocalBndCoeffs, m_signChange, Vmath::Scatr(), and Vmath::Vcopy().

Referenced by Nektar::MultiRegions::AssemblyMapDG::v_LocalToGlobal().

◆ LocalBndToLocal()

void Nektar::MultiRegions::AssemblyMap::LocalBndToLocal ( const Array< OneD, const NekDouble > &  locbnd,
Array< OneD, NekDouble > &  local 
) const

Definition at line 1184 of file AssemblyMap.cpp.

1186{
1187 ASSERTL1(locbnd.size() >= m_numLocalBndCoeffs,
1188 "LocBnd vector is not of correct dimension");
1189 ASSERTL1(local.size() >= m_numLocalCoeffs,
1190 "Local vector is not of correct dimension");
1191
1193 local.get());
1194}

References ASSERTL1, m_localToLocalBndMap, m_numLocalBndCoeffs, m_numLocalCoeffs, and Vmath::Scatr().

◆ LocalIntToLocal()

void Nektar::MultiRegions::AssemblyMap::LocalIntToLocal ( const Array< OneD, const NekDouble > &  locbnd,
Array< OneD, NekDouble > &  local 
) const

Definition at line 1196 of file AssemblyMap.cpp.

1198{
1200 "LocBnd vector is not of correct dimension");
1201 ASSERTL1(local.size() >= m_numLocalCoeffs,
1202 "Local vector is not of correct dimension");
1203
1205 m_localToLocalIntMap.get(), local.get());
1206}

References ASSERTL1, m_localToLocalIntMap, m_numLocalBndCoeffs, m_numLocalCoeffs, and Vmath::Scatr().

◆ LocalToGlobal() [1/2]

void Nektar::MultiRegions::AssemblyMap::LocalToGlobal ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global,
bool  useComm = true 
) const

Definition at line 763 of file AssemblyMap.cpp.

766{
767 v_LocalToGlobal(loc, global, useComm);
768}
virtual void v_LocalToGlobal(const Array< OneD, const NekDouble > &loc, Array< OneD, NekDouble > &global, bool useComm) const

References CG_Iterations::loc, and v_LocalToGlobal().

Referenced by Nektar::MultiRegions::AssemblyMapCG::v_LocalToGlobal().

◆ LocalToGlobal() [2/2]

void Nektar::MultiRegions::AssemblyMap::LocalToGlobal ( const NekVector< NekDouble > &  loc,
NekVector< NekDouble > &  global,
bool  useComm = true 
) const

Definition at line 770 of file AssemblyMap.cpp.

773{
774 v_LocalToGlobal(loc, global, useComm);
775}

References CG_Iterations::loc, and v_LocalToGlobal().

◆ LocalToLocalBnd()

void Nektar::MultiRegions::AssemblyMap::LocalToLocalBnd ( const Array< OneD, const NekDouble > &  local,
Array< OneD, NekDouble > &  locbnd 
) const

Definition at line 1160 of file AssemblyMap.cpp.

1162{
1163 ASSERTL1(locbnd.size() >= m_numLocalBndCoeffs,
1164 "LocBnd vector is not of correct dimension");
1165 ASSERTL1(local.size() >= m_numLocalCoeffs,
1166 "Local vector is not of correct dimension");
1167
1169 locbnd.get());
1170}

References ASSERTL1, Vmath::Gathr(), m_localToLocalBndMap, m_numLocalBndCoeffs, and m_numLocalCoeffs.

◆ LocalToLocalInt()

void Nektar::MultiRegions::AssemblyMap::LocalToLocalInt ( const Array< OneD, const NekDouble > &  local,
Array< OneD, NekDouble > &  locint 
) const

Definition at line 1172 of file AssemblyMap.cpp.

1174{
1176 "Locint vector is not of correct dimension");
1177 ASSERTL1(local.size() >= m_numLocalCoeffs,
1178 "Local vector is not of correct dimension");
1179
1181 m_localToLocalIntMap.get(), locint.get());
1182}

References ASSERTL1, Vmath::Gathr(), m_localToLocalIntMap, m_numLocalBndCoeffs, and m_numLocalCoeffs.

◆ PatchAssemble()

void Nektar::MultiRegions::AssemblyMap::PatchAssemble ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global 
) const

Definition at line 857 of file AssemblyMap.cpp.

859{
860 Array<OneD, const NekDouble> local;
861 Array<OneD, const int> map = m_patchMapFromPrevLevel->GetNewLevelMap();
862 Array<OneD, const NekDouble> sign = m_patchMapFromPrevLevel->GetSign();
863
864 if (global.data() == loc.data())
865 {
866 local = Array<OneD, NekDouble>(map.size(), loc.data());
867 }
868 else
869 {
870 local = loc; // create reference
871 }
872
873 // since we are calling mapping from level down from array
874 // the m_numLocaBndCoeffs represents the size of the
875 // boundary elements we need to assemble into
876 Vmath::Zero(m_numLocalCoeffs, global.get(), 1);
877
878 Vmath::Assmb(map.size(), sign.get(), local.get(), map.get(), global.get());
879}

References Vmath::Assmb(), CG_Iterations::loc, m_numLocalCoeffs, m_patchMapFromPrevLevel, sign, and Vmath::Zero().

◆ PatchGlobalToLocal()

void Nektar::MultiRegions::AssemblyMap::PatchGlobalToLocal ( const Array< OneD, const NekDouble > &  global,
Array< OneD, NekDouble > &  loc 
) const

Definition at line 837 of file AssemblyMap.cpp.

839{
840 Array<OneD, const NekDouble> glo;
841
842 Array<OneD, const int> map = m_patchMapFromPrevLevel->GetNewLevelMap();
843 Array<OneD, const NekDouble> sign = m_patchMapFromPrevLevel->GetSign();
844
845 if (global.data() == loc.data())
846 {
847 glo = Array<OneD, NekDouble>(global.size(), global.data());
848 }
849 else
850 {
851 glo = global; // create reference
852 }
853
854 Vmath::Gathr(map.size(), sign.get(), glo.get(), map.get(), loc.get());
855}

References Vmath::Gathr(), CG_Iterations::loc, m_patchMapFromPrevLevel, and sign.

◆ PatchLocalToGlobal()

void Nektar::MultiRegions::AssemblyMap::PatchLocalToGlobal ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global 
) const

Definition at line 817 of file AssemblyMap.cpp.

819{
820 Array<OneD, const NekDouble> local;
821
822 Array<OneD, const int> map = m_patchMapFromPrevLevel->GetNewLevelMap();
823 Array<OneD, const NekDouble> sign = m_patchMapFromPrevLevel->GetSign();
824
825 if (global.data() == loc.data())
826 {
827 local = Array<OneD, NekDouble>(map.size(), loc.data());
828 }
829 else
830 {
831 local = loc; // create reference
832 }
833
834 Vmath::Scatr(map.size(), sign.get(), local.get(), map.get(), global.get());
835}

References CG_Iterations::loc, m_patchMapFromPrevLevel, Vmath::Scatr(), and sign.

◆ PrintStats()

void Nektar::MultiRegions::AssemblyMap::PrintStats ( std::ostream &  out,
std::string  variable,
bool  printHeader = true 
) const

Definition at line 1377 of file AssemblyMap.cpp.

1379{
1380 LibUtilities::CommSharedPtr vRowComm = m_session->GetComm()->GetRowComm();
1381 bool isRoot = m_session->GetComm()->IsParallelInTime()
1382 ? m_session->GetComm()->GetRank() == 0
1383 : vRowComm->GetRank() == 0;
1384 int n = vRowComm->GetSize();
1385 int i;
1386
1387 // Determine number of global degrees of freedom.
1388 int globBndCnt = 0, globDirCnt = 0;
1389
1390 for (i = 0; i < m_numGlobalBndCoeffs; ++i)
1391 {
1393 {
1394 globBndCnt++;
1395
1397 {
1398 globDirCnt++;
1399 }
1400 }
1401 }
1402
1403 int globCnt = m_numGlobalCoeffs - m_numGlobalBndCoeffs + globBndCnt;
1404
1405 // Calculate maximum valency
1406 Array<OneD, NekDouble> tmpLoc(m_numLocalBndCoeffs, 1.0);
1407 Array<OneD, NekDouble> tmpGlob(m_numGlobalBndCoeffs, 0.0);
1408
1410 tmpGlob.get());
1411 UniversalAssembleBnd(tmpGlob);
1412
1413 int totGlobDof = globCnt;
1414 int totGlobBndDof = globBndCnt;
1415 int totGlobDirDof = globDirCnt;
1416 int totLocalDof = m_numLocalCoeffs;
1417 int totLocalBndDof = m_numLocalBndCoeffs;
1418 int totLocalDirDof = m_numLocalDirBndCoeffs;
1419
1420 int meanValence = 0;
1421 int maxValence = 0;
1422 int minValence = 10000000;
1423 for (int i = 0; i < m_numGlobalBndCoeffs; ++i)
1424 {
1426 {
1427 continue;
1428 }
1429
1430 if (tmpGlob[i] > maxValence)
1431 {
1432 maxValence = tmpGlob[i];
1433 }
1434 if (tmpGlob[i] < minValence)
1435 {
1436 minValence = tmpGlob[i];
1437 }
1438 meanValence += tmpGlob[i];
1439 }
1440
1441 vRowComm->AllReduce(maxValence, LibUtilities::ReduceMax);
1442 vRowComm->AllReduce(minValence, LibUtilities::ReduceMin);
1443 vRowComm->AllReduce(meanValence, LibUtilities::ReduceSum);
1444 vRowComm->AllReduce(totGlobDof, LibUtilities::ReduceSum);
1445 vRowComm->AllReduce(totGlobBndDof, LibUtilities::ReduceSum);
1446 vRowComm->AllReduce(totGlobDirDof, LibUtilities::ReduceSum);
1447 vRowComm->AllReduce(totLocalDof, LibUtilities::ReduceSum);
1448 vRowComm->AllReduce(totLocalBndDof, LibUtilities::ReduceSum);
1449 vRowComm->AllReduce(totLocalDirDof, LibUtilities::ReduceSum);
1450
1451 meanValence /= totGlobBndDof;
1452
1453 if (isRoot)
1454 {
1455 if (printHeader)
1456 {
1457 out << "Assembly map statistics for field " << variable << ":"
1458 << endl;
1459 }
1460
1461 out << " - Number of local/global dof : " << totLocalDof
1462 << " " << totGlobDof << endl;
1463 out << " - Number of local/global boundary dof : " << totLocalBndDof
1464 << " " << totGlobBndDof << endl;
1465 out << " - Number of local/global Dirichlet dof : " << totLocalDirDof
1466 << " " << totGlobDirDof << endl;
1467 out << " - dof valency (min/max/mean) : " << minValence
1468 << " " << maxValence << " " << meanValence << endl;
1469
1470 if (n > 1)
1471 {
1472 NekDouble mean = m_numLocalCoeffs, mean2 = mean * mean;
1473 NekDouble minval = mean, maxval = mean;
1474 Array<OneD, NekDouble> tmp(1);
1475
1476 for (i = 1; i < n; ++i)
1477 {
1478 vRowComm->Recv(i, tmp);
1479 mean += tmp[0];
1480 mean2 += tmp[0] * tmp[0];
1481
1482 if (tmp[0] > maxval)
1483 {
1484 maxval = tmp[0];
1485 }
1486 if (tmp[0] < minval)
1487 {
1488 minval = tmp[0];
1489 }
1490 }
1491
1492 if (maxval > 0.1)
1493 {
1494 out << " - Local dof dist. (min/max/mean/dev) : " << minval
1495 << " " << maxval << " " << (mean / n) << " "
1496 << sqrt(mean2 / n - mean * mean / n / n) << endl;
1497 }
1498
1499 vRowComm->Block();
1500
1501 mean = minval = maxval = m_numLocalBndCoeffs;
1502 mean2 = mean * mean;
1503
1504 for (i = 1; i < n; ++i)
1505 {
1506 vRowComm->Recv(i, tmp);
1507 mean += tmp[0];
1508 mean2 += tmp[0] * tmp[0];
1509
1510 if (tmp[0] > maxval)
1511 {
1512 maxval = tmp[0];
1513 }
1514 if (tmp[0] < minval)
1515 {
1516 minval = tmp[0];
1517 }
1518 }
1519
1520 out << " - Local bnd dof dist. (min/max/mean/dev) : " << minval
1521 << " " << maxval << " " << (mean / n) << " "
1522 << sqrt(mean2 / n - mean * mean / n / n) << endl;
1523 }
1524 }
1525 else
1526 {
1527 Array<OneD, NekDouble> tmp(1);
1528 tmp[0] = m_numLocalCoeffs;
1529 vRowComm->Send(0, tmp);
1530 vRowComm->Block();
1531 tmp[0] = m_numLocalBndCoeffs;
1532 vRowComm->Send(0, tmp);
1533 }
1534
1535 // Either we have no more levels in the static condensation, or we
1536 // are not multi-level.
1538 {
1539 return;
1540 }
1541
1542 int level = 2;
1544 while (tmp->m_nextLevelLocalToGlobalMap)
1545 {
1546 tmp = tmp->m_nextLevelLocalToGlobalMap;
1547 ++level;
1548 }
1549
1550 // Print out multi-level static condensation information.
1551 if (n > 1)
1552 {
1553 if (isRoot)
1554 {
1555 NekDouble mean = level, mean2 = mean * mean;
1556 int minval = level, maxval = level;
1557
1558 Array<OneD, NekDouble> tmpRecv(1);
1559 for (i = 1; i < n; ++i)
1560 {
1561 vRowComm->Recv(i, tmpRecv);
1562 mean += tmpRecv[0];
1563 mean2 += tmpRecv[0] * tmpRecv[0];
1564
1565 if (tmpRecv[0] > maxval)
1566 {
1567 maxval = (int)(tmpRecv[0] + 0.5);
1568 }
1569 if (tmpRecv[0] < minval)
1570 {
1571 minval = (int)(tmpRecv[0] + 0.5);
1572 }
1573 }
1574
1575 out << " - M-level sc. dist. (min/max/mean/dev) : " << minval
1576 << " " << maxval << " " << (mean / n) << " "
1577 << sqrt(mean2 / n - mean * mean / n / n) << endl;
1578 }
1579 else
1580 {
1581 Array<OneD, NekDouble> tmpSend(1);
1582 tmpSend[0] = level;
1583 vRowComm->Send(0, tmpSend);
1584 }
1585 }
1586 else
1587 {
1588 if (isRoot)
1589 {
1590 out << " - Number of static cond. levels : " << level
1591 << endl;
1592 }
1593 }
1594
1595 if (isRoot)
1596 {
1597 out << "Stats at lowest static cond. level:" << endl;
1598 }
1599 tmp->PrintStats(out, variable, false);
1600}
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
Definition: AssemblyMap.h:50
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:294

References Vmath::Assmb(), CellMLToNektar.pycml::level, m_globalToUniversalBndMapUnique, m_localToGlobalBndMap, m_nextLevelLocalToGlobalMap, m_numGlobalBndCoeffs, m_numGlobalCoeffs, m_numGlobalDirBndCoeffs, m_numLocalBndCoeffs, m_numLocalCoeffs, m_numLocalDirBndCoeffs, m_session, Nektar::LibUtilities::ReduceMax, Nektar::LibUtilities::ReduceMin, Nektar::LibUtilities::ReduceSum, tinysimd::sqrt(), and UniversalAssembleBnd().

◆ SetNextLevelLocalToGlobalMap()

void Nektar::MultiRegions::AssemblyMap::SetNextLevelLocalToGlobalMap ( AssemblyMapSharedPtr  pNextLevelLocalToGlobalMap)

◆ UniversalAbsMaxBnd()

void Nektar::MultiRegions::AssemblyMap::UniversalAbsMaxBnd ( Array< OneD, NekDouble > &  bndvals)

Definition at line 1293 of file AssemblyMap.cpp.

1294{
1296}
Gs::gs_data * m_dirBndGsh
gs gather communication to impose Dirhichlet BCs.
Definition: AssemblyMap.h:419
@ gs_amax
Definition: GsLib.hpp:64

References Gs::Gather(), Gs::gs_amax, and m_dirBndGsh.

◆ UniversalAssemble() [1/3]

void Nektar::MultiRegions::AssemblyMap::UniversalAssemble ( Array< OneD, NekDouble > &  pGlobal) const

◆ UniversalAssemble() [2/3]

void Nektar::MultiRegions::AssemblyMap::UniversalAssemble ( Array< OneD, NekDouble > &  pGlobal,
int  offset 
) const

Definition at line 811 of file AssemblyMap.cpp.

813{
814 v_UniversalAssemble(pGlobal, offset);
815}

References v_UniversalAssemble().

◆ UniversalAssemble() [3/3]

void Nektar::MultiRegions::AssemblyMap::UniversalAssemble ( NekVector< NekDouble > &  pGlobal) const

Definition at line 806 of file AssemblyMap.cpp.

807{
808 v_UniversalAssemble(pGlobal);
809}

References v_UniversalAssemble().

◆ UniversalAssembleBnd() [1/3]

void Nektar::MultiRegions::AssemblyMap::UniversalAssembleBnd ( Array< OneD, NekDouble > &  pGlobal) const

Definition at line 1267 of file AssemblyMap.cpp.

1268{
1269 ASSERTL1(pGlobal.size() >= m_numGlobalBndCoeffs, "Wrong size.");
1270 Gs::Gather(pGlobal, Gs::gs_add, m_bndGsh);
1271}
@ gs_add
Definition: GsLib.hpp:60

References ASSERTL1, Gs::Gather(), Gs::gs_add, m_bndGsh, and m_numGlobalBndCoeffs.

Referenced by AssembleBnd(), PrintStats(), and UniversalAssembleBnd().

◆ UniversalAssembleBnd() [2/3]

void Nektar::MultiRegions::AssemblyMap::UniversalAssembleBnd ( Array< OneD, NekDouble > &  pGlobal,
int  offset 
) const

Definition at line 1278 of file AssemblyMap.cpp.

1280{
1281 Array<OneD, NekDouble> tmp(offset);
1282 if (offset > 0)
1283 {
1284 Vmath::Vcopy(offset, pGlobal, 1, tmp, 1);
1285 }
1286 UniversalAssembleBnd(pGlobal);
1287 if (offset > 0)
1288 {
1289 Vmath::Vcopy(offset, tmp, 1, pGlobal, 1);
1290 }
1291}

References UniversalAssembleBnd(), and Vmath::Vcopy().

◆ UniversalAssembleBnd() [3/3]

void Nektar::MultiRegions::AssemblyMap::UniversalAssembleBnd ( NekVector< NekDouble > &  pGlobal) const

Definition at line 1273 of file AssemblyMap.cpp.

1274{
1275 UniversalAssembleBnd(pGlobal.GetPtr());
1276}

References Nektar::NekVector< DataType >::GetPtr(), and UniversalAssembleBnd().

◆ v_Assemble() [1/2]

void Nektar::MultiRegions::AssemblyMap::v_Assemble ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global 
) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 608 of file AssemblyMap.cpp.

611{
612 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
613}
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by Assemble().

◆ v_Assemble() [2/2]

void Nektar::MultiRegions::AssemblyMap::v_Assemble ( const NekVector< NekDouble > &  loc,
NekVector< NekDouble > &  global 
) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 615 of file AssemblyMap.cpp.

618{
619 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
620}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_GetExtraDirEdges()

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::v_GetExtraDirEdges ( )
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 692 of file AssemblyMap.cpp.

693{
694 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
695 static Array<OneD, const int> result;
696 return result;
697}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetExtraDirEdges().

◆ v_GetFullSystemBandWidth()

int Nektar::MultiRegions::AssemblyMap::v_GetFullSystemBandWidth ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 644 of file AssemblyMap.cpp.

645{
646 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
647 return 0;
648}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetFullSystemBandWidth().

◆ v_GetGlobalToUniversalMap() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::v_GetGlobalToUniversalMap ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 550 of file AssemblyMap.cpp.

551{
552 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
553 static Array<OneD, const int> result;
554 return result;
555}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetGlobalToUniversalMap().

◆ v_GetGlobalToUniversalMap() [2/2]

int Nektar::MultiRegions::AssemblyMap::v_GetGlobalToUniversalMap ( const int  i) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 530 of file AssemblyMap.cpp.

531{
532 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
533 return 0;
534}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_GetGlobalToUniversalMapUnique() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::v_GetGlobalToUniversalMapUnique ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 557 of file AssemblyMap.cpp.

558{
559 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
560 static Array<OneD, const int> result;
561 return result;
562}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetGlobalToUniversalMapUnique().

◆ v_GetGlobalToUniversalMapUnique() [2/2]

int Nektar::MultiRegions::AssemblyMap::v_GetGlobalToUniversalMapUnique ( const int  i) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 536 of file AssemblyMap.cpp.

538{
539 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
540 return 0;
541}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_GetLocalToGlobalMap() [1/2]

const Array< OneD, const int > & Nektar::MultiRegions::AssemblyMap::v_GetLocalToGlobalMap ( void  )
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 543 of file AssemblyMap.cpp.

544{
545 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
546 static Array<OneD, const int> result;
547 return result;
548}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetLocalToGlobalMap().

◆ v_GetLocalToGlobalMap() [2/2]

int Nektar::MultiRegions::AssemblyMap::v_GetLocalToGlobalMap ( const int  i) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 524 of file AssemblyMap.cpp.

525{
526 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
527 return 0;
528}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_GetLocalToGlobalSign() [1/2]

const Array< OneD, NekDouble > & Nektar::MultiRegions::AssemblyMap::v_GetLocalToGlobalSign ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 571 of file AssemblyMap.cpp.

572{
573 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
574 static Array<OneD, NekDouble> result;
575 return result;
576}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetLocalToGlobalSign().

◆ v_GetLocalToGlobalSign() [2/2]

NekDouble Nektar::MultiRegions::AssemblyMap::v_GetLocalToGlobalSign ( const int  i) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 564 of file AssemblyMap.cpp.

566{
567 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
568 return 0.0;
569}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_GetNumDirEdges()

int Nektar::MultiRegions::AssemblyMap::v_GetNumDirEdges ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 668 of file AssemblyMap.cpp.

669{
670 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
671 return 0;
672}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNumDirEdges().

◆ v_GetNumDirFaces()

int Nektar::MultiRegions::AssemblyMap::v_GetNumDirFaces ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 674 of file AssemblyMap.cpp.

675{
676 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
677 return 0;
678}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNumDirFaces().

◆ v_GetNumNonDirEdgeModes()

int Nektar::MultiRegions::AssemblyMap::v_GetNumNonDirEdgeModes ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 656 of file AssemblyMap.cpp.

657{
658 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
659 return 0;
660}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNumNonDirEdgeModes().

◆ v_GetNumNonDirEdges()

int Nektar::MultiRegions::AssemblyMap::v_GetNumNonDirEdges ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 680 of file AssemblyMap.cpp.

681{
682 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
683 return 0;
684}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNumNonDirEdges().

◆ v_GetNumNonDirFaceModes()

int Nektar::MultiRegions::AssemblyMap::v_GetNumNonDirFaceModes ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 662 of file AssemblyMap.cpp.

663{
664 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
665 return 0;
666}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNumNonDirFaceModes().

◆ v_GetNumNonDirFaces()

int Nektar::MultiRegions::AssemblyMap::v_GetNumNonDirFaces ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 686 of file AssemblyMap.cpp.

687{
688 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
689 return 0;
690}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNumNonDirFaces().

◆ v_GetNumNonDirVertexModes()

int Nektar::MultiRegions::AssemblyMap::v_GetNumNonDirVertexModes ( ) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 650 of file AssemblyMap.cpp.

651{
652 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
653 return 0;
654}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GetNumNonDirVertexModes().

◆ v_GlobalToLocal() [1/2]

void Nektar::MultiRegions::AssemblyMap::v_GlobalToLocal ( const Array< OneD, const NekDouble > &  global,
Array< OneD, NekDouble > &  loc 
) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 594 of file AssemblyMap.cpp.

597{
598 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
599}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by GlobalToLocal().

◆ v_GlobalToLocal() [2/2]

void Nektar::MultiRegions::AssemblyMap::v_GlobalToLocal ( const NekVector< NekDouble > &  global,
NekVector< NekDouble > &  loc 
) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 601 of file AssemblyMap.cpp.

604{
605 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
606}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_LinearSpaceMap()

std::shared_ptr< AssemblyMap > Nektar::MultiRegions::AssemblyMap::v_LinearSpaceMap ( const ExpList locexp,
GlobalSysSolnType  solnType 
)
protectedvirtual

Generate a linear space mapping from existing mapping.

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 699 of file AssemblyMap.cpp.

702{
703 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
704 static std::shared_ptr<AssemblyMap> result;
705 return result;
706}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by LinearSpaceMap().

◆ v_LocalToGlobal() [1/2]

void Nektar::MultiRegions::AssemblyMap::v_LocalToGlobal ( const Array< OneD, const NekDouble > &  loc,
Array< OneD, NekDouble > &  global,
bool  useComm 
) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 578 of file AssemblyMap.cpp.

582{
583 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
584}

References Nektar::ErrorUtil::efatal, and NEKERROR.

Referenced by LocalToGlobal().

◆ v_LocalToGlobal() [2/2]

void Nektar::MultiRegions::AssemblyMap::v_LocalToGlobal ( const NekVector< NekDouble > &  loc,
NekVector< NekDouble > &  global,
bool  useComm 
) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 586 of file AssemblyMap.cpp.

590{
591 NEKERROR(ErrorUtil::efatal, "Not defined for this type of mapping.");
592}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_UniversalAssemble() [1/3]

void Nektar::MultiRegions::AssemblyMap::v_UniversalAssemble ( Array< OneD, NekDouble > &  pGlobal) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 622 of file AssemblyMap.cpp.

624{
625 // Do nothing here since multi-level static condensation uses a
626 // AssemblyMap and thus will call this routine in serial.
627}

Referenced by UniversalAssemble().

◆ v_UniversalAssemble() [2/3]

void Nektar::MultiRegions::AssemblyMap::v_UniversalAssemble ( Array< OneD, NekDouble > &  pGlobal,
int  offset 
) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG.

Definition at line 636 of file AssemblyMap.cpp.

639{
640 // Do nothing here since multi-level static condensation uses a
641 // AssemblyMap and thus will call this routine in serial.
642}

◆ v_UniversalAssemble() [3/3]

void Nektar::MultiRegions::AssemblyMap::v_UniversalAssemble ( NekVector< NekDouble > &  pGlobal) const
protectedvirtual

Reimplemented in Nektar::MultiRegions::AssemblyMapCG, and Nektar::MultiRegions::AssemblyMapDG.

Definition at line 629 of file AssemblyMap.cpp.

631{
632 // Do nothing here since multi-level static condensation uses a
633 // AssemblyMap and thus will call this routine in serial.
634}

Member Data Documentation

◆ m_bndCondCoeffsToLocalCoeffsMap

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_bndCondCoeffsToLocalCoeffsMap
protected

Integer map of bnd cond coeffs to local coefficients.

Definition at line 386 of file AssemblyMap.h.

Referenced by Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), and GetBndCondCoeffsToLocalCoeffsMap().

◆ m_bndCondCoeffsToLocalCoeffsSign

Array<OneD, NekDouble> Nektar::MultiRegions::AssemblyMap::m_bndCondCoeffsToLocalCoeffsSign
protected

Integer map of sign of bnd cond coeffs to local coefficients.

Definition at line 388 of file AssemblyMap.h.

Referenced by Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), and GetBndCondCoeffsToLocalCoeffsSign().

◆ m_bndCondCoeffsToLocalTraceMap

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_bndCondCoeffsToLocalTraceMap
protected

Integer map of bnd cond coeff to local trace coeff.

Definition at line 390 of file AssemblyMap.h.

Referenced by Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), and GetBndCondCoeffsToLocalTraceMap().

◆ m_bndCondIDToGlobalTraceID

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_bndCondIDToGlobalTraceID
protected

Integer map of bnd cond trace number to global trace number.

Definition at line 392 of file AssemblyMap.h.

Referenced by Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), Nektar::CoupledLocalToGlobalC0ContMap::CoupledLocalToGlobalC0ContMap(), and GetBndCondIDToGlobalTraceID().

◆ m_bndGsh

Gs::gs_data* Nektar::MultiRegions::AssemblyMap::m_bndGsh
protected

◆ m_bndSystemBandWidth

int Nektar::MultiRegions::AssemblyMap::m_bndSystemBandWidth
protected

The bandwith of the global bnd system.

Definition at line 401 of file AssemblyMap.h.

Referenced by CalculateBndSystemBandWidth(), and GetBndSystemBandWidth().

◆ m_comm

LibUtilities::CommSharedPtr Nektar::MultiRegions::AssemblyMap::m_comm
protected

◆ m_dirBndGsh

Gs::gs_data* Nektar::MultiRegions::AssemblyMap::m_dirBndGsh
protected

gs gather communication to impose Dirhichlet BCs.

Definition at line 419 of file AssemblyMap.h.

Referenced by Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), and UniversalAbsMaxBnd().

◆ m_globalToUniversalBndMap

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_globalToUniversalBndMap
protected

◆ m_globalToUniversalBndMapUnique

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_globalToUniversalBndMapUnique
protected

◆ m_gsh

Gs::gs_data* Nektar::MultiRegions::AssemblyMap::m_gsh
protected

◆ m_hash

size_t Nektar::MultiRegions::AssemblyMap::m_hash
protected

◆ m_isAbsoluteTolerance

bool Nektar::MultiRegions::AssemblyMap::m_isAbsoluteTolerance
protected

Definition at line 408 of file AssemblyMap.h.

Referenced by AssemblyMap(), and IsAbsoluteTolerance().

◆ m_iterativeTolerance

NekDouble Nektar::MultiRegions::AssemblyMap::m_iterativeTolerance
protected

Tolerance for iterative solver.

Definition at line 407 of file AssemblyMap.h.

◆ m_linSysIterSolver

std::string Nektar::MultiRegions::AssemblyMap::m_linSysIterSolver
protected

Iterative solver: Conjugate Gradient, GMRES.

Definition at line 414 of file AssemblyMap.h.

Referenced by AssemblyMap(), and GetLinSysIterSolver().

◆ m_localToGlobalBndMap

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_localToGlobalBndMap
protected

◆ m_localToGlobalBndSign

Array<OneD, NekDouble> Nektar::MultiRegions::AssemblyMap::m_localToGlobalBndSign
protected

◆ m_localToLocalBndMap

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_localToLocalBndMap
protected

◆ m_localToLocalIntMap

Array<OneD, int> Nektar::MultiRegions::AssemblyMap::m_localToLocalIntMap
protected

◆ m_lowestStaticCondLevel

int Nektar::MultiRegions::AssemblyMap::m_lowestStaticCondLevel
protected

◆ m_nextLevelLocalToGlobalMap

AssemblyMapSharedPtr Nektar::MultiRegions::AssemblyMap::m_nextLevelLocalToGlobalMap
protected

Map from the patches of the previous level to the patches of the current level.

The local to global mapping of the next level of recursion

Definition at line 434 of file AssemblyMap.h.

Referenced by AssemblyMap(), Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), AtLastLevel(), Nektar::CoupledLocalToGlobalC0ContMap::CoupledLocalToGlobalC0ContMap(), GetNextLevelLocalToGlobalMap(), and PrintStats().

◆ m_numGlobalBndCoeffs

int Nektar::MultiRegions::AssemblyMap::m_numGlobalBndCoeffs
protected

◆ m_numGlobalCoeffs

int Nektar::MultiRegions::AssemblyMap::m_numGlobalCoeffs
protected

Total number of global coefficients.

This corresponds to the number of total number of coefficients

  • For CG this corresponds to the total of bnd + int DOFs.
  • For DG this corresponds to the number of bnd DOFs. This means that m_numGlobalCoeffs = m_numGlobalBndCoeffs This way, we can consider the trace-system solve as a statically condensed solve without interior DOFs. This allows us to use the same global system solver for both cases.

Definition at line 372 of file AssemblyMap.h.

Referenced by AssemblyMap(), Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), Nektar::CoupledAssemblyMap::CoupledAssemblyMap(), Nektar::CoupledLocalToGlobalC0ContMap::CoupledLocalToGlobalC0ContMap(), GetNumGlobalCoeffs(), PrintStats(), Nektar::MultiRegions::AssemblyMapCG::SetUpUniversalC0ContMap(), Nektar::MultiRegions::AssemblyMapCG::v_Assemble(), Nektar::MultiRegions::AssemblyMapCG::v_GlobalToLocal(), and Nektar::MultiRegions::AssemblyMapCG::v_LinearSpaceMap().

◆ m_numGlobalDirBndCoeffs

int Nektar::MultiRegions::AssemblyMap::m_numGlobalDirBndCoeffs
protected

◆ m_numLocalBndCoeffs

int Nektar::MultiRegions::AssemblyMap::m_numLocalBndCoeffs
protected

◆ m_numLocalBndCoeffsPerPatch

Array<OneD, unsigned int> Nektar::MultiRegions::AssemblyMap::m_numLocalBndCoeffsPerPatch
protected

◆ m_numLocalCoeffs

int Nektar::MultiRegions::AssemblyMap::m_numLocalCoeffs
protected

Total number of local coefficients.

This corresponds to the number of total number of coefficients

  • For CG this corresponds to the total of bnd + int DOFs
  • For DG this corresponds to the number of bnd DOFs. This means that m_numLocalCoeffs = m_numLocalBndCoeffs This way, we can consider the trace-system solve as a statically condensed solve without interior DOFs. This allows us to use the same global system solver for both cases.

Definition at line 361 of file AssemblyMap.h.

Referenced by AssemblyMap(), Nektar::MultiRegions::AssemblyMapCG::AssemblyMapCG(), Nektar::MultiRegions::AssemblyMapDG::AssemblyMapDG(), Nektar::MultiRegions::AssemblyMapCG::CalculateFullSystemBandWidth(), Nektar::CoupledAssemblyMap::CoupledAssemblyMap(), Nektar::CoupledLocalToGlobalC0ContMap::CoupledLocalToGlobalC0ContMap(), GetNumLocalCoeffs(), LocalBndToLocal(), LocalIntToLocal(), LocalToLocalBnd(), LocalToLocalInt(), PatchAssemble(), PrintStats(), Nektar::MultiRegions::AssemblyMapCG::v_Assemble(), Nektar::MultiRegions::AssemblyMapCG::v_GlobalToLocal(), and Nektar::MultiRegions::AssemblyMapCG::v_LocalToGlobal().

◆ m_numLocalDirBndCoeffs

int Nektar::MultiRegions::AssemblyMap::m_numLocalDirBndCoeffs
protected

◆ m_numLocalIntCoeffsPerPatch

Array<OneD, unsigned int> Nektar::MultiRegions::AssemblyMap::m_numLocalIntCoeffsPerPatch
protected

◆ m_numPatches

int Nektar::MultiRegions::AssemblyMap::m_numPatches
protected

◆ m_patchMapFromPrevLevel

PatchMapSharedPtr Nektar::MultiRegions::AssemblyMap::m_patchMapFromPrevLevel
private

Mapping information for previous level in MultiLevel Solver.

Definition at line 511 of file AssemblyMap.h.

Referenced by AssemblyMap(), GetPatchMapFromPrevLevel(), PatchAssemble(), PatchGlobalToLocal(), and PatchLocalToGlobal().

◆ m_preconType

std::string Nektar::MultiRegions::AssemblyMap::m_preconType
protected

Type type of preconditioner to use in iterative solver.

Definition at line 404 of file AssemblyMap.h.

Referenced by AssemblyMap(), and GetPreconType().

◆ m_session

LibUtilities::SessionReaderSharedPtr Nektar::MultiRegions::AssemblyMap::m_session
protected

◆ m_signChange

bool Nektar::MultiRegions::AssemblyMap::m_signChange
protected

◆ m_solnType

GlobalSysSolnType Nektar::MultiRegions::AssemblyMap::m_solnType
protected

◆ m_staticCondLevel

int Nektar::MultiRegions::AssemblyMap::m_staticCondLevel
protected

◆ m_successiveRHS

int Nektar::MultiRegions::AssemblyMap::m_successiveRHS
protected

sucessive RHS for iterative solver

Definition at line 411 of file AssemblyMap.h.

Referenced by AssemblyMap(), and GetSuccessiveRHS().

◆ m_systemSingular

bool Nektar::MultiRegions::AssemblyMap::m_systemSingular
protected

◆ m_variable

std::string Nektar::MultiRegions::AssemblyMap::m_variable
protected

Variable string identifier.

Definition at line 336 of file AssemblyMap.h.

Referenced by GetVariable().