42 namespace MultiRegions
59 "Iterative solver for full matrix system.");
71 const boost::weak_ptr<ExpList> &pExp,
72 const boost::shared_ptr<AssemblyMap> &pLocToGloMap)
77 "This routine should only be used when using an Iterative "
78 "conjugate gradient matrix solve.");
110 const Array<OneD, const NekDouble> &pInput,
111 Array<OneD, NekDouble> &pOutput,
113 const Array<OneD, const NekDouble> &pDirForcing)
115 boost::shared_ptr<MultiRegions::ExpList> expList =
m_expList.lock();
117 if ((
m_locToGloMap = boost::dynamic_pointer_cast<AssemblyMapCG>(
128 bool dirForcCalculated = (bool) pDirForcing.num_elements();
129 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
130 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
131 int nDirTotal = nDirDofs;
135 Array<OneD, NekDouble> tmp(nGlobDofs), tmp2;
140 if(dirForcCalculated)
143 pDirForcing.get(), 1,
150 expList->GeneralMatrixOp(
159 Array<OneD, NekDouble> out(nGlobDofs,0.0);
163 nGlobDofs, tmp, out, pLocToGloMap, nDirDofs);
164 Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
165 &pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);
169 ASSERTL0(
false,
"Need DG solve if using Dir BCs");
184 const Array<OneD, NekDouble>& pInput,
185 Array<OneD, NekDouble>& pOutput)
187 boost::shared_ptr<MultiRegions::ExpList> expList =
m_expList.lock();
194 const std::map<int, RobinBCInfoSharedPtr> vRobinBCInfo
195 = expList->GetRobinBCInfo();
196 if(vRobinBCInfo.size() > 0)
199 "Robin boundaries not set up in IterativeFull solver.");
203 int nNonDir = nGlobal - nDir;
204 Array<OneD, NekDouble> robin_A(nGlobal, 0.0);
205 Array<OneD, NekDouble> robin_l(nLocal, 0.0);
206 Array<OneD, NekDouble> tmp;
216 for (
int n = 0; n < expList->GetNumElmts(); ++n)
218 int nel = expList->GetOffset_Elmt_Id(n);
219 int offset = expList->GetCoeff_Offset(n);
220 int ncoeffs = expList->GetExp(nel)->GetNcoeffs();
222 if(vRobinBCInfo.count(nel) != 0)
225 Array<OneD, NekDouble> tmp;
229 for(rBC = vRobinBCInfo.find(nel)->second;rBC; rBC = rBC->next)
231 vExp->AddRobinEdgeContribution(rBC->m_robinID,rBC->m_robinPrimitiveCoeffs, tmp = robin_l + offset);
243 Vmath::Vadd(nGlobal, pOutput, 1, robin_A, 1, pOutput, 1);