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>(
129 ASSERTL0(
false,
"Unknown map type");
132 bool dirForcCalculated = (bool) pDirForcing.num_elements();
133 int nDirDofs = pLocToGloMap->GetNumGlobalDirBndCoeffs();
134 int nGlobDofs = pLocToGloMap->GetNumGlobalCoeffs();
135 int nDirTotal = nDirDofs;
139 Array<OneD, NekDouble> tmp(nGlobDofs), tmp2;
144 if(dirForcCalculated)
147 pDirForcing.get(), 1,
154 expList->GeneralMatrixOp(
163 Array<OneD, NekDouble> out(nGlobDofs,0.0);
167 nGlobDofs, tmp, out, pLocToGloMap, nDirDofs);
168 Vmath::Vadd(nGlobDofs-nDirDofs, &out [nDirDofs], 1,
169 &pOutput[nDirDofs], 1, &pOutput[nDirDofs], 1);
173 ASSERTL0(
false,
"Need DG solve if using Dir BCs");
188 const Array<OneD, NekDouble>& pInput,
189 Array<OneD, NekDouble>& pOutput)
191 boost::shared_ptr<MultiRegions::ExpList> expList =
m_expList.lock();
198 const std::map<int, RobinBCInfoSharedPtr> vRobinBCInfo
199 = expList->GetRobinBCInfo();
200 if(vRobinBCInfo.size() > 0)
203 "Robin boundaries not set up in IterativeFull solver.");
207 int nNonDir = nGlobal - nDir;
208 Array<OneD, NekDouble> robin_A(nGlobal, 0.0);
209 Array<OneD, NekDouble> robin_l(nLocal, 0.0);
210 Array<OneD, NekDouble> tmp;
220 for (
int n = 0; n < expList->GetNumElmts(); ++n)
222 int nel = expList->GetOffset_Elmt_Id(n);
223 int offset = expList->GetCoeff_Offset(n);
224 int ncoeffs = expList->GetExp(nel)->GetNcoeffs();
226 if(vRobinBCInfo.count(nel) != 0)
229 Array<OneD, NekDouble> tmp;
233 for(rBC = vRobinBCInfo.find(nel)->second;rBC; rBC = rBC->next)
235 vExp->AddRobinEdgeContribution(rBC->m_robinID,rBC->m_robinPrimitiveCoeffs, tmp = robin_l + offset);
247 Vmath::Vadd(nGlobal, pOutput, 1, robin_A, 1, pOutput, 1);