43 namespace MultiRegions
52 string GlobalLinSysXxtFull::className
55 GlobalLinSysXxtFull::create,
60 GlobalLinSysXxtFull::GlobalLinSysXxtFull(
62 const std::weak_ptr<ExpList> &pExp,
63 const std::shared_ptr<AssemblyMap>
70 "This routine should only be used when using a Full XXT" 93 bool dirForcCalculated = (bool) pDirForcing.num_elements();
94 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
95 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
104 if(dirForcCalculated)
107 pDirForcing.get(), 1,
126 tmp, tmp2, pLocToGloMap);
137 tmp,tmp2, pLocToGloMap);
143 tmp2 + nDirDofs, 1, tmp3, 1, tmp3, 1);
153 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
156 = pLocToGloMap->GetLocalToGlobalMap();
157 unsigned int nGlo = pLocToGloMap->GetNumGlobalCoeffs();
158 unsigned int nEntries = pLocToGloMap->GetNumLocalCoeffs();
163 for (i = 0; i < nEntries; ++i)
165 vCounts[vMap[i]] += 1.0;
169 pLocToGloMap->UniversalAssemble(vCounts);
173 for (i = 0; i < nEntries; ++i)
178 m_map = pLocToGloMap->GetLocalToGlobalMap();
188 const std::shared_ptr<AssemblyMap> &pLocToGloMap)
191 unsigned int nElmt = vExp->GetNumElmts();
193 unsigned int iCount = 0;
194 unsigned int rCount = 0;
195 unsigned int nRows = 0;
196 unsigned int nEntries = 0;
197 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
198 unsigned int nLocal = pLocToGloMap->GetNumLocalCoeffs();
200 = pLocToGloMap->GetLocalToGlobalSign();
201 bool doSign = pLocToGloMap->GetSignChange();
202 unsigned int i = 0, j = 0, k = 0, n = 0;
213 for (n = 0; n < nElmt; ++n)
215 vSizes[n] = vExp->GetExp(n)->GetNverts();
216 nEntries += vSizes[n]*vSizes[n];
221 for (n = 0; n < nElmt; ++n)
223 vSizes[n] = vExp->GetExp(n)->GetNcoeffs();
224 nEntries += vSizes[n]*vSizes[n];
238 for(n = iCount = 0; n < nElmt; ++n)
241 nRows = loc_mat->GetRows();
243 for(i = 0; i < nRows; ++i)
245 gid1 = pLocToGloMap->GetLocalToGlobalMap(iCount + i);
246 for(j = 0; j < nRows; ++j)
248 k = rCount + i*vSizes[n] + j;
249 m_Ai[k] = iCount + i;
250 m_Aj[k] = iCount + j;
251 m_Ar[k] = (*loc_mat)(i,j);
254 m_Ar[k] *= vMapSign[iCount+i]*vMapSign[iCount+j];
260 if (gid1 < numDirBnd)
267 = pLocToGloMap->GetGlobalToUniversalMap(gid1);
271 rCount += vSizes[n]*vSizes[n];
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
Array< OneD, double > m_Ar
void SolveLinearSystem(const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const AssemblyMapSharedPtr &locToGloMap, const int pNumDir=0)
Solve the linear system for given input and output vectors.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
virtual void v_Solve(const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out, const AssemblyMapSharedPtr &locToGloMap, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
Solve the linear system for given input and output vectors using a specified local to global map...
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
DNekScalMatSharedPtr GetBlock(unsigned int n)
virtual ~GlobalLinSysXxtFull()
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
void AssembleMatrixArrays(const std::shared_ptr< AssemblyMap > &pLocToGloMap)
Describe a linear system.
static struct crs_data * Init(unsigned int pRank, const Nektar::Array< OneD, unsigned long > pId, const Nektar::Array< OneD, unsigned int > pAi, const Nektar::Array< OneD, unsigned int > pAj, const Nektar::Array< OneD, NekDouble > pAr, const LibUtilities::CommSharedPtr &pComm)
Initialise the matrix-solve.
const GlobalLinSysKey m_linSysKey
Key associated with this linear system.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Array< OneD, unsigned int > m_Aj
const std::weak_ptr< ExpList > m_expList
Local Matrix System.
Array< OneD, unsigned int > m_Ai
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
GlobalLinSysFactory & GetGlobalLinSysFactory()
void nektar_crs_stats(struct crs_data *data)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
struct Xxt::crs_data * m_crsData
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void CreateMap(const std::shared_ptr< AssemblyMap > &pLocToGloMap)
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Array< OneD, NekDouble > m_locToGloSignMult