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>

Collaboration diagram for Nektar::LibUtilities::TimeIntegrationSolution:
Collaboration graph
[legend]

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 619 of file TimeIntegrationScheme.h.

Member Typedef Documentation

Definition at line 623 of file TimeIntegrationScheme.h.

Definition at line 622 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.

78  :
80  m_solVector(m_scheme->GetNsteps()),
81  m_t(m_scheme->GetNsteps())
82  {
83  m_solVector[0] = y;
84  m_t[0] = time;
85 
86  int nsteps = m_scheme->GetNsteps();
87  int nvar = y.num_elements();
88  int npoints = y[0].num_elements();
89  int nMultiStepVals = m_scheme->GetNmultiStepValues();
90  const Array<OneD, const unsigned int>& timeLevels = GetTimeLevelOffset();
91  for(int i = 1; i < nsteps; i++)
92  {
93  m_solVector[i] = Array<OneD, Array<OneD, NekDouble> >(nvar);
94  for(int j = 0; j < nvar; j++)
95  {
96  m_solVector[i][j] = Array<OneD,NekDouble>(npoints,0.0);
97  }
98  if(i < nMultiStepVals)
99  {
100  m_t[i] = time - i*timestep*timeLevels[i];
101  }
102  else
103  {
104  m_t[i] = timestep;
105  }
106  }
107  }
TimeIntegrationSchemeManagerT & TimeIntegrationSchemeManager(void)
const Array< OneD, const unsigned int > & GetTimeLevelOffset()
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.

111  :
113  m_solVector(y),
114  m_t(t)
115  {
116  ASSERTL1(y.num_elements()==m_scheme->GetNsteps(),"Amount of Entries does not match number of (multi-) steps");
117  }
TimeIntegrationSchemeManagerT & TimeIntegrationSchemeManager(void)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
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.

121  :
123  m_solVector(m_scheme->GetNsteps()),
124  m_t(m_scheme->GetNsteps())
125  {
126  for(int i = 0; i < m_scheme->GetNsteps(); i++)
127  {
128  m_solVector[i] = Array<OneD, Array<OneD, NekDouble> >(nvar);
129  for(int j = 0; j < nvar; j++)
130  {
131  m_solVector[i][j] = Array<OneD,NekDouble>(npoints);
132  }
133  }
134  }
TimeIntegrationSchemeManagerT & TimeIntegrationSchemeManager(void)
Nektar::LibUtilities::TimeIntegrationSolution::TimeIntegrationSolution ( const TimeIntegrationSchemeKey key)

Definition at line 136 of file TimeIntegrationScheme.cpp.

136  :
138  m_solVector(m_scheme->GetNsteps()),
139  m_t(m_scheme->GetNsteps())
140  {
141  }
TimeIntegrationSchemeManagerT & TimeIntegrationSchemeManager(void)

Member Function Documentation

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

Definition at line 745 of file TimeIntegrationScheme.h.

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

746  {
747  int nMultiStepVals = m_scheme->GetNmultiStepValues();
748  int size = m_scheme->GetNsteps();
749  const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
750 
751  for(int i = nMultiStepVals; i < size; i++)
752  {
753  if( timeLevelOffset == offsetvec[i] )
754  {
755  return m_solVector[i];
756  }
757  }
758  ASSERTL1(false,"The solution vector of this scheme does not contain a derivative at the requested time-level");
759  return m_solVector[0];
760  }
const Array< OneD, const unsigned int > & GetTimeLevelOffset()
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
int Nektar::LibUtilities::TimeIntegrationSolution::GetFirstDim ( ) const
inline

Definition at line 694 of file TimeIntegrationScheme.h.

References m_solVector.

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

Definition at line 649 of file TimeIntegrationScheme.h.

References m_scheme.

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

Definition at line 639 of file TimeIntegrationScheme.h.

References m_scheme.

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

Definition at line 644 of file TimeIntegrationScheme.h.

References m_scheme.

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

Definition at line 713 of file TimeIntegrationScheme.h.

References m_scheme.

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

Definition at line 689 of file TimeIntegrationScheme.h.

References m_scheme.

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

Definition at line 706 of file TimeIntegrationScheme.h.

References m_scheme.

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

Definition at line 699 of file TimeIntegrationScheme.h.

References m_solVector.

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

Definition at line 664 of file TimeIntegrationScheme.h.

References m_solVector.

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

Definition at line 654 of file TimeIntegrationScheme.h.

References m_solVector.

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

Definition at line 684 of file TimeIntegrationScheme.h.

References m_t.

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

Definition at line 720 of file TimeIntegrationScheme.h.

References m_scheme.

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

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

Definition at line 674 of file TimeIntegrationScheme.h.

References m_t.

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

Definition at line 727 of file TimeIntegrationScheme.h.

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

728  {
729  int nMultiStepVals = m_scheme->GetNmultiStepValues();
730  const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
731 
732  for(int i = 0; i < nMultiStepVals; i++)
733  {
734  if( timeLevelOffset == offsetvec[i] )
735  {
736  return m_solVector[i];
737  }
738  }
739  ASSERTL1(false,"The solution vector of this scheme does not contain a value at the requested time-level");
740  return m_solVector[0];
741  }
const Array< OneD, const unsigned int > & GetTimeLevelOffset()
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
NekDouble Nektar::LibUtilities::TimeIntegrationSolution::GetValueTime ( const unsigned int  timeLevelOffset)
inline

Definition at line 764 of file TimeIntegrationScheme.h.

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

765  {
766  int nMultiStepVals = m_scheme->GetNmultiStepValues();
767  const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
768 
769  for(int i = 0; i < nMultiStepVals; i++)
770  {
771  if( timeLevelOffset == offsetvec[i] )
772  {
773  return m_t[i];
774  }
775  }
776  ASSERTL1(false,"The solution vector of this scheme does not contain a value at the requested time-level");
777  return m_t[0];
778  }
const Array< OneD, const unsigned int > & GetTimeLevelOffset()
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
void Nektar::LibUtilities::TimeIntegrationSolution::RotateSolutionVector ( )
inline

Definition at line 827 of file TimeIntegrationScheme.h.

References m_scheme, and m_solVector.

828  {
829  int i;
830  int nMultiStepVals = m_scheme->GetNmultiStepValues();
831  int size = m_scheme->GetNsteps();
832  for(i = (nMultiStepVals-1); i > 0; i--)
833  {
834  m_solVector[i] = m_solVector[i-1];
835  }
836 
837  for(i = (size-1); i > nMultiStepVals; i--)
838  {
839  m_solVector[i] = m_solVector[i-1];
840  }
841  }
void Nektar::LibUtilities::TimeIntegrationSolution::SetDerivative ( const unsigned int  timeLevelOffset,
const DoubleArray y,
const NekDouble  timestep 
)
inline

Definition at line 802 of file TimeIntegrationScheme.h.

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

803  {
804  int nMultiStepVals = m_scheme->GetNmultiStepValues();
805  int size = m_scheme->GetNsteps();
806  const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
807 
808  for(int i = nMultiStepVals; i < size; i++)
809  {
810  if( timeLevelOffset == offsetvec[i] )
811  {
812  m_solVector[i] = y;
813  m_t[i] = timestep;
814  return;
815  }
816  }
817  }
const Array< OneD, const unsigned int > & GetTimeLevelOffset()
void Nektar::LibUtilities::TimeIntegrationSolution::SetSolVector ( const int  Offset,
const DoubleArray y 
)
inline

Definition at line 820 of file TimeIntegrationScheme.h.

References m_solVector.

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

Definition at line 783 of file TimeIntegrationScheme.h.

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

784  {
785  int nMultiStepVals = m_scheme->GetNmultiStepValues();
786  const Array<OneD, const unsigned int>& offsetvec = GetTimeLevelOffset();
787 
788  for(int i = 0; i < nMultiStepVals; i++)
789  {
790  if( timeLevelOffset == offsetvec[i] )
791  {
792  m_solVector[i] = y;
793  m_t[i] = t;
794  return;
795  }
796  }
797  }
const Array< OneD, const unsigned int > & GetTimeLevelOffset()
DoubleArray& Nektar::LibUtilities::TimeIntegrationSolution::UpdateSolution ( )
inline

Definition at line 669 of file TimeIntegrationScheme.h.

References m_solVector.

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

Definition at line 659 of file TimeIntegrationScheme.h.

References m_solVector.

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

Definition at line 679 of file TimeIntegrationScheme.h.

References m_t.

680  {
681  return m_t;
682  }

Member Data Documentation

TimeIntegrationSchemeSharedPtr Nektar::LibUtilities::TimeIntegrationSolution::m_scheme
private
TripleArray Nektar::LibUtilities::TimeIntegrationSolution::m_solVector
private
Array<OneD,NekDouble> Nektar::LibUtilities::TimeIntegrationSolution::m_t
private