Commit 7b9cf43e authored by Kilian Lackhove's avatar Kilian Lackhove
Browse files

ExPList: added GlobalToLocal(inarray, outarray) method

parent cb06911a
......@@ -459,6 +459,14 @@ namespace Nektar
* \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
*
*/
void ContField1D::v_LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->LocalToGlobal(inarray, outarray);
}
void ContField1D::v_LocalToGlobal(void)
{
m_locToGloMap->LocalToGlobal(m_coeffs,m_coeffs);
......@@ -484,6 +492,13 @@ namespace Nektar
* \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
*
*/
void ContField1D::v_GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->GlobalToLocal(inarray, outarray);
}
void ContField1D::v_GlobalToLocal(void)
{
m_locToGloMap->GlobalToLocal(m_coeffs,m_coeffs);
......
......@@ -101,17 +101,6 @@ namespace Nektar
// inline
MULTI_REGIONS_EXPORT const Array<OneD,const SpatialDomains
::BoundaryConditionShPtr>& GetBndConditions();
/// Scatters from the global coefficients
/// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
/// \f$\boldsymbol{\hat{u}}_l\f$.
// inline
MULTI_REGIONS_EXPORT void GlobalToLocal( const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
/// Gathers the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
/// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
// inline
MULTI_REGIONS_EXPORT void LocalToGlobal();
/// Assembles the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
/// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
......@@ -194,12 +183,19 @@ namespace Nektar
/// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
/// \f$\boldsymbol{\hat{u}}_l\f$.
// inline
MULTI_REGIONS_EXPORT virtual void v_GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
MULTI_REGIONS_EXPORT virtual void v_GlobalToLocal(void);
/// Gathers the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
/// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
// inline
MULTI_REGIONS_EXPORT virtual void v_LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
MULTI_REGIONS_EXPORT virtual void v_LocalToGlobal(void);
virtual void v_HelmSolve(
......@@ -251,40 +247,6 @@ namespace Nektar
}
/**
* This operation is evaluated as:
* \f{tabbing}
* \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
* \> \> Do \= $i=$ $0,N_m^e-1$ \\
* \> \> \> $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
* \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
* \> \> continue \\
* \> continue
* \f}
* where \a map\f$[e][i]\f$ is the mapping array and \a
* sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
* correct modal connectivity between the different elements (both
* these arrays are contained in the data member #m_locToGloMap). This
* operation is equivalent to the scatter operation
* \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$, where
* \f$\mathcal{A}\f$ is the
* \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
*
* @param inarray An array of size \f$N_\mathrm{dof}\f$
* containing the global degrees of freedom
* \f$\boldsymbol{x}_g\f$.
* @param outarray The resulting local degrees of freedom
* \f$\boldsymbol{x}_l\f$ will be stored in this
* array of size \f$N_\mathrm{eof}\f$.
*/
inline void ContField1D::GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->GlobalToLocal(inarray,outarray);
}
/**
* This operation is evaluated as:
* \f{tabbing}
......
......@@ -737,13 +737,20 @@ namespace Nektar
* local coefficients \f$\boldsymbol{\hat{u}}_l\f$ will be stored in
* #m_coeffs.
*/
void ContField2D::v_GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->GlobalToLocal(inarray, outarray);
}
void ContField2D::v_GlobalToLocal(void)
{
m_locToGloMap->GlobalToLocal(m_coeffs,m_coeffs);
}
/**
* This operation is evaluated as:
* \f{tabbing}
......@@ -768,6 +775,14 @@ namespace Nektar
* resulting global coefficients \f$\boldsymbol{\hat{u}}_g\f$
* will be stored in #m_coeffs.
*/
void ContField2D::v_LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->LocalToGlobal(inarray, outarray);
}
void ContField2D::v_LocalToGlobal(void)
{
m_locToGloMap->LocalToGlobal(m_coeffs,m_coeffs);
......
......@@ -83,23 +83,6 @@ namespace Nektar
/// The default destructor.
MULTI_REGIONS_EXPORT virtual ~ContField2D();
/// Scatters from the global coefficients
/// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
/// \f$\boldsymbol{\hat{u}}_l\f$.
inline void GlobalToLocal(
Array<OneD,NekDouble> &outarray) const;
/// Scatters from the global coefficients
/// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
/// \f$\boldsymbol{\hat{u}}_l\f$.
inline void GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray) const;
inline void LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray) const;
/// Assembles the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
/// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
inline void Assemble();
......@@ -213,12 +196,19 @@ namespace Nektar
/// Gathers the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
/// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
MULTI_REGIONS_EXPORT virtual void v_LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
MULTI_REGIONS_EXPORT virtual void v_LocalToGlobal(void);
/// Scatters from the global coefficients
/// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
/// \f$\boldsymbol{\hat{u}}_l\f$.
MULTI_REGIONS_EXPORT virtual void v_GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
MULTI_REGIONS_EXPORT virtual void v_GlobalToLocal(void);
/// Template method virtual forwarder for FwdTrans().
......@@ -293,77 +283,6 @@ namespace Nektar
typedef boost::shared_ptr<ContField2D> ContField2DSharedPtr;
/**
* This operation is evaluated as:
* \f{tabbing}
* \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
* \> \> Do \= $i=$ $0,N_m^e-1$ \\
* \> \> \> $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
* \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
* \> \> continue \\
* \> continue
* \f}
* where \a map\f$[e][i]\f$ is the mapping array and \a
* sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
* correct modal connectivity between the different elements (both
* these arrays are contained in the data member #m_locToGloMap). This
* operation is equivalent to the scatter operation
* \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$,
* where \f$\mathcal{A}\f$ is the
* \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
*
* @param outarray The resulting local degrees of freedom
* \f$\boldsymbol{x}_l\f$ will be stored in this
* array of size \f$N_\mathrm{eof}\f$.
*/
inline void ContField2D::GlobalToLocal(
Array<OneD,NekDouble> &outarray) const
{
m_locToGloMap->GlobalToLocal(m_coeffs,outarray);
}
/**
* This operation is evaluated as:
* \f{tabbing}
* \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
* \> \> Do \= $i=$ $0,N_m^e-1$ \\
* \> \> \> $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
* \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
* \> \> continue \\
* \> continue
* \f}
* where \a map\f$[e][i]\f$ is the mapping array and \a
* sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
* correct modal connectivity between the different elements (both
* these arrays are contained in the data member #m_locToGloMap). This
* operation is equivalent to the scatter operation
* \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$,
* where \f$\mathcal{A}\f$ is the
* \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
*
* @param inarray An array of size \f$N_\mathrm{dof}\f$
* containing the global degrees of freedom
* \f$\boldsymbol{x}_g\f$.
* @param outarray The resulting local degrees of freedom
* \f$\boldsymbol{x}_l\f$ will be stored in this
* array of size \f$N_\mathrm{eof}\f$.
*/
inline void ContField2D::GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray) const
{
m_locToGloMap->GlobalToLocal(inarray,outarray);
}
inline void ContField2D::LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray) const
{
m_locToGloMap->LocalToGlobal(inarray, outarray);
}
/**
* This operation is evaluated as:
* \f{tabbing}
......
......@@ -519,11 +519,27 @@ namespace Nektar
m_locToGloMap->LocalToGlobal(m_coeffs, m_coeffs);
}
void ContField3D::v_LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->LocalToGlobal(inarray, outarray);
}
void ContField3D::v_GlobalToLocal(void)
{
m_locToGloMap->GlobalToLocal(m_coeffs, m_coeffs);
}
void ContField3D::v_GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->GlobalToLocal(inarray, outarray);
}
void ContField3D::v_HelmSolve(
......
......@@ -86,14 +86,6 @@ namespace Nektar
Array<OneD, NekDouble> &inout,
Array<OneD, NekDouble> &outarray);
inline void GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
inline void LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
inline void Assemble();
inline void Assemble(
......@@ -163,9 +155,19 @@ namespace Nektar
virtual void v_LocalToGlobal(void);
virtual void v_LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
virtual void v_GlobalToLocal(void);
virtual void v_GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
virtual void v_MultiplyByInvMassMatrix(
const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray,
......@@ -196,23 +198,6 @@ namespace Nektar
return m_bndCondExpansions;
}
inline void ContField3D::GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->GlobalToLocal(inarray, outarray);
}
inline void ContField3D::LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
m_locToGloMap->LocalToGlobal(inarray, outarray);
}
inline void ContField3D::Assemble()
{
m_locToGloMap->Assemble(m_coeffs, m_coeffs);
......
......@@ -2536,6 +2536,15 @@ namespace Nektar
"This method is not defined or valid for this class type");
}
void ExpList::v_LocalToGlobal(const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
ASSERTL0(false,
"This method is not defined or valid for this class type");
}
void ExpList::v_GlobalToLocal(void)
{
ASSERTL0(false,
......@@ -2543,6 +2552,14 @@ namespace Nektar
}
void ExpList::v_GlobalToLocal(const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
ASSERTL0(false,
"This method is not defined or valid for this class type");
}
void ExpList::v_BwdTrans(const Array<OneD, const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray,
CoeffState coeffstate)
......
......@@ -445,11 +445,24 @@ namespace Nektar
/// Fill Bnd Condition expansion from the values stored in expansion
inline void FillBndCondFromField(void);
/// Put the coefficients into global ordering using m_coeffs
inline void LocalToGlobal(void);
/// Gathers the global coefficients \f$\boldsymbol{\hat{u}}_g\f$
/// from the local coefficients \f$\boldsymbol{\hat{u}}_l\f$.
// inline
MULTI_REGIONS_EXPORT inline void LocalToGlobal(void);
/// Put the coefficients into local ordering and place in m_coeffs
inline void GlobalToLocal(void);
MULTI_REGIONS_EXPORT inline void LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
/// Scatters from the global coefficients
/// \f$\boldsymbol{\hat{u}}_g\f$ to the local coefficients
/// \f$\boldsymbol{\hat{u}}_l\f$.
// inline
MULTI_REGIONS_EXPORT inline void GlobalToLocal(void);
MULTI_REGIONS_EXPORT inline void GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
/// Get the \a i th value (coefficient) of #m_coeffs
inline NekDouble GetCoeff(int i);
......@@ -1156,8 +1169,16 @@ namespace Nektar
virtual void v_LocalToGlobal(void);
virtual void v_LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
virtual void v_GlobalToLocal(void);
virtual void v_GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray);
virtual void v_BwdTrans(
const Array<OneD,const NekDouble> &inarray,
Array<OneD, NekDouble> &outarray,
......@@ -1851,11 +1872,51 @@ namespace Nektar
{
v_LocalToGlobal();
}
inline void ExpList::LocalToGlobal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
v_LocalToGlobal(inarray, outarray);
}
inline void ExpList::GlobalToLocal(void)
{
v_GlobalToLocal();
}
/**
* This operation is evaluated as:
* \f{tabbing}
* \hspace{1cm} \= Do \= $e=$ $1, N_{\mathrm{el}}$ \\
* \> \> Do \= $i=$ $0,N_m^e-1$ \\
* \> \> \> $\boldsymbol{\hat{u}}^{e}[i] = \mbox{sign}[e][i] \cdot
* \boldsymbol{\hat{u}}_g[\mbox{map}[e][i]]$ \\
* \> \> continue \\
* \> continue
* \f}
* where \a map\f$[e][i]\f$ is the mapping array and \a
* sign\f$[e][i]\f$ is an array of similar dimensions ensuring the
* correct modal connectivity between the different elements (both
* these arrays are contained in the data member #m_locToGloMap). This
* operation is equivalent to the scatter operation
* \f$\boldsymbol{\hat{u}}_l=\mathcal{A}\boldsymbol{\hat{u}}_g\f$, where
* \f$\mathcal{A}\f$ is the
* \f$N_{\mathrm{eof}}\times N_{\mathrm{dof}}\f$ permutation matrix.
*
* @param inarray An array of size \f$N_\mathrm{dof}\f$
* containing the global degrees of freedom
* \f$\boldsymbol{x}_g\f$.
* @param outarray The resulting local degrees of freedom
* \f$\boldsymbol{x}_l\f$ will be stored in this
* array of size \f$N_\mathrm{eof}\f$.
*/
inline void ExpList::GlobalToLocal(
const Array<OneD, const NekDouble> &inarray,
Array<OneD,NekDouble> &outarray)
{
v_GlobalToLocal(inarray, outarray);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment