35#ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_PRECONCFSBRJ
36#define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_PRECONCFSBRJ
61 pFields, pSession, vComm);
97 const bool &flag)
override;
116 template <
typename DataType>
119 const size_t nvariables,
const size_t nCoeffs,
126 template <
typename TypeNekBlkMatSharedPtr>
130 const int &nscale = 1);
145 const auto nTotElmt = pFields[0]->GetNumElmts();
146 const auto nvariables = pFields.size();
147 const auto vecwidth = vec_t::width;
152 for (
int ne = 0; ne < nTotElmt; ne++)
154 const auto nElmtDof = pFields[0]->GetNcoeffs(ne) * nvariables;
155 const auto nblocks = nElmtDof / vecwidth;
156 unsigned int totblocks =
157 (nElmtDof % vecwidth) ? nblocks + 1 : nblocks;
164 TotLen += totblocks * vecwidth;
165 TotMatLen += nElmtDof * totblocks;
174 unsigned int ncoeffs = pFields[0]->GetNcoeffs();
175 for (
int ne = 0, cnt1 = 0; ne < nTotElmt; ne++)
177 const auto nElmtCoeff = pFields[0]->GetNcoeffs(ne);
178 const auto nElmtDof = nElmtCoeff * nvariables;
179 const auto nblocks = nElmtDof / vecwidth;
180 const auto nCoefOffset = pFields[0]->GetCoeff_Offset(ne);
185 for (
int m = 0; m < nvariables; m++)
187 inOffset = m * ncoeffs + nCoefOffset;
189 if (m && (vecwidth - i0 < nElmtCoeff))
195 for (i = 0; i0 < vecwidth; ++i, ++i0)
207 for (j = 0; (j + 1) * vecwidth < nElmtCoeff - i; ++j)
209 for (i0 = 0; i0 < vecwidth; ++i0)
211 m_inputIdx[cnt1++] = inOffset + i + j * vecwidth + i0;
216 for (i0 = 0, j = j * vecwidth; j < nElmtCoeff - i; ++j, ++i0)
222 const auto endwidth = nElmtDof - nblocks * vecwidth;
227 for (i0 = endwidth; i0 < vecwidth; ++i0)
232 ASSERTL1(cnt1 <= TotLen,
"m_inputIdx over extended");
243 for (
size_t nelm = 0; nelm < nrow.size(); ++nelm)
245 int nrowsVars = nrow[nelm];
246 int ncolsVars = ncol[nelm];
249 nrowsVars, ncolsVars, 0.0);
250 mat->SetBlock(nelm, nelm, loc_matNvar);
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Array< OneD, SNekBlkMatSharedPtr > m_TraceJacSingle
void v_BuildPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, const Array< OneD, NekDouble > > &intmp, const NekDouble time, const NekDouble lambda) override
void v_DoPreconCfs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &flag) override
TensorOfArray4D< NekSingle > m_TraceJacArraySingle
void MinusOffDiag2Rhs(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const size_t nvariables, const size_t nCoeffs, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, TensorOfArray3D< NekDouble > &wspTrace, Array< OneD, Array< OneD, DataType > > &wspTraceDataType, const TensorOfArray4D< DataType > &TraceJacArray)
Array< OneD, Array< OneD, SNekBlkMatSharedPtr > > m_PreconMatVarsSingle
~PreconCfsBRJ() override=default
static std::string className
Name of the class.
Array< OneD, SNekBlkMatSharedPtr > m_TraceJacDerivSingle
unsigned int m_max_nblocks
Array< OneD, Array< OneD, NekSingle > > m_TraceJacDerivSignSingle
static PreconCfsSharedPtr create(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm)
Creates an instance of this class.
void v_InitObject() override
TensorOfArray4D< NekSingle > m_TraceJacDerivArraySingle
PreconCfsBRJ(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm)
unsigned int m_max_nElmtDof
void AllocatePreconBlkDiagCoeff(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, Array< OneD, Array< OneD, TypeNekBlkMatSharedPtr > > &gmtxarray, const int &nscale=1)
TensorOfArray5D< NekSingle > m_TraceIPSymJacArraySingle
std::vector< int > m_inputIdx
void AllocateNekBlkMatDig(SNekBlkMatSharedPtr &mat, const Array< OneD, unsigned int > nrow, const Array< OneD, unsigned int > ncol)
void AllocateSIMDPreconBlkMatDiag(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
This function creates the matrix structure for the block diagonal operator. It organizes the way that...
void PreconBlkDiag(const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
bool v_UpdatePreconMatCheck(const Array< OneD, const NekDouble > &res, const NekDouble dtLambda) override
std::vector< simd< NekSingle >, tinysimd::allocator< simd< NekSingle > > > m_sBlkDiagMat
void DoNullPrecon(const Array< OneD, NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const bool &flag)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
std::shared_ptr< SNekBlkMat > SNekBlkMatSharedPtr
std::shared_ptr< SNekMat > SNekMatSharedPtr
std::shared_ptr< PreconCfs > PreconCfsSharedPtr
tinysimd::simd< NekDouble > vec_t
typename abi< ScalarType, width >::type simd
boost::alignment::aligned_allocator< T, T::alignment > allocator