Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Attributes | List of all members
Nektar::LibUtilities::TimeIntegrationSolution Class Reference

#include <TimeIntegrationScheme.h>

Public Types

typedef Array< OneD, Array
< OneD, Array< OneD, NekDouble > > > 
TripleArray
typedef Array< OneD, Array
< OneD, NekDouble > > 
DoubleArray

Public Member Functions

 TimeIntegrationSolution (const TimeIntegrationSchemeKey &key, const DoubleArray &y, const NekDouble time, const NekDouble timestep)
 TimeIntegrationSolution (const TimeIntegrationSchemeKey &key, const TripleArray &y, const Array< OneD, NekDouble > &t)
 TimeIntegrationSolution (const TimeIntegrationSchemeKey &key, unsigned int nvar, unsigned int npoints)
 TimeIntegrationSolution (const TimeIntegrationSchemeKey &key)
const
TimeIntegrationSchemeSharedPtr
GetIntegrationScheme () const
const TimeIntegrationSchemeKeyGetIntegrationSchemeKey () const
TimeIntegrationMethod GetIntegrationMethod () const
const TripleArrayGetSolutionVector () const
TripleArrayUpdateSolutionVector ()
const DoubleArrayGetSolution () const
DoubleArrayUpdateSolution ()
const Array< OneD, const
NekDouble > & 
GetTimeVector () const
Array< OneD, NekDouble > & UpdateTimeVector ()
NekDouble GetTime () const
int GetNsteps ()
int GetFirstDim () const
int GetSecondDim () const
unsigned int GetNvalues (void) const
unsigned int GetNderivs (void) const
const Array< OneD, const
unsigned int > & 
GetTimeLevelOffset ()
DoubleArrayGetValue (const unsigned int timeLevelOffset)
DoubleArrayGetDerivative (const unsigned int timeLevelOffset)
NekDouble GetValueTime (const unsigned int timeLevelOffset)
void SetValue (const unsigned int timeLevelOffset, const DoubleArray &y, const NekDouble t)
void SetDerivative (const unsigned int timeLevelOffset, const DoubleArray &y, const NekDouble timestep)
void SetSolVector (const int Offset, const DoubleArray &y)
void RotateSolutionVector ()

Private Attributes

TimeIntegrationSchemeSharedPtr m_scheme
TripleArray m_solVector
Array< OneD, NekDoublem_t

Detailed Description

Definition at line 613 of file TimeIntegrationScheme.h.

Member Typedef Documentation

Definition at line 617 of file TimeIntegrationScheme.h.

Definition at line 616 of file TimeIntegrationScheme.h.

Constructor & Destructor Documentation

Nektar::LibUtilities::TimeIntegrationSolution::TimeIntegrationSolution ( const TimeIntegrationSchemeKey key,
const DoubleArray y,
const NekDouble  time,
const NekDouble  timestep 
)

Definition at line 75 of file TimeIntegrationScheme.cpp.

References GetTimeLevelOffset(), m_scheme, m_solVector, and m_t.

:
m_solVector(m_scheme->GetNsteps()),
m_t(m_scheme->GetNsteps())
{
m_solVector[0] = y;
m_t[0] = time;
int nsteps = m_scheme->GetNsteps();
int nvar = y.num_elements();
int npoints = y[0].num_elements();
int nMultiStepVals = m_scheme->GetNmultiStepValues();
const Array<OneD, const unsigned int>& timeLevels = GetTimeLevelOffset();
for(int i = 1; i < nsteps; i++)
{
m_solVector[i] = Array<OneD, Array<OneD, NekDouble> >(nvar);
for(int j = 0; j < nvar; j++)
{
m_solVector[i][j] = Array<OneD,NekDouble>(npoints,0.0);
}
if(i < nMultiStepVals)
{
m_t[i] = time - i*timestep*timeLevels[i];
}
else
{
m_t[i] = timestep;
}
}
}
Nektar::LibUtilities::TimeIntegrationSolution::TimeIntegrationSolution ( const TimeIntegrationSchemeKey key,
const TripleArray y,
const Array< OneD, NekDouble > &  t 
)

Definition at line 109 of file TimeIntegrationScheme.cpp.

References ASSERTL1, and m_scheme.

:
m_t(t)
{
ASSERTL1(y.num_elements()==m_scheme->GetNsteps(),"Amount of Entries does not match number of (multi-) steps");
}
Nektar::LibUtilities::TimeIntegrationSolution::TimeIntegrationSolution ( const TimeIntegrationSchemeKey key,
unsigned int  nvar,
unsigned int  npoints 
)

Definition at line 119 of file TimeIntegrationScheme.cpp.

References m_scheme, and m_solVector.

:
m_solVector(m_scheme->GetNsteps()),
m_t(m_scheme->GetNsteps())
{
for(int i = 0; i < m_scheme->GetNsteps(); i++)
{
m_solVector[i] = Array<OneD, Array<OneD, NekDouble> >(nvar);
for(int j = 0; j < nvar; j++)
{
m_solVector[i][j] = Array<OneD,NekDouble>(npoints);
}
}
}
Nektar::LibUtilities::TimeIntegrationSolution::TimeIntegrationSolution ( const TimeIntegrationSchemeKey key)

Definition at line 136 of file TimeIntegrationScheme.cpp.

:
m_solVector(m_scheme->GetNsteps()),
m_t(m_scheme->GetNsteps())
{
}

Member Function Documentation

DoubleArray& Nektar::LibUtilities::TimeIntegrationSolution::GetDerivative ( const unsigned int  timeLevelOffset)
inline

Definition at line 739 of file TimeIntegrationScheme.h.

References ASSERTL1, GetTimeLevelOffset(), m_scheme, and m_solVector.

{
int nMultiStepVals = m_scheme->GetNmultiStepValues();
int size = m_scheme->GetNsteps();
const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
for(int i = nMultiStepVals; i < size; i++)
{
if( timeLevelOffset == offsetvec[i] )
{
return m_solVector[i];
}
}
ASSERTL1(false,"The solution vector of this scheme does not contain a derivative at the requested time-level");
return m_solVector[0];
}
int Nektar::LibUtilities::TimeIntegrationSolution::GetFirstDim ( ) const
inline

Definition at line 688 of file TimeIntegrationScheme.h.

References m_solVector.

{
return m_solVector[0].num_elements();
}
TimeIntegrationMethod Nektar::LibUtilities::TimeIntegrationSolution::GetIntegrationMethod ( ) const
inline

Definition at line 643 of file TimeIntegrationScheme.h.

References m_scheme.

{
return m_scheme->GetIntegrationMethod();
}
const TimeIntegrationSchemeSharedPtr& Nektar::LibUtilities::TimeIntegrationSolution::GetIntegrationScheme ( ) const
inline

Definition at line 633 of file TimeIntegrationScheme.h.

References m_scheme.

{
return m_scheme;
}
const TimeIntegrationSchemeKey& Nektar::LibUtilities::TimeIntegrationSolution::GetIntegrationSchemeKey ( ) const
inline

Definition at line 638 of file TimeIntegrationScheme.h.

References m_scheme.

{
return m_scheme->GetIntegrationSchemeKey();
}
unsigned int Nektar::LibUtilities::TimeIntegrationSolution::GetNderivs ( void  ) const
inline

Definition at line 707 of file TimeIntegrationScheme.h.

References m_scheme.

{
return m_scheme->GetNmultiStepDerivs();
}
int Nektar::LibUtilities::TimeIntegrationSolution::GetNsteps ( void  )
inline

Definition at line 683 of file TimeIntegrationScheme.h.

References m_scheme.

{
return m_scheme->GetNsteps();
}
unsigned int Nektar::LibUtilities::TimeIntegrationSolution::GetNvalues ( void  ) const
inline

Definition at line 700 of file TimeIntegrationScheme.h.

References m_scheme.

{
return m_scheme->GetNmultiStepValues();
}
int Nektar::LibUtilities::TimeIntegrationSolution::GetSecondDim ( ) const
inline

Definition at line 693 of file TimeIntegrationScheme.h.

References m_solVector.

{
return m_solVector[0][0].num_elements();
}
const DoubleArray& Nektar::LibUtilities::TimeIntegrationSolution::GetSolution ( ) const
inline

Definition at line 658 of file TimeIntegrationScheme.h.

References m_solVector.

{
return m_solVector[0];
}
const TripleArray& Nektar::LibUtilities::TimeIntegrationSolution::GetSolutionVector ( ) const
inline

Definition at line 648 of file TimeIntegrationScheme.h.

References m_solVector.

{
return m_solVector;
}
NekDouble Nektar::LibUtilities::TimeIntegrationSolution::GetTime ( ) const
inline

Definition at line 678 of file TimeIntegrationScheme.h.

References m_t.

{
return m_t[0];
}
const Array<OneD, const unsigned int>& Nektar::LibUtilities::TimeIntegrationSolution::GetTimeLevelOffset ( )
inline

Definition at line 714 of file TimeIntegrationScheme.h.

References m_scheme.

Referenced by GetDerivative(), GetValue(), GetValueTime(), SetDerivative(), SetValue(), and TimeIntegrationSolution().

{
return m_scheme->GetTimeLevelOffset();
}
const Array<OneD, const NekDouble>& Nektar::LibUtilities::TimeIntegrationSolution::GetTimeVector ( ) const
inline

Definition at line 668 of file TimeIntegrationScheme.h.

References m_t.

{
return m_t;
}
DoubleArray& Nektar::LibUtilities::TimeIntegrationSolution::GetValue ( const unsigned int  timeLevelOffset)
inline

Definition at line 721 of file TimeIntegrationScheme.h.

References ASSERTL1, GetTimeLevelOffset(), m_scheme, and m_solVector.

{
int nMultiStepVals = m_scheme->GetNmultiStepValues();
const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
for(int i = 0; i < nMultiStepVals; i++)
{
if( timeLevelOffset == offsetvec[i] )
{
return m_solVector[i];
}
}
ASSERTL1(false,"The solution vector of this scheme does not contain a value at the requested time-level");
return m_solVector[0];
}
NekDouble Nektar::LibUtilities::TimeIntegrationSolution::GetValueTime ( const unsigned int  timeLevelOffset)
inline

Definition at line 758 of file TimeIntegrationScheme.h.

References ASSERTL1, GetTimeLevelOffset(), m_scheme, and m_t.

{
int nMultiStepVals = m_scheme->GetNmultiStepValues();
const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
for(int i = 0; i < nMultiStepVals; i++)
{
if( timeLevelOffset == offsetvec[i] )
{
return m_t[i];
}
}
ASSERTL1(false,"The solution vector of this scheme does not contain a value at the requested time-level");
return m_t[0];
}
void Nektar::LibUtilities::TimeIntegrationSolution::RotateSolutionVector ( )
inline

Definition at line 821 of file TimeIntegrationScheme.h.

References m_scheme, and m_solVector.

{
int i;
int nMultiStepVals = m_scheme->GetNmultiStepValues();
int size = m_scheme->GetNsteps();
for(i = (nMultiStepVals-1); i > 0; i--)
{
}
for(i = (size-1); i > nMultiStepVals; i--)
{
}
}
void Nektar::LibUtilities::TimeIntegrationSolution::SetDerivative ( const unsigned int  timeLevelOffset,
const DoubleArray y,
const NekDouble  timestep 
)
inline

Definition at line 796 of file TimeIntegrationScheme.h.

References GetTimeLevelOffset(), m_scheme, m_solVector, and m_t.

{
int nMultiStepVals = m_scheme->GetNmultiStepValues();
int size = m_scheme->GetNsteps();
const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
for(int i = nMultiStepVals; i < size; i++)
{
if( timeLevelOffset == offsetvec[i] )
{
m_solVector[i] = y;
m_t[i] = timestep;
return;
}
}
}
void Nektar::LibUtilities::TimeIntegrationSolution::SetSolVector ( const int  Offset,
const DoubleArray y 
)
inline

Definition at line 814 of file TimeIntegrationScheme.h.

References m_solVector.

{
m_solVector[Offset] = y;
}
void Nektar::LibUtilities::TimeIntegrationSolution::SetValue ( const unsigned int  timeLevelOffset,
const DoubleArray y,
const NekDouble  t 
)
inline

Definition at line 777 of file TimeIntegrationScheme.h.

References GetTimeLevelOffset(), m_scheme, m_solVector, and m_t.

{
int nMultiStepVals = m_scheme->GetNmultiStepValues();
const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
for(int i = 0; i < nMultiStepVals; i++)
{
if( timeLevelOffset == offsetvec[i] )
{
m_solVector[i] = y;
m_t[i] = t;
return;
}
}
}
DoubleArray& Nektar::LibUtilities::TimeIntegrationSolution::UpdateSolution ( )
inline

Definition at line 663 of file TimeIntegrationScheme.h.

References m_solVector.

{
return m_solVector[0];
}
TripleArray& Nektar::LibUtilities::TimeIntegrationSolution::UpdateSolutionVector ( )
inline

Definition at line 653 of file TimeIntegrationScheme.h.

References m_solVector.

{
return m_solVector;
}
Array<OneD, NekDouble>& Nektar::LibUtilities::TimeIntegrationSolution::UpdateTimeVector ( )
inline

Definition at line 673 of file TimeIntegrationScheme.h.

References m_t.

{
return m_t;
}

Member Data Documentation

TimeIntegrationSchemeSharedPtr Nektar::LibUtilities::TimeIntegrationSolution::m_scheme
private

Definition at line 839 of file TimeIntegrationScheme.h.

Referenced by GetDerivative(), GetIntegrationMethod(), GetIntegrationScheme(), GetIntegrationSchemeKey(), GetNderivs(), GetNsteps(), GetNvalues(), GetTimeLevelOffset(), GetValue(), GetValueTime(), RotateSolutionVector(), SetDerivative(), SetValue(), and TimeIntegrationSolution().

TripleArray Nektar::LibUtilities::TimeIntegrationSolution::m_solVector
private

Definition at line 840 of file TimeIntegrationScheme.h.

Referenced by GetDerivative(), GetFirstDim(), GetSecondDim(), GetSolution(), GetSolutionVector(), GetValue(), RotateSolutionVector(), SetDerivative(), SetSolVector(), SetValue(), TimeIntegrationSolution(), UpdateSolution(), and UpdateSolutionVector().

Array<OneD,NekDouble> Nektar::LibUtilities::TimeIntegrationSolution::m_t
private

Definition at line 841 of file TimeIntegrationScheme.h.

Referenced by GetTime(), GetTimeVector(), GetValueTime(), SetDerivative(), SetValue(), TimeIntegrationSolution(), and UpdateTimeVector().