43 namespace MultiRegions
73 string GlobalLinSysDirectFull::className
76 GlobalLinSysDirectFull::create,
81 GlobalLinSysDirectFull::GlobalLinSysDirectFull(
83 const boost::weak_ptr<ExpList> &pExp,
84 const boost::shared_ptr<AssemblyMap>
91 "This routine should only be used when using a Full Direct"
93 ASSERTL1(pExp.lock()->GetComm()->GetSize() == 1,
94 "Direct full matrix solve can only be used in serial.");
115 bool dirForcCalculated = (bool) pDirForcing.num_elements();
116 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
117 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
123 if(dirForcCalculated)
127 pDirForcing.get(), 1,
144 Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
145 &pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);
162 int i,j,n,cnt,gid1,gid2;
164 int totDofs = pLocToGloMap->GetNumGlobalCoeffs();
165 int NumDirBCs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
167 unsigned int rows = totDofs - NumDirBCs;
168 unsigned int cols = totDofs - NumDirBCs;
172 int bwidth = pLocToGloMap->GetFullSystemBandWidth();
183 if( (2*(bwidth+1)) < rows)
220 for(n = cnt = 0; n <
m_expList.lock()->GetNumElmts(); ++n)
223 loc_lda = loc_mat->GetRows();
225 for(i = 0; i < loc_lda; ++i)
227 gid1 = pLocToGloMap->GetLocalToGlobalMap(cnt + i)-NumDirBCs;
228 sign1 = pLocToGloMap->GetLocalToGlobalSign(cnt + i);
231 for(j = 0; j < loc_lda; ++j)
233 gid2 = pLocToGloMap->GetLocalToGlobalMap(cnt + j)
235 sign2 = pLocToGloMap->GetLocalToGlobalSign(cnt + j);
242 if((matStorage ==
eFULL)||(gid2 >= gid1))
244 value = Gmat->GetValue(gid1,gid2)
245 + sign1*sign2*(*loc_mat)(i,j);
246 Gmat->SetValue(gid1,gid2,value);
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
boost::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
DNekLinSysSharedPtr m_linSys
Basic linear system object.
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.
boost::shared_ptr< DNekMat > DNekMatSharedPtr
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
virtual ~GlobalLinSysDirectFull()
DNekScalMatSharedPtr GetBlock(unsigned int n)
Describe a linear system.
PointerWrapper
Specifies if the pointer passed to a NekMatrix or NekVector is copied into an internal representation...
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
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.
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...
void AssembleFullMatrix(const boost::shared_ptr< AssemblyMap > &locToGloMap)
GlobalLinSysFactory & GetGlobalLinSysFactory()
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.
const boost::weak_ptr< ExpList > m_expList
Local Matrix System.