44 namespace MultiRegions
53 string GlobalLinSysXxtFull::className
56 GlobalLinSysXxtFull::create,
61 GlobalLinSysXxtFull::GlobalLinSysXxtFull(
63 const boost::weak_ptr<ExpList> &pExp,
64 const boost::shared_ptr<AssemblyMap>
71 "This routine should only be used when using a Full XXT"
94 bool dirForcCalculated = (bool) pDirForcing.num_elements();
95 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
96 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
105 if(dirForcCalculated)
108 pDirForcing.get(), 1,
127 tmp, tmp2, pLocToGloMap);
138 tmp,tmp2, pLocToGloMap);
144 tmp2 + nDirDofs, 1, tmp3, 1, tmp3, 1);
154 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
157 = pLocToGloMap->GetLocalToGlobalMap();
158 unsigned int nGlo = pLocToGloMap->GetNumGlobalCoeffs();
159 unsigned int nEntries = pLocToGloMap->GetNumLocalCoeffs();
164 for (i = 0; i < nEntries; ++i)
166 vCounts[vMap[i]] += 1.0;
170 pLocToGloMap->UniversalAssemble(vCounts);
174 for (i = 0; i < nEntries; ++i)
179 m_map = pLocToGloMap->GetLocalToGlobalMap();
189 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
192 unsigned int nElmt = vExp->GetNumElmts();
194 unsigned int iCount = 0;
195 unsigned int rCount = 0;
196 unsigned int nRows = 0;
197 unsigned int nEntries = 0;
198 unsigned int numDirBnd = pLocToGloMap->GetNumGlobalDirBndCoeffs();
199 unsigned int nLocal = pLocToGloMap->GetNumLocalCoeffs();
201 = pLocToGloMap->GetLocalToGlobalSign();
202 bool doSign = pLocToGloMap->GetSignChange();
203 unsigned int i = 0, j = 0, k = 0, n = 0;
214 for (n = 0; n < nElmt; ++n)
216 i = vExp->GetOffset_Elmt_Id(n);
217 vSizes[n] = vExp->GetExp(i)->GetNverts();
218 nEntries += vSizes[n]*vSizes[n];
223 for (n = 0; n < nElmt; ++n)
225 i = vExp->GetOffset_Elmt_Id(n);
226 vSizes[n] = vExp->GetExp(i)->GetNcoeffs();
227 nEntries += vSizes[n]*vSizes[n];
241 for(n = iCount = 0; n < nElmt; ++n)
243 loc_mat =
GetBlock(vExp->GetOffset_Elmt_Id(n));
244 nRows = loc_mat->GetRows();
246 for(i = 0; i < nRows; ++i)
248 gid1 = pLocToGloMap->GetLocalToGlobalMap(iCount + i);
249 for(j = 0; j < nRows; ++j)
251 k = rCount + i*vSizes[n] + j;
252 m_Ai[k] = iCount + i;
253 m_Aj[k] = iCount + j;
254 m_Ar[k] = (*loc_mat)(i,j);
257 m_Ar[k] *= vMapSign[iCount+i]*vMapSign[iCount+j];
263 if (gid1 < numDirBnd)
270 = pLocToGloMap->GetGlobalToUniversalMap(gid1);
274 rCount += vSizes[n]*vSizes[n];
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
boost::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
void CreateMap(const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
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.
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...
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
DNekScalMatSharedPtr GetBlock(unsigned int n)
virtual ~GlobalLinSysXxtFull()
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
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.
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
const GlobalLinSysKey m_linSysKey
Key associated with this linear system.
void AssembleMatrixArrays(const boost::shared_ptr< AssemblyMap > &pLocToGloMap)
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
Array< OneD, unsigned int > m_Ai
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 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
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
const boost::weak_ptr< ExpList > m_expList
Local Matrix System.