45 namespace MultiRegions
48 ContField3D::ContField3D():
52 m_globalLinSysManager(
53 boost::bind(&
ContField3D::GenGlobalLinSys, this, _1),
54 std::string(
"GlobalLinSys"))
81 const std::string &variable,
82 const bool CheckIfSingularSystem,
86 m_globalLinSysManager(
87 boost::bind(&
ContField3D::GenGlobalLinSys, this, _1),
88 std::string(
"GlobalLinSys"))
92 CheckIfSingularSystem, variable,
95 if (
m_session->DefinesCmdLineArgument(
"verbose"))
127 const std::string &variable,
128 const bool CheckIfSingularSystem):
131 m_globalLinSysManager(boost::bind(&
ContField3D::GenGlobalLinSys, this, _1),
132 std::string(
"GlobalLinSys"))
140 CheckIfSingularSystem, variable,
143 if (
m_session->DefinesCmdLineArgument(
"verbose"))
157 m_locToGloMap(In.m_locToGloMap),
158 m_globalMat(In.m_globalMat),
159 m_globalLinSysManager(In.m_globalLinSysManager)
197 mat->Multiply(inarray,outarray);
242 mat->Multiply(inarray,outarray);
295 if(inarray.data() == outarray.data())
310 if(inarray.data() == outarray.data())
342 sign =
m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
345 inout[map[bndcnt++]] = sign * coeffs[j];
379 if(contNcoeffs - NumDirBcs > 0)
395 "To use method must have a AssemblyMap "
411 "To use method must have a AssemblyMap "
420 (*m_globalMat)[mkey] = glo_matrix;
424 glo_matrix = matrixIter->second;
449 map<int, vector<ExtraDirDof> > &extraDirDofs =
452 for (it = extraDirDofs.begin(); it != extraDirDofs.end(); ++it)
454 for (i = 0; i < it->second.size(); ++i)
456 tmp[it->second.at(i).get<1>()] =
458 it->second.at(i).get<0>()]*it->second.at(i).get<2>();
478 tmp[bndMap[bndcnt++]] = sign * coeffs[j];
512 sign =
m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
513 coeffs[j] = sign * tmp[bndMap[bndcnt++]];
529 "nreg is out or range since this many boundary "
530 "regions to not exist");
535 for(
int j = 0; j < nreg; ++j)
542 sign =
m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
543 coeffs[j] = sign * tmp[bndMap[bndcnt++]];
584 const bool PhysSpaceForcing)
613 sign =
m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
614 gamma[
m_locToGloMap->GetBndCondCoeffsToGlobalCoeffsMap(bndcnt++)] +=
626 Vmath::Vadd(contNcoeffs, wsp, 1, gamma, 1, wsp, 1);
657 mat->Multiply(inarray,outarray);
724 Vmath::Vadd(contNcoeffs, wsp, 1, gamma, 1, wsp, 1);
754 "To use method must have a AssemblyMap "
765 return matrixIter->second->GetNumNonZeroEntries();
virtual void v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, CoeffState coeffstate=eLocal, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
boost::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
void LocalToGlobal(bool useComm=true)
Gathers the global coefficients from the local coefficients .
void GeneralMatrixOp_IterPerExp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
GlobalMatrixSharedPtr GetGlobalMatrix(const GlobalMatrixKey &mkey)
Returns the global matrix specified by mkey.
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
#define sign(a, b)
return the sign(b)*a
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::map< GlobalMatrixKey, GlobalMatrixSharedPtr > GlobalMatrixMap
Mapping from global matrix keys to global matrices.
int GetGlobalMatrixNnz(const GlobalMatrixKey &gkey)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Calculates the inner product of a function with respect to all global expansion modes ...
PeriodicMap m_periodicFaces
A map which identifies pairs of periodic faces.
std::map< ConstFactorType, NekDouble > ConstFactorMap
virtual void v_GlobalToLocal(void)
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
boost::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
Impose the Dirichlet Boundary Conditions on outarray.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
This function calculates the result of the multiplication of a matrix of type specified by mkey with ...
bool isSet(const FlagType &key) const
void BwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally evaluates the backward transformation of the global spectral/hp element exp...
GlobalLinSysSharedPtr GenGlobalLinSys(const GlobalLinSysKey &mkey)
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
boost::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const boost::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
void IProductWRTBase_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to all {local} expansion modes...
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
virtual void v_FillBndCondFromField()
LibUtilities::SessionReaderSharedPtr m_session
Session.
void Neg(int n, T *x, const int incx)
Negate x = -x.
bool SameTypeOfBoundaryConditions(const DisContField3D &In)
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
Calculates the result of the multiplication of a global matrix of type specified by mkey with a vecto...
Describe a linear system.
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
Describes a matrix with ordering defined by a local to global map.
AssemblyMapCGSharedPtr m_locToGloMap
GlobalLinSysSharedPtr GetGlobalLinSys(const GlobalLinSysKey &mkey)
void GenerateDirBndCondForcing(const GlobalLinSysKey &key, Array< OneD, NekDouble > &inout, Array< OneD, NekDouble > &outarray)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
void GlobalSolve(const GlobalLinSysKey &key, const Array< OneD, const NekDouble > &rhs, Array< OneD, NekDouble > &inout, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
PeriodicMap m_periodicVerts
A map which identifies groups of periodic vertices.
bool LocToGloMapIsDefined() const
Returns true if a local to global map is defined.
GlobalMatrixMapShPtr m_globalMat
(A shared pointer to) a list which collects all the global matrices being assembled, such that they should be constructed only once.
void IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
LibUtilities::NekManager< GlobalLinSysKey, GlobalLinSys > m_globalLinSysManager
(A shared pointer to) a list which collects all the global linear system being assembled, such that they should be constructed only once.
virtual void v_LocalToGlobal(bool useComm)
boost::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate)
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal)
Performs the backward transformation of the spectral/hp element expansion.
virtual void v_ClearGlobalLinSysManager(void)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
void GlobalToLocal(void)
Scatters from the global coefficients to the local coefficients .
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.
PeriodicMap m_periodicEdges
A map which identifies groups of periodic edges.