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

A base class for describing how to solve specific equations. More...

#include <EquationSystem.h>

Inheritance diagram for Nektar::SolverUtils::EquationSystem:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SolverUtils::EquationSystem:
Collaboration graph
[legend]

Public Member Functions

virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor.
SOLVER_UTILS_EXPORT void SetUpTraceNormals (void)
SOLVER_UTILS_EXPORT void InitObject ()
 Initialises the members of this object.
SOLVER_UTILS_EXPORT void DoInitialise ()
 Perform any initialisation necessary before solving the problem.
SOLVER_UTILS_EXPORT void DoSolve ()
 Solve the problem.
SOLVER_UTILS_EXPORT void TransCoeffToPhys ()
 Transform from coefficient to physical space.
SOLVER_UTILS_EXPORT void TransPhysToCoeff ()
 Transform from physical to coefficient space.
SOLVER_UTILS_EXPORT void Output ()
 Perform output operations after solve.
SOLVER_UTILS_EXPORT NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation.
SOLVER_UTILS_EXPORT std::string GetSessionName ()
 Get Session name.
SOLVER_UTILS_EXPORT void ResetSessionName (std::string newname)
 Reset Session name.
SOLVER_UTILS_EXPORT
LibUtilities::SessionReaderSharedPtr 
GetSession ()
 Get Session name.
SOLVER_UTILS_EXPORT
MultiRegions::ExpListSharedPtr 
GetPressure ()
 Get pressure field if available.
SOLVER_UTILS_EXPORT void PrintSummary (std::ostream &out)
 Print a summary of parameters and solver characteristics.
SOLVER_UTILS_EXPORT void SetLambda (NekDouble lambda)
 Set parameter m_lambda.
SOLVER_UTILS_EXPORT void EvaluateFunction (Array< OneD, Array< OneD, NekDouble > > &pArray, std::string pFunctionName, const NekDouble pTime=0.0, const int domain=0)
 Evaluates a function as specified in the session file.
SOLVER_UTILS_EXPORT void EvaluateFunction (std::vector< std::string > pFieldNames, Array< OneD, Array< OneD, NekDouble > > &pFields, const std::string &pName, const int domain=0)
 Populate given fields with the function from session.
SOLVER_UTILS_EXPORT void EvaluateFunction (std::vector< std::string > pFieldNames, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const std::string &pName, const int domain=0)
 Populate given fields with the function from session.
SOLVER_UTILS_EXPORT void EvaluateFunction (std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, const NekDouble &pTime=0.0, const int domain=0)
SOLVER_UTILS_EXPORT std::string DescribeFunction (std::string pFieldName, const std::string &pFunctionName, const int domain)
 Provide a description of a function for a given field name.
SOLVER_UTILS_EXPORT void InitialiseBaseFlow (Array< OneD, Array< OneD, NekDouble > > &base)
 Perform initialisation of the base flow.
SOLVER_UTILS_EXPORT void SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Initialise the data in the dependent fields.
SOLVER_UTILS_EXPORT void EvaluateExactSolution (int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 Evaluates an exact solution.
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised=false)
 Compute the L2 error between fields and a given exact solution.
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, bool Normalised=false)
 Compute the L2 error of the fields.
SOLVER_UTILS_EXPORT Array
< OneD, NekDouble
ErrorExtraPoints (unsigned int field)
 Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf].
SOLVER_UTILS_EXPORT void WeakAdvectionGreensDivergenceForm (const Array< OneD, Array< OneD, NekDouble > > &F, Array< OneD, NekDouble > &outarray)
 Compute the inner product $ (\nabla \phi \cdot F) $.
SOLVER_UTILS_EXPORT void WeakAdvectionDivergenceForm (const Array< OneD, Array< OneD, NekDouble > > &F, Array< OneD, NekDouble > &outarray)
 Compute the inner product $ (\phi, \nabla \cdot F) $.
SOLVER_UTILS_EXPORT void WeakAdvectionNonConservativeForm (const Array< OneD, Array< OneD, NekDouble > > &V, const Array< OneD, const NekDouble > &u, Array< OneD, NekDouble > &outarray, bool UseContCoeffs=false)
 Compute the inner product $ (\phi, V\cdot \nabla u) $.
f SOLVER_UTILS_EXPORT void AdvectionNonConservativeForm (const Array< OneD, Array< OneD, NekDouble > > &V, const Array< OneD, const NekDouble > &u, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wk=NullNekDouble1DArray)
 Compute the non-conservative advection.
SOLVER_UTILS_EXPORT void WeakDGAdvection (const Array< OneD, Array< OneD, NekDouble > > &InField, Array< OneD, Array< OneD, NekDouble > > &OutField, bool NumericalFluxIncludesNormal=true, bool InFieldIsInPhysSpace=false, int nvariables=0)
 Calculate the weak discontinuous Galerkin advection.
SOLVER_UTILS_EXPORT void WeakDGDiffusion (const Array< OneD, Array< OneD, NekDouble > > &InField, Array< OneD, Array< OneD, NekDouble > > &OutField, bool NumericalFluxIncludesNormal=true, bool InFieldIsInPhysSpace=false)
 Calculate weak DG Diffusion in the LDG form.
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n)
 Write checkpoint file of m_fields.
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write checkpoint file of custom data fields.
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname)
 Write field data to the given filename.
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname, MultiRegions::ExpListSharedPtr &field, std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 Write input fields to the given filename.
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Input field data from the given file.
SOLVER_UTILS_EXPORT void ImportFldToMultiDomains (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int ndomains)
 Input field data from the given file to multiple domains.
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, std::vector< std::string > &fieldStr, Array< OneD, Array< OneD, NekDouble > > &coeffs)
 Output a field. Input field data into array from the given file.
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, MultiRegions::ExpListSharedPtr &pField, std::string &pFieldName)
 Output a field. Input field data into ExpList from the given file.
SOLVER_UTILS_EXPORT void ScanForHistoryPoints ()
 Builds map of which element holds each history point.
SOLVER_UTILS_EXPORT void WriteHistoryData (std::ostream &out)
 Probe each history point and write to file.
SOLVER_UTILS_EXPORT void SessionSummary (SummaryList &vSummary)
 Write out a session summary.
SOLVER_UTILS_EXPORT Array
< OneD,
MultiRegions::ExpListSharedPtr > & 
UpdateFields ()
SOLVER_UTILS_EXPORT
LibUtilities::FieldMetaDataMap
UpdateFieldMetaDataMap ()
 Get hold of FieldInfoMap so it can be updated.
SOLVER_UTILS_EXPORT NekDouble GetFinalTime ()
 Return final time.
SOLVER_UTILS_EXPORT int GetNcoeffs ()
SOLVER_UTILS_EXPORT int GetNcoeffs (const int eid)
SOLVER_UTILS_EXPORT int GetNumExpModes ()
SOLVER_UTILS_EXPORT const
Array< OneD, int > 
GetNumExpModesPerExp ()
SOLVER_UTILS_EXPORT int GetNvariables ()
SOLVER_UTILS_EXPORT const
std::string 
GetVariable (unsigned int i)
SOLVER_UTILS_EXPORT int GetTraceTotPoints ()
SOLVER_UTILS_EXPORT int GetTraceNpoints ()
SOLVER_UTILS_EXPORT int GetExpSize ()
SOLVER_UTILS_EXPORT int GetPhys_Offset (int n)
SOLVER_UTILS_EXPORT int GetCoeff_Offset (int n)
SOLVER_UTILS_EXPORT int GetTotPoints ()
SOLVER_UTILS_EXPORT int GetTotPoints (int n)
SOLVER_UTILS_EXPORT int GetNpoints ()
SOLVER_UTILS_EXPORT int GetNumElmVelocity ()
SOLVER_UTILS_EXPORT int GetSteps ()
SOLVER_UTILS_EXPORT NekDouble GetTimeStep ()
SOLVER_UTILS_EXPORT void CopyFromPhysField (const int i, Array< OneD, NekDouble > &output)
SOLVER_UTILS_EXPORT void CopyToPhysField (const int i, Array< OneD, NekDouble > &output)
SOLVER_UTILS_EXPORT void SetStepsToOne ()
SOLVER_UTILS_EXPORT void ZeroPhysFields ()
SOLVER_UTILS_EXPORT void FwdTransFields ()
SOLVER_UTILS_EXPORT void GetFluxVector (const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
SOLVER_UTILS_EXPORT void GetFluxVector (const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &fluxX, Array< OneD, Array< OneD, NekDouble > > &fluxY)
SOLVER_UTILS_EXPORT void GetFluxVector (const int i, const int j, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
SOLVER_UTILS_EXPORT void NumericalFlux (Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
SOLVER_UTILS_EXPORT void NumericalFlux (Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numfluxX, Array< OneD, Array< OneD, NekDouble > > &numfluxY)
SOLVER_UTILS_EXPORT void NumFluxforScalar (const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &uflux)
SOLVER_UTILS_EXPORT void NumFluxforVector (const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux)
SOLVER_UTILS_EXPORT void SetModifiedBasis (const bool modbasis)
SOLVER_UTILS_EXPORT int NoCaseStringCompare (const string &s1, const string &s2)
 Perform a case-insensitive string comparison.

Protected Types

enum  HomogeneousType { eHomogeneous1D, eHomogeneous2D, eHomogeneous3D, eNotHomogeneous }
 Parameter for homogeneous expansions. More...

Protected Member Functions

SOLVER_UTILS_EXPORT EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession)
 Initialises EquationSystem class members.
int nocase_cmp (const string &s1, const string &s2)
virtual SOLVER_UTILS_EXPORT void v_InitObject ()
 Initialisation object for EquationSystem.
SOLVER_UTILS_EXPORT void SetBoundaryConditions (NekDouble time)
 Evaluates the boundary conditions at the given time.
virtual SOLVER_UTILS_EXPORT void v_DoInitialise ()
 Virtual function for initialisation implementation.
virtual SOLVER_UTILS_EXPORT void v_DoSolve ()
 Virtual function for solve implementation.
virtual SOLVER_UTILS_EXPORT
NekDouble 
v_LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Virtual function for the L_inf error computation between fields and a given exact solution.
virtual SOLVER_UTILS_EXPORT
NekDouble 
v_L2Error (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false)
 Virtual function for the L_2 error computation between fields and a given exact solution.
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys ()
 Virtual function for transformation to physical space.
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff ()
 Virtual function for transformation to coefficient space.
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary (SummaryList &l)
 Virtual function for generating summary information.
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
virtual SOLVER_UTILS_EXPORT void v_EvaluateExactSolution (unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
SOLVER_UTILS_EXPORT void SetUpBaseFields (SpatialDomains::MeshGraphSharedPtr &mesh)
SOLVER_UTILS_EXPORT void ImportFldBase (std::string pInfile, SpatialDomains::MeshGraphSharedPtr pGraph)
virtual SOLVER_UTILS_EXPORT void v_Output (void)
virtual SOLVER_UTILS_EXPORT
MultiRegions::ExpListSharedPtr 
v_GetPressure (void)
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)

Protected Attributes

LibUtilities::CommSharedPtr m_comm
 Communicator.
LibUtilities::SessionReaderSharedPtr m_session
 The session reader.
LibUtilities::FieldIOSharedPtr m_fld
 Field input/output.
Array< OneD,
MultiRegions::ExpListSharedPtr
m_fields
 Array holding all dependent variables.
Array< OneD,
MultiRegions::ExpListSharedPtr
m_base
 Base fields.
Array< OneD,
MultiRegions::ExpListSharedPtr
m_derivedfields
 Array holding all dependent variables.
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
 Pointer to boundary conditions object.
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to graph defining mesh.
std::string m_filename
 Filename.
std::string m_sessionName
 Name of the session.
NekDouble m_time
 Current time of simulation.
NekDouble m_fintime
 Finish time of the simulation.
NekDouble m_timestep
 Time step size.
NekDouble m_lambda
 Lambda constant in real system if one required.
NekDouble m_checktime
 Time between checkpoints.
int m_steps
 Number of steps to take.
int m_checksteps
 Number of steps between checkpoints.
int m_spacedim
 Spatial dimension (>= expansion dim).
int m_expdim
 Expansion dimension.
bool m_SingleMode
 Flag to determine if single homogeneous mode is used.
bool m_HalfMode
 Flag to determine if half homogeneous mode is used.
bool m_MultipleModes
 Flag to determine if use multiple homogenenous modes are used.
bool m_useFFT
 Flag to determine if FFT is used for homogeneous transform.
bool m_homogen_dealiasing
 Flag to determine if dealiasing is used for homogeneous simulations.
bool m_specHP_dealiasing
 Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
enum MultiRegions::ProjectionType m_projectionType
 Type of projection; e.g continuous or discontinuous.
Array< OneD, Array< OneD,
NekDouble > > 
m_traceNormals
 Array holding trace normals for DG simulations in the forwards direction.
Array< OneD, Array< OneD,
Array< OneD, NekDouble > > > 
m_gradtan
 1 x nvariable x nq
Array< OneD, Array< OneD,
Array< OneD, NekDouble > > > 
m_tanbasis
 2 x m_spacedim x nq
Array< OneD, bool > m_checkIfSystemSingular
 Flag to indicate if the fields should be checked for singularity.
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
 Map to identify relevant solver info to dump in output fields.
int m_NumQuadPointsError
 Number of Quadrature points used to work out the error.
enum HomogeneousType m_HomogeneousType
NekDouble m_LhomX
 physical length in X direction (if homogeneous)
NekDouble m_LhomY
 physical length in Y direction (if homogeneous)
NekDouble m_LhomZ
 physical length in Z direction (if homogeneous)
int m_npointsX
 number of points in X direction (if homogeneous)
int m_npointsY
 number of points in Y direction (if homogeneous)
int m_npointsZ
 number of points in Z direction (if homogeneous)
int m_HomoDirec
 number of homogenous directions
int m_NumMode
 Mode to use in case of single mode analysis.

Private Member Functions

virtual SOLVER_UTILS_EXPORT
Array< OneD, bool > 
v_GetSystemSingularChecks ()
virtual SOLVER_UTILS_EXPORT void v_GetFluxVector (const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
virtual SOLVER_UTILS_EXPORT void v_GetFluxVector (const int i, const int j, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &flux)
virtual SOLVER_UTILS_EXPORT void v_GetFluxVector (const int i, Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &fluxX, Array< OneD, Array< OneD, NekDouble > > &fluxY)
virtual SOLVER_UTILS_EXPORT void v_NumericalFlux (Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numflux)
virtual SOLVER_UTILS_EXPORT void v_NumericalFlux (Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numfluxX, Array< OneD, Array< OneD, NekDouble > > &numfluxY)
virtual SOLVER_UTILS_EXPORT void v_NumFluxforScalar (const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &uflux)
virtual SOLVER_UTILS_EXPORT void v_NumFluxforVector (const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux)

Detailed Description

A base class for describing how to solve specific equations.

This class is a base class for all solver implementations. It provides the underlying generic functionality and interface for solving equations.

To solve a steady-state equation, create a derived class from this class and reimplement the virtual functions to provide custom implementation for the problem.

To solve unsteady problems, derive from the UnsteadySystem class instead which provides general time integration.

Definition at line 66 of file EquationSystem.h.

Member Enumeration Documentation

Parameter for homogeneous expansions.

Enumerator:
eHomogeneous1D 
eHomogeneous2D 
eHomogeneous3D 
eNotHomogeneous 

Definition at line 464 of file EquationSystem.h.

Constructor & Destructor Documentation

Nektar::SolverUtils::EquationSystem::~EquationSystem ( )
virtual

Destructor.

Destructor for class EquationSystem.

Definition at line 660 of file EquationSystem.cpp.

Nektar::SolverUtils::EquationSystem::EquationSystem ( const LibUtilities::SessionReaderSharedPtr pSession)
protected

Initialises EquationSystem class members.

This constructor is protected as the objects of this class are never instantiated directly.

Parameters
pSessionThe session reader holding problem parameters.

Definition at line 93 of file EquationSystem.cpp.

: m_comm (pSession->GetComm()),
m_session (pSession),
m_lambda (0),
{
}

Member Function Documentation

void Nektar::SolverUtils::EquationSystem::AdvectionNonConservativeForm ( const Array< OneD, Array< OneD, NekDouble > > &  V,
const Array< OneD, const NekDouble > &  u,
Array< OneD, NekDouble > &  outarray,
Array< OneD, NekDouble > &  wk = NullNekDouble1DArray 
)

Compute the non-conservative advection.

Calculate the inner product $ V\cdot \nabla u $

Parameters
VFields.
uFields.
outarrayStorage for result.
wkWorkspace.

Definition at line 1517 of file EquationSystem.cpp.

References ASSERTL0, m_fields, Vmath::Vmul(), and Vmath::Vvtvp().

Referenced by Nektar::CFLtester::DoOdeRhs(), Nektar::EigenValuesAdvection::v_DoSolve(), and WeakAdvectionNonConservativeForm().

{
// Use dimension of Velocity vector to dictate dimension of operation
int ndim = V.num_elements();
//int ndim = m_expdim;
// ToDo: here we should add a check that V has right dimension
int nPointsTot = m_fields[0]->GetNpoints();
Array<OneD, NekDouble> grad0,grad1,grad2;
// Check to see if wk space is defined
if (wk.num_elements())
{
grad0 = wk;
}
else
{
grad0 = Array<OneD, NekDouble> (nPointsTot);
}
// Evaluate V\cdot Grad(u)
switch(ndim)
{
case 1:
m_fields[0]->PhysDeriv(u,grad0);
Vmath::Vmul(nPointsTot, grad0, 1, V[0], 1, outarray,1);
break;
case 2:
grad1 = Array<OneD, NekDouble> (nPointsTot);
m_fields[0]->PhysDeriv(u, grad0, grad1);
Vmath::Vmul (nPointsTot, grad0, 1, V[0], 1, outarray, 1);
Vmath::Vvtvp(nPointsTot, grad1, 1, V[1], 1,
outarray, 1, outarray, 1);
break;
case 3:
grad1 = Array<OneD, NekDouble> (nPointsTot);
grad2 = Array<OneD, NekDouble> (nPointsTot);
m_fields[0]->PhysDeriv(u,grad0,grad1,grad2);
Vmath::Vmul (nPointsTot, grad0, 1, V[0], 1, outarray, 1);
Vmath::Vvtvp(nPointsTot, grad1, 1, V[1], 1,
outarray, 1, outarray, 1);
Vmath::Vvtvp(nPointsTot, grad2, 1, V[2], 1,
outarray, 1, outarray, 1);
break;
default:
ASSERTL0(false,"dimension unknown");
}
}
void Nektar::SolverUtils::EquationSystem::Checkpoint_Output ( const int  n)

Write checkpoint file of m_fields.

Write the n-th checkpoint file.

Parameters
nThe index of the checkpoint file.

Definition at line 1857 of file EquationSystem.cpp.

References m_sessionName, and WriteFld().

Referenced by Nektar::SolverUtils::UnsteadySystem::v_DoSolve(), Nektar::CoupledLinearNS::v_DoSolve(), Nektar::NavierStokesCFE::v_SetInitialConditions(), Nektar::EulerCFE::v_SetInitialConditions(), Nektar::EulerADCFE::v_SetInitialConditions(), and v_SetInitialConditions().

{
std::string outname = m_sessionName + "_" +
boost::lexical_cast<std::string>(n);
WriteFld(outname + ".chk");
}
void Nektar::SolverUtils::EquationSystem::Checkpoint_Output ( const int  n,
MultiRegions::ExpListSharedPtr field,
std::vector< Array< OneD, NekDouble > > &  fieldcoeffs,
std::vector< std::string > &  variables 
)

Write checkpoint file of custom data fields.

Write the n-th checkpoint file.

Parameters
nThe index of the checkpoint file.

Definition at line 1869 of file EquationSystem.cpp.

References m_sessionName, and WriteFld().

{
char chkout[16] = "";
sprintf(chkout, "%d", n);
std::string outname = m_sessionName + "_" + chkout + ".chk";
WriteFld(outname, field, fieldcoeffs, variables);
}
void Nektar::SolverUtils::EquationSystem::CopyFromPhysField ( const int  i,
Array< OneD, NekDouble > &  output 
)
inline

Definition at line 833 of file EquationSystem.h.

References m_fields, and Vmath::Vcopy().

{
Vmath::Vcopy(output.num_elements(), m_fields[i]->GetPhys(), 1, output, 1 );
}
void Nektar::SolverUtils::EquationSystem::CopyToPhysField ( const int  i,
Array< OneD, NekDouble > &  output 
)
inline

Definition at line 839 of file EquationSystem.h.

References m_fields, and Vmath::Vcopy().

{
Vmath::Vcopy(output.num_elements(), output, 1, m_fields[i]->UpdatePhys(), 1 );
}
std::string Nektar::SolverUtils::EquationSystem::DescribeFunction ( std::string  pFieldName,
const std::string &  pFunctionName,
const int  domain 
)

Provide a description of a function for a given field name.

Parameters
pFieldNameField name.
pFunctionNameFunction name.

Definition at line 836 of file EquationSystem.cpp.

References ASSERTL0, Nektar::LibUtilities::eFunctionTypeExpression, Nektar::LibUtilities::eFunctionTypeFile, and m_session.

Referenced by v_SetInitialConditions().

{
ASSERTL0(m_session->DefinesFunction(pFunctionName),
"Function '" + pFunctionName + "' does not exist.");
std::string retVal;
vType = m_session->GetFunctionType(pFunctionName, pFieldName);
{
= m_session->GetFunction(pFunctionName, pFieldName,domain);
retVal = ffunc->GetExpression();
}
{
std::string filename
= m_session->GetFunctionFilename(pFunctionName, pFieldName,domain);
retVal = "from file " + filename;
}
return retVal;
}
void Nektar::SolverUtils::EquationSystem::DoInitialise ( )
inline

Perform any initialisation necessary before solving the problem.

This allows initialisation of the solver which cannot be completed during object construction (such as setting of initial conditions).

Public interface routine to virtual function implementation.

Definition at line 613 of file EquationSystem.h.

References v_DoInitialise().

void Nektar::SolverUtils::EquationSystem::DoSolve ( void  )
inline

Solve the problem.

Performs the actual solve.

Public interface routine to virtual function implementation.

Definition at line 645 of file EquationSystem.h.

References v_DoSolve().

{
}
Array< OneD, NekDouble > Nektar::SolverUtils::EquationSystem::ErrorExtraPoints ( unsigned int  field)

Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf].

Compute the error in the L2-norm, L-inf for a larger number of quadrature points.

Parameters
fieldThe field to compare.
Returns
Error in the L2-norm and L-inf norm.

Definition at line 996 of file EquationSystem.cpp.

References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::LibUtilities::eModified_A, Nektar::LibUtilities::eModified_B, GetNumExpModes(), m_fields, m_graph, m_NumQuadPointsError, m_session, and m_time.

Referenced by v_L2Error(), and v_LinfError().

{
int NumModes = GetNumExpModes();
Array<OneD,NekDouble> L2INF(2);
const LibUtilities::BasisKey BkeyT1(
LibUtilities::eModified_A,NumModes, PkeyT1);
const LibUtilities::BasisKey BkeyT2(
LibUtilities::eModified_B, NumModes, PkeyT2);
const LibUtilities::BasisKey BkeyQ1(
LibUtilities::eModified_A, NumModes, PkeyQ1);
const LibUtilities::BasisKey BkeyQ2(
LibUtilities::eModified_A, NumModes, PkeyQ2);
m_session, BkeyT1, BkeyT2, BkeyQ1, BkeyQ2, m_graph);
int ErrorCoordim = ErrorExp->GetCoordim(0);
int ErrorNq = ErrorExp->GetTotPoints();
Array<OneD,NekDouble> ErrorXc0(ErrorNq, 0.0);
Array<OneD,NekDouble> ErrorXc1(ErrorNq, 0.0);
Array<OneD,NekDouble> ErrorXc2(ErrorNq, 0.0);
switch(ErrorCoordim)
{
case 1:
ErrorExp->GetCoords(ErrorXc0);
break;
case 2:
ErrorExp->GetCoords(ErrorXc0, ErrorXc1);
break;
case 3:
ErrorExp->GetCoords(ErrorXc0, ErrorXc1, ErrorXc2);
break;
}
m_session->GetFunction("ExactSolution", field);
// Evaluate the exact solution
Array<OneD,NekDouble> ErrorSol(ErrorNq);
exSol->Evaluate(ErrorXc0,ErrorXc1,ErrorXc2,m_time,ErrorSol);
// Calcualte spectral/hp approximation on the quadrature points
// of this new expansion basis
ErrorExp->BwdTrans_IterPerExp(m_fields[field]->GetCoeffs(),
ErrorExp->UpdatePhys());
L2INF[0] = ErrorExp->L2 (ErrorExp->GetPhys(), ErrorSol);
L2INF[1] = ErrorExp->Linf(ErrorExp->GetPhys(), ErrorSol);
return L2INF;
}
void Nektar::SolverUtils::EquationSystem::EvaluateExactSolution ( int  field,
Array< OneD, NekDouble > &  outfield,
const NekDouble  time 
)
inline

Evaluates an exact solution.

Definition at line 724 of file EquationSystem.h.

References v_EvaluateExactSolution().

{
v_EvaluateExactSolution(field, outfield, time);
}
void Nektar::SolverUtils::EquationSystem::EvaluateFunction ( Array< OneD, Array< OneD, NekDouble > > &  pArray,
std::string  pFunctionName,
const NekDouble  pTime = 0.0,
const int  domain = 0 
)

Evaluates a function as specified in the session file.

Evaluates a physical function at each quadrature point in the domain.

Parameters
pArrayThe array into which to write the values.
pEqnThe equation to evaluate.

Definition at line 674 of file EquationSystem.cpp.

References ASSERTL0, and m_session.

Referenced by Nektar::APE::AddSource(), Nektar::CoupledLinearNS::DefineForcingTerm(), Nektar::ShallowWaterSystem::EvaluateCoriolis(), EvaluateFunction(), Nektar::ShallowWaterSystem::EvaluateWaterDepth(), InitialiseBaseFlow(), Nektar::SteadyAdvectionDiffusion::v_DoInitialise(), Nektar::CoupledLinearNS::v_DoInitialise(), v_EvaluateExactSolution(), Nektar::APE::v_GetFluxVector(), Nektar::Poisson::v_InitObject(), Nektar::EigenValuesAdvection::v_InitObject(), Nektar::Monodomain::v_InitObject(), Nektar::UnsteadyAdvection::v_InitObject(), Nektar::CFLtester::v_InitObject(), Nektar::UnsteadyAdvectionDiffusion::v_InitObject(), Nektar::PulseWaveSystem::v_InitObject(), Nektar::PulseWaveSystem::v_L2Error(), v_L2Error(), Nektar::PulseWaveSystem::v_LinfError(), v_LinfError(), and v_SetInitialConditions().

{
ASSERTL0(m_session->DefinesFunction(pFunctionName),
"Function '" + pFunctionName + "' does not exist.");
std::vector<std::string> vFieldNames = m_session->GetVariables();
for(int i = 0 ; i < vFieldNames.size(); i++)
{
EvaluateFunction(vFieldNames[i], pArray[i], pFunctionName,
pTime, domain);
}
}
void Nektar::SolverUtils::EquationSystem::EvaluateFunction ( std::vector< std::string >  pFieldNames,
Array< OneD, Array< OneD, NekDouble > > &  pFields,
const std::string &  pFunctionName,
const int  domain = 0 
)

Populate given fields with the function from session.

Populates a forcing function for each of the dependent variables using the expression provided by the BoundaryConditions object.

Parameters
forceArray of fields to assign forcing.

Definition at line 697 of file EquationSystem.cpp.

References ASSERTL0, ASSERTL1, EvaluateFunction(), and m_session.

{
ASSERTL1(pFieldNames.size() == pFields.num_elements(),
"Function '" + pFunctionName
+ "' variable list size mismatch with array storage.");
ASSERTL0(m_session->DefinesFunction(pFunctionName),
"Function '" + pFunctionName + "' does not exist.");
for(int i = 0; i < pFieldNames.size(); i++)
{
EvaluateFunction(pFieldNames[i], pFields[i], pFunctionName,0.0,domain);
}
}
void Nektar::SolverUtils::EquationSystem::EvaluateFunction ( std::vector< std::string >  pFieldNames,
Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const std::string &  pFunctionName,
const int  domain = 0 
)

Populate given fields with the function from session.

Populates a function for each of the dependent variables using the expression or filenames provided by the SessionReader object.

Parameters
forceArray of fields to assign forcing.

Definition at line 720 of file EquationSystem.cpp.

References ASSERTL0, EvaluateFunction(), and m_session.

{
ASSERTL0(m_session->DefinesFunction(pFunctionName),
"Function '" + pFunctionName + "' does not exist.");
ASSERTL0(pFieldNames.size() == pFields.num_elements(),
"Field list / name list size mismatch.");
for(int i = 0; i < pFieldNames.size(); i++)
{
EvaluateFunction(pFieldNames[i], pFields[i]->UpdatePhys(),
pFunctionName, 0.0, domain);
pFields[i]->FwdTrans_IterPerExp(pFields[i]->GetPhys(),
pFields[i]->UpdateCoeffs());
}
}
void Nektar::SolverUtils::EquationSystem::EvaluateFunction ( std::string  pFieldName,
Array< OneD, NekDouble > &  pArray,
const std::string &  pFunctionName,
const NekDouble pTime = 0.0,
const int  domain = 0 
)

Definition at line 742 of file EquationSystem.cpp.

References ASSERTL0, Nektar::LibUtilities::eFunctionTypeExpression, Nektar::LibUtilities::eFunctionTypeFile, GetNcoeffs(), m_fields, m_fld, m_session, Nektar::LibUtilities::NullFieldMetaDataMap, and Vmath::Zero().

{
ASSERTL0(m_session->DefinesFunction(pFunctionName),
"Function '" + pFunctionName + "' does not exist.");
unsigned int nq = m_fields[0]->GetNpoints();
if (pArray.num_elements() < nq)
{
pArray = Array<OneD, NekDouble>(nq);
}
vType = m_session->GetFunctionType(pFunctionName, pFieldName,domain);
{
Array<OneD,NekDouble> x0(nq);
Array<OneD,NekDouble> x1(nq);
Array<OneD,NekDouble> x2(nq);
// Get the coordinates (assuming all fields have the same
// discretisation)
m_fields[0]->GetCoords(x0,x1,x2);
= m_session->GetFunction(pFunctionName, pFieldName,domain);
ffunc->Evaluate(x0,x1,x2,pTime,pArray);
}
{
std::string filename
= m_session->GetFunctionFilename(pFunctionName, pFieldName,domain);
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
Array<OneD, NekDouble> vCoeffs(m_fields[0]->GetNcoeffs());
Vmath::Zero(vCoeffs.num_elements(),vCoeffs,1);
int numexp = m_fields[0]->GetExpSize();
Array<OneD,int> ElementGIDs(numexp);
// Define list of global element ids
for(int i = 0; i < numexp; ++i)
{
ElementGIDs[i] = m_fields[0]->GetExp(i)->GetGeom()->GetGlobalID();
}
m_fld->Import(filename,FieldDef,FieldData,
ElementGIDs);
int idx = -1;
// Loop over all the expansions
for (int i = 0; i < FieldDef.size(); ++i)
{
// Find the index of the required field in the
// expansion segment
for(int j = 0; j < FieldDef[i]->m_fields.size(); ++j)
{
if (FieldDef[i]->m_fields[j] == pFieldName)
{
idx = j;
}
}
if (idx >= 0)
{
m_fields[0]->ExtractDataToCoeffs(
FieldDef[i], FieldData[i],
FieldDef[i]->m_fields[idx], vCoeffs);
}
else
{
cout << "Field " + pFieldName + " not found." << endl;
}
}
m_fields[0]->BwdTrans_IterPerExp(vCoeffs, pArray);
}
}
void Nektar::SolverUtils::EquationSystem::FwdTransFields ( void  )

FwdTrans the m_fields members

Definition at line 1412 of file EquationSystem.cpp.

References m_fields.

{
for (int i = 0; i < m_fields.num_elements(); i++)
{
m_fields[i]->FwdTrans(m_fields[i]->GetPhys(),
m_fields[i]->UpdateCoeffs());
m_fields[i]->SetPhysState(false);
}
}
int Nektar::SolverUtils::EquationSystem::GetCoeff_Offset ( int  n)
inline

Definition at line 793 of file EquationSystem.h.

References m_fields.

{
return m_fields[0]->GetCoeff_Offset(n);
}
int Nektar::SolverUtils::EquationSystem::GetExpSize ( void  )
inline

Definition at line 783 of file EquationSystem.h.

References m_fields.

{
return m_fields[0]->GetExpSize();
}
NekDouble Nektar::SolverUtils::EquationSystem::GetFinalTime ( )
inline

Return final time.

Definition at line 737 of file EquationSystem.h.

References m_time.

{
return m_time;
}
void Nektar::SolverUtils::EquationSystem::GetFluxVector ( const int  i,
Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  flux 
)
inline

Definition at line 845 of file EquationSystem.h.

References v_GetFluxVector().

Referenced by Nektar::APE::DoOdeRhs(), WeakDGAdvection(), and WeakDGDiffusion().

{
v_GetFluxVector(i,physfield, flux);
}
void Nektar::SolverUtils::EquationSystem::GetFluxVector ( const int  i,
Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  fluxX,
Array< OneD, Array< OneD, NekDouble > > &  fluxY 
)
inline

Definition at line 852 of file EquationSystem.h.

References v_GetFluxVector().

{
v_GetFluxVector(i,physfield, fluxX, fluxY);
}
void Nektar::SolverUtils::EquationSystem::GetFluxVector ( const int  i,
const int  j,
Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  flux 
)
inline

Definition at line 860 of file EquationSystem.h.

References v_GetFluxVector().

{
v_GetFluxVector(i,j,physfield,flux);
}
int Nektar::SolverUtils::EquationSystem::GetNcoeffs ( void  )
inline
int Nektar::SolverUtils::EquationSystem::GetNcoeffs ( const int  eid)
inline

Definition at line 747 of file EquationSystem.h.

References m_fields.

{
return m_fields[0]->GetNcoeffs(eid);
}
int Nektar::SolverUtils::EquationSystem::GetNpoints ( void  )
inline

Definition at line 808 of file EquationSystem.h.

References m_fields.

Referenced by Nektar::ImageWarpingSystem::DoOdeProjection(), Nektar::NonlinearSWE::DoOdeProjection(), Nektar::LinearSWE::DoOdeProjection(), Nektar::UnsteadyInviscidBurger::DoOdeProjection(), Nektar::UnsteadyDiffusion::DoOdeProjection(), Nektar::NavierStokesCFE::DoOdeProjection(), Nektar::EulerCFE::DoOdeProjection(), Nektar::EulerADCFE::DoOdeProjection(), Nektar::UnsteadyAdvection::DoOdeProjection(), Nektar::UnsteadyAdvectionDiffusion::DoOdeProjection(), Nektar::CFLtester::DoOdeProjection(), Nektar::ImageWarpingSystem::DoOdeRhs(), Nektar::UnsteadyInviscidBurger::DoOdeRhs(), Nektar::NavierStokesCFE::DoOdeRhs(), Nektar::EulerCFE::DoOdeRhs(), Nektar::EulerADCFE::DoOdeRhs(), Nektar::UnsteadyAdvection::DoOdeRhs(), Nektar::UnsteadyAdvectionDiffusion::DoOdeRhs(), Nektar::CFLtester::DoOdeRhs(), Nektar::UnsteadyInviscidBurger::GetFluxVector(), Nektar::UnsteadyDiffusion::GetFluxVector(), Nektar::UnsteadyAdvectionDiffusion::GetFluxVectorDiff(), Nektar::UnsteadyInviscidBurger::GetNormalVelocity(), Nektar::SolverUtils::UnsteadySystem::v_AppendOutput1D(), Nektar::EigenValuesAdvection::v_DoSolve(), Nektar::EigenValuesAdvection::v_GetFluxVector(), Nektar::ImageWarpingSystem::v_GetFluxVector(), Nektar::CFLtester::v_GetFluxVector(), Nektar::IncNavierStokes::v_GetFluxVector(), Nektar::PulseWaveSystem::v_L2Error(), v_L2Error(), Nektar::PulseWaveSystem::v_LinfError(), v_LinfError(), WeakDGAdvection(), WeakDGDiffusion(), and ZeroPhysFields().

{
return m_fields[0]->GetNpoints();
}
int Nektar::SolverUtils::EquationSystem::GetNumElmVelocity ( void  )
inline

Definition at line 813 of file EquationSystem.h.

References m_fields.

{
return (m_fields.num_elements() - 1);
}
int Nektar::SolverUtils::EquationSystem::GetNumExpModes ( void  )
inline

Definition at line 752 of file EquationSystem.h.

References m_graph.

Referenced by ErrorExtraPoints().

{
return m_graph->GetExpansions().begin()->second->m_basisKeyVector[0]
.GetNumModes();
}
const Array< OneD, int > Nektar::SolverUtils::EquationSystem::GetNumExpModesPerExp ( void  )
inline

Definition at line 758 of file EquationSystem.h.

References m_fields.

Referenced by Nektar::EulerADCFE::DoOdeRhs(), and Nektar::IncNavierStokes::GetElmtCFLVals().

{
return m_fields[0]->EvalBasisNumModesMaxPerExp();
}
int Nektar::SolverUtils::EquationSystem::GetNvariables ( void  )
inline

Definition at line 763 of file EquationSystem.h.

References m_session.

Referenced by ImportFldToMultiDomains().

{
return m_session->GetVariables().size();
}
int Nektar::SolverUtils::EquationSystem::GetPhys_Offset ( int  n)
inline
MultiRegions::ExpListSharedPtr Nektar::SolverUtils::EquationSystem::GetPressure ( void  )
inline
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr Nektar::SolverUtils::EquationSystem::GetSession ( )
inline

Get Session name.

Definition at line 110 of file EquationSystem.h.

References m_session.

{
return m_session;
}
SOLVER_UTILS_EXPORT std::string Nektar::SolverUtils::EquationSystem::GetSessionName ( )
inline

Get Session name.

Definition at line 97 of file EquationSystem.h.

References m_sessionName.

{
return m_sessionName;
}
int Nektar::SolverUtils::EquationSystem::GetSteps ( void  )
inline

Definition at line 818 of file EquationSystem.h.

References m_steps.

{
return m_steps;
}
NekDouble Nektar::SolverUtils::EquationSystem::GetTimeStep ( void  )
inline

Definition at line 823 of file EquationSystem.h.

References m_timestep.

Referenced by Nektar::SolverUtils::UnsteadySystem::v_DoSolve().

{
return m_timestep;
}
int Nektar::SolverUtils::EquationSystem::GetTotPoints ( void  )
inline
int Nektar::SolverUtils::EquationSystem::GetTotPoints ( int  n)
inline

Definition at line 803 of file EquationSystem.h.

References m_fields.

{
return m_fields[0]->GetTotPoints(n);
}
int Nektar::SolverUtils::EquationSystem::GetTraceNpoints ( void  )
inline
int Nektar::SolverUtils::EquationSystem::GetTraceTotPoints ( void  )
inline
const std::string Nektar::SolverUtils::EquationSystem::GetVariable ( unsigned int  i)
inline

Definition at line 768 of file EquationSystem.h.

References m_session.

{
return m_session->GetVariable(i);
}
void Nektar::SolverUtils::EquationSystem::ImportFld ( const std::string &  infile,
Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields 
)

Input field data from the given file.

Import field from infile and load into m_fields. This routine will also perform a BwdTrans to ensure data is in both the physical and coefficient storage.

Parameters
infileFilename to read.

Definition at line 1960 of file EquationSystem.cpp.

References ASSERTL1, GetNcoeffs(), m_fields, m_fld, m_session, and Vmath::Zero().

{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
m_fld->Import(infile,FieldDef,FieldData);
// Copy FieldData into m_fields
for(int j = 0; j < pFields.num_elements(); ++j)
{
Vmath::Zero(pFields[j]->GetNcoeffs(),
pFields[j]->UpdateCoeffs(),1);
for(int i = 0; i < FieldDef.size(); ++i)
{
ASSERTL1(FieldDef[i]->m_fields[j] ==
m_session->GetVariable(j),
std::string("Order of ") + infile
+ std::string(" data and that defined in "
"m_boundaryconditions differs"));
pFields[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
FieldDef[i]->m_fields[j],
pFields[j]->UpdateCoeffs());
}
pFields[j]->BwdTrans(pFields[j]->GetCoeffs(),
pFields[j]->UpdatePhys());
}
}
void Nektar::SolverUtils::EquationSystem::ImportFld ( const std::string &  infile,
std::vector< std::string > &  fieldStr,
Array< OneD, Array< OneD, NekDouble > > &  coeffs 
)

Output a field. Input field data into array from the given file.

Import field from infile and load into the array coeffs.

Parameters
infileFilename to read.
fieldStran array of string identifying fields to be imported
coeffsand array of array of coefficients to store imported data

Definition at line 2083 of file EquationSystem.cpp.

References ASSERTL0, m_fields, m_fld, and Vmath::Zero().

{
ASSERTL0(fieldStr.size() <= coeffs.num_elements(),
"length of fieldstr should be the same as pFields");
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
m_fld->Import(infile,FieldDef,FieldData);
// Copy FieldData into m_fields
for(int j = 0; j < fieldStr.size(); ++j)
{
Vmath::Zero(coeffs[j].num_elements(),coeffs[j],1);
for(int i = 0; i < FieldDef.size(); ++i)
{
m_fields[0]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
fieldStr[j], coeffs[j]);
}
}
}
void Nektar::SolverUtils::EquationSystem::ImportFld ( const std::string &  infile,
MultiRegions::ExpListSharedPtr pField,
std::string &  pFieldName 
)

Output a field. Input field data into ExpList from the given file.

Import field from infile and load into pField. This routine will also perform a BwdTrans to ensure data is in both the physical and coefficient storage.

Definition at line 2044 of file EquationSystem.cpp.

References ASSERTL1, m_fields, m_fld, and Vmath::Zero().

{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
m_fld->Import(infile,FieldDef,FieldData);
int idx = -1;
Vmath::Zero(pField->GetNcoeffs(),pField->UpdateCoeffs(),1);
for(int i = 0; i < FieldDef.size(); ++i)
{
// find the index of the required field in the file.
for(int j = 0; j < FieldData.size(); ++j)
{
if (FieldDef[i]->m_fields[j] == pFieldName)
{
idx = j;
}
}
ASSERTL1(idx >= 0, "Field " + pFieldName + " not found.");
pField->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
FieldDef[i]->m_fields[idx],
pField->UpdateCoeffs());
}
pField->BwdTrans(pField->GetCoeffs(), pField->UpdatePhys());
}
void Nektar::SolverUtils::EquationSystem::ImportFldBase ( std::string  pInfile,
SpatialDomains::MeshGraphSharedPtr  pGraph 
)
protected

Definition at line 1324 of file EquationSystem.cpp.

References ASSERTL1, m_base, m_fields, m_fld, and m_session.

{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
//Get Homogeneous
m_fld->Import(pInfile,FieldDef,FieldData);
int nvar = m_session->GetVariables().size();
if (m_session->DefinesSolverInfo("HOMOGENEOUS"))
{
std::string HomoStr = m_session->GetSolverInfo("HOMOGENEOUS");
}
// copy FieldData into m_fields
for (int j = 0; j < nvar; ++j)
{
for(int i = 0; i < FieldDef.size(); ++i)
{
bool flag = FieldDef[i]->m_fields[j] ==
m_session->GetVariable(j);
ASSERTL1(flag, (std::string("Order of ") + pInfile
+ std::string(" data and that defined in "
"m_boundaryconditions differs")).c_str());
m_base[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
FieldDef[i]->m_fields[j],
m_base[j]->UpdateCoeffs());
}
}
}
void Nektar::SolverUtils::EquationSystem::ImportFldToMultiDomains ( const std::string &  infile,
Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const int  ndomains 
)

Input field data from the given file to multiple domains.

Import field from infile and load into m_fields. This routine will also perform a BwdTrans to ensure data is in both the physical and coefficient storage.

Parameters
infileFilename to read. If optionan ndomains is specified it assumes we loop over nodmains for each nvariables.

Definition at line 2001 of file EquationSystem.cpp.

References ASSERTL0, ASSERTL1, GetNcoeffs(), GetNvariables(), Nektar::LibUtilities::Import(), m_fields, m_session, and Vmath::Zero().

{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
LibUtilities::Import(infile,FieldDef,FieldData);
int nvariables = GetNvariables();
ASSERTL0(ndomains*nvariables == pFields.num_elements(),"Number of fields does not match the number of variables and domains");
// Copy FieldData into m_fields
for(int j = 0; j < ndomains; ++j)
{
for(int i = 0; i < nvariables; ++i)
{
Vmath::Zero(pFields[j*nvariables+i]->GetNcoeffs(),pFields[j*nvariables+i]->UpdateCoeffs(),1);
for(int n = 0; n < FieldDef.size(); ++n)
{
ASSERTL1(FieldDef[n]->m_fields[i] == m_session->GetVariable(i),
std::string("Order of ") + infile
+ std::string(" data and that defined in "
"m_boundaryconditions differs"));
pFields[j*nvariables+i]->ExtractDataToCoeffs(FieldDef[n], FieldData[n],
FieldDef[n]->m_fields[i],
pFields[j*nvariables+i]->UpdateCoeffs());
}
pFields[j*nvariables+i]->BwdTrans(pFields[j*nvariables+i]->GetCoeffs(),
pFields[j*nvariables+i]->UpdatePhys());
}
}
}
void Nektar::SolverUtils::EquationSystem::InitialiseBaseFlow ( Array< OneD, Array< OneD, NekDouble > > &  base)

Perform initialisation of the base flow.

Definition at line 1144 of file EquationSystem.cpp.

References EvaluateFunction(), m_graph, m_spacedim, and SetUpBaseFields().

Referenced by Nektar::SteadyAdvectionDiffusion::v_InitObject().

{
base = Array<OneD, Array<OneD, NekDouble> >(m_spacedim);
std::vector<std::string> vel;
vel.push_back("Vx");
vel.push_back("Vy");
vel.push_back("Vz");
vel.resize(m_spacedim);
EvaluateFunction(vel, base, "BaseFlow");
}
void Nektar::SolverUtils::EquationSystem::InitObject ( )
inline

Initialises the members of this object.

This is the second part of the two-phase initialisation process. Calls to virtual functions will correctly resolve to the derived class during this phase of the construction.

Definition at line 601 of file EquationSystem.h.

References v_InitObject().

{
}
NekDouble Nektar::SolverUtils::EquationSystem::L2Error ( unsigned int  field,
const Array< OneD, NekDouble > &  exactsoln,
bool  Normalised = false 
)
inline

Compute the L2 error between fields and a given exact solution.

L_2 Error computation Public interface routine to virtual function implementation.

Definition at line 672 of file EquationSystem.h.

References v_L2Error().

Referenced by L2Error().

{
return v_L2Error(field, exactsoln, Normalised);
}
SOLVER_UTILS_EXPORT NekDouble Nektar::SolverUtils::EquationSystem::L2Error ( unsigned int  field,
bool  Normalised = false 
)
inline

Compute the L2 error of the fields.

Definition at line 183 of file EquationSystem.h.

References L2Error(), and Nektar::NullNekDouble1DArray.

{
return L2Error(field,NullNekDouble1DArray,Normalised);
}
NekDouble Nektar::SolverUtils::EquationSystem::LinfError ( unsigned int  field,
const Array< OneD, NekDouble > &  exactsoln = NullNekDouble1DArray 
)
inline

Linf error computation.

L_inf Error computation Public interface routine to virtual function implementation.

Definition at line 663 of file EquationSystem.h.

References v_LinfError().

{
return v_LinfError(field, exactsoln);
}
int Nektar::SolverUtils::EquationSystem::nocase_cmp ( const string &  s1,
const string &  s2 
)
inlineprotected

Definition at line 493 of file EquationSystem.h.

References NoCaseStringCompare().

{
return NoCaseStringCompare(s1,s2);
}
int Nektar::SolverUtils::EquationSystem::NoCaseStringCompare ( const string &  s1,
const string &  s2 
)

Perform a case-insensitive string comparison.

Performs a case-insensitive string comparison (from web).

Parameters
s1First string to compare.
s2Second string to compare.
Returns
0 if the strings match.

Definition at line 2187 of file EquationSystem.cpp.

Referenced by nocase_cmp(), and Nektar::NavierStokesCFE::v_InitObject().

{
//if (s1.size() < s2.size()) return -1;
//if (s1.size() > s2.size()) return 1;
string::const_iterator it1=s1.begin();
string::const_iterator it2=s2.begin();
// Stop when either string's end has been reached
while ( (it1!=s1.end()) && (it2!=s2.end()) )
{
if(::toupper(*it1) != ::toupper(*it2)) //letters differ?
{
// Return -1 to indicate smaller than, 1 otherwise
return (::toupper(*it1) < ::toupper(*it2)) ? -1 : 1;
}
// Proceed to the next character in each string
++it1;
++it2;
}
size_t size1=s1.size();
size_t size2=s2.size();// cache lengths
// Return -1, 0 or 1 according to strings' lengths
if (size1==size2)
{
return 0;
}
return (size1 < size2) ? -1 : 1;
}
void Nektar::SolverUtils::EquationSystem::NumericalFlux ( Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  numflux 
)
inline

Definition at line 867 of file EquationSystem.h.

References v_NumericalFlux().

Referenced by WeakDGAdvection().

{
v_NumericalFlux(physfield, numflux);
}
void Nektar::SolverUtils::EquationSystem::NumericalFlux ( Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  numfluxX,
Array< OneD, Array< OneD, NekDouble > > &  numfluxY 
)
inline

Definition at line 873 of file EquationSystem.h.

References v_NumericalFlux().

{
v_NumericalFlux(physfield, numfluxX, numfluxY);
}
void Nektar::SolverUtils::EquationSystem::NumFluxforScalar ( const Array< OneD, Array< OneD, NekDouble > > &  ufield,
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &  uflux 
)
inline

Definition at line 880 of file EquationSystem.h.

References v_NumFluxforScalar().

Referenced by WeakDGDiffusion().

{
v_NumFluxforScalar(ufield, uflux);
}
void Nektar::SolverUtils::EquationSystem::NumFluxforVector ( const Array< OneD, Array< OneD, NekDouble > > &  ufield,
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &  qfield,
Array< OneD, Array< OneD, NekDouble > > &  qflux 
)
inline

Definition at line 887 of file EquationSystem.h.

References v_NumFluxforVector().

Referenced by WeakDGDiffusion().

{
v_NumFluxforVector(ufield, qfield, qflux);
}
void Nektar::SolverUtils::EquationSystem::Output ( void  )
inline

Perform output operations after solve.

Definition at line 654 of file EquationSystem.h.

References v_Output().

{
}
void Nektar::SolverUtils::EquationSystem::PrintSummary ( std::ostream &  out)
inline

Print a summary of parameters and solver characteristics.

Prints a summary of variables and problem parameters.

Public interface routine to virtual function implementation.

Parameters
outThe ostream object to write to.

Definition at line 692 of file EquationSystem.h.

References m_session, and v_GenerateSummary().

{
if (m_session->GetComm()->GetRank() == 0)
{
std::vector<std::pair<std::string, std::string> > vSummary;
v_GenerateSummary(vSummary);
out << "=======================================================================" << endl;
SummaryList::const_iterator x;
for (x = vSummary.begin(); x != vSummary.end(); ++x)
{
out << "\t";
out.width(20);
out << x->first << ": " << x->second << endl;
}
out << "=======================================================================" << endl;
}
}
SOLVER_UTILS_EXPORT void Nektar::SolverUtils::EquationSystem::ResetSessionName ( std::string  newname)
inline

Reset Session name.

Definition at line 104 of file EquationSystem.h.

References m_sessionName.

{
m_sessionName = newname;
}
SOLVER_UTILS_EXPORT void Nektar::SolverUtils::EquationSystem::ScanForHistoryPoints ( )

Builds map of which element holds each history point.

void Nektar::SolverUtils::EquationSystem::SessionSummary ( SummaryList s)

Write out a session summary.

Write out a summary of the session data.

Parameters
outOutput stream to write data to.

Definition at line 2113 of file EquationSystem.cpp.

References Nektar::SolverUtils::AddSummaryItem(), Nektar::MultiRegions::eDiscontinuous, Nektar::MultiRegions::eGalerkin, eHomogeneous1D, eHomogeneous2D, Nektar::MultiRegions::eMixed_CG_Discontinuous, Nektar::SolverUtils::GetAdvectionFactory(), Nektar::SolverUtils::GetDiffusionFactory(), m_expdim, m_fields, m_HomogeneousType, m_MultipleModes, m_npointsY, m_npointsZ, m_NumMode, m_projectionType, m_session, m_sessionName, m_spacedim, and m_useFFT.

Referenced by Nektar::Laplace::v_GenerateSummary(), and v_GenerateSummary().

{
AddSummaryItem(s, "EquationType", m_session->GetSolverInfo("EQTYPE"));
AddSummaryItem(s, "Session Name", m_sessionName);
AddSummaryItem(s, "Spatial Dim.", m_spacedim);
AddSummaryItem(s, "Max SEM Exp. Order", m_fields[0]->EvalBasisNumModesMax());
{
AddSummaryItem(s, "Quasi-3D", "Homogeneous in z-direction");
AddSummaryItem(s, "Expansion Dim.", m_expdim + 1);
AddSummaryItem(s, "Num. Hom. Modes (z)", m_npointsZ);
AddSummaryItem(s, "Hom. length (LZ)", "m_LhomZ");
AddSummaryItem(s, "FFT Type", m_useFFT ? "FFTW" : "MVM");
AddSummaryItem(s, "Selected Mode", m_MultipleModes
? boost::lexical_cast<string>(m_NumMode) : "ALL");
}
{
AddSummaryItem(s, "Quasi-3D", "Homogeneous in yz-plane");
AddSummaryItem(s, "Expansion Dim.", m_expdim + 2);
AddSummaryItem(s, "Num. Hom. Modes (y)", m_npointsY);
AddSummaryItem(s, "Num. Hom. Modes (z)", m_npointsZ);
AddSummaryItem(s, "Hom. length (LY)", "m_LhomY");
AddSummaryItem(s, "Hom. length (LZ)", "m_LhomZ");
AddSummaryItem(s, "FFT Type", m_useFFT ? "FFTW" : "MVM");
}
else
{
AddSummaryItem(s, "Expansion Dim.", m_expdim);
}
if (m_session->DefinesSolverInfo("UpwindType"))
{
AddSummaryItem(s, "Riemann Solver",
m_session->GetSolverInfo("UpwindType"));
}
if (m_session->DefinesSolverInfo("AdvectionType"))
{
std::string AdvectionType;
AdvectionType = m_session->GetSolverInfo("AdvectionType");
AddSummaryItem(s, "Advection Type", GetAdvectionFactory().
GetClassDescription(AdvectionType));
}
{
AddSummaryItem(s, "Projection Type", "Continuous Galerkin");
}
{
AddSummaryItem(s, "Projection Type", "Discontinuous Galerkin");
}
{
AddSummaryItem(s, "Projection Type",
"Mixed Continuous Galerkin and Discontinuous");
}
if (m_session->DefinesSolverInfo("DiffusionType"))
{
std::string DiffusionType;
DiffusionType = m_session->GetSolverInfo("DiffusionType");
AddSummaryItem(s, "Diffusion Type", GetDiffusionFactory().
GetClassDescription(DiffusionType));
}
}
void Nektar::SolverUtils::EquationSystem::SetBoundaryConditions ( NekDouble  time)
protected

Evaluates the boundary conditions at the given time.

If boundary conditions are time-dependent, they will be evaluated at the time specified.

Parameters
timeThe time at which to evaluate the BCs

Reimplemented in Nektar::IncNavierStokes.

Definition at line 869 of file EquationSystem.cpp.

References m_fields, and m_session.

Referenced by Nektar::UnsteadyAdvectionDiffusion::DoImplicitSolve(), Nektar::ImageWarpingSystem::DoOdeProjection(), Nektar::UnsteadyInviscidBurger::DoOdeProjection(), Nektar::UnsteadyDiffusion::DoOdeProjection(), Nektar::UnsteadyAdvection::DoOdeProjection(), Nektar::UnsteadyAdvectionDiffusion::DoOdeProjection(), Nektar::CFLtester::DoOdeProjection(), Nektar::PulseWavePropagation::SetPulseWaveBoundaryConditions(), and Nektar::SolverUtils::UnsteadySystem::v_DoInitialise().

{
std::string varName;
int nvariables = m_fields.num_elements();
for (int i = 0; i < nvariables; ++i)
{
varName = m_session->GetVariable(i);
m_fields[i]->EvaluateBoundaryConditions(time, varName);
}
}
void Nektar::SolverUtils::EquationSystem::SetInitialConditions ( NekDouble  initialtime = 0.0,
bool  dumpInitialConditions = true,
const int  domain = 0 
)
inline

Initialise the data in the dependent fields.

Definition at line 716 of file EquationSystem.h.

References v_SetInitialConditions().

Referenced by main(), Nektar::APE::v_DoInitialise(), Nektar::SolverUtils::UnsteadySystem::v_DoInitialise(), Nektar::PulseWaveSystem::v_DoInitialise(), and Nektar::CoupledLinearNS::v_DoInitialise().

{
v_SetInitialConditions(initialtime,dumpInitialConditions,domain);
}
void Nektar::SolverUtils::EquationSystem::SetLambda ( NekDouble  lambda)
inline

Set parameter m_lambda.

Definition at line 711 of file EquationSystem.h.

References m_lambda.

{
m_lambda = lambda;
}
SOLVER_UTILS_EXPORT void Nektar::SolverUtils::EquationSystem::SetModifiedBasis ( const bool  modbasis)
inline
void Nektar::SolverUtils::EquationSystem::SetStepsToOne ( void  )
inline

Definition at line 828 of file EquationSystem.h.

References m_steps.

{
}
void Nektar::SolverUtils::EquationSystem::SetUpBaseFields ( SpatialDomains::MeshGraphSharedPtr mesh)
protected

Definition at line 1157 of file EquationSystem.cpp.

References ASSERTL0, Nektar::LibUtilities::eFourier, Nektar::LibUtilities::eFourierEvenlySpaced, Nektar::LibUtilities::eFourierHalfModeRe, Nektar::LibUtilities::eFourierSingleModeSpaced, Nektar::MultiRegions::eGalerkin, eHomogeneous1D, Nektar::MultiRegions::eMixed_CG_Discontinuous, m_base, m_expdim, m_graph, m_HalfMode, m_homogen_dealiasing, m_HomogeneousType, m_LhomZ, m_npointsZ, m_projectionType, m_session, m_SingleMode, and m_useFFT.

Referenced by InitialiseBaseFlow().

{
int i;
// The number of variables can be different from the dimension
// of the base flow
int nvariables = m_session->GetVariables().size();
m_base = Array<OneD, MultiRegions::ExpListSharedPtr>(nvariables);
{
switch (m_expdim)
{
case 1:
{
for(i = 0; i < m_base.num_elements(); i++)
{
m_session->GetVariable(0));
}
}
break;
case 2:
{
{
{
m_npointsZ,PkeyZ);
for (i = 0 ; i < m_base.num_elements(); i++)
{
::AllocateSharedPtr(
m_session, BkeyZ, m_LhomZ,
m_session->GetVariable(i));
m_base[i]->SetWaveSpace(true);
}
}
else if (m_HalfMode)
{
//1 plane field (half mode expansion)
m_npointsZ,PkeyZ);
for (i = 0 ; i < m_base.num_elements(); i++)
{
::AllocateSharedPtr(
m_session, BkeyZ, m_LhomZ,
m_session->GetVariable(i));
m_base[i]->SetWaveSpace(true);
}
}
else
{
PkeyZ);
for (i = 0 ; i < m_base.num_elements(); i++)
{
::AllocateSharedPtr(
m_session, BkeyZ, m_LhomZ,
m_session->GetVariable(i));
m_base[i]->SetWaveSpace(false);
}
}
}
else
{
i = 0;
m_session->GetVariable(i));
m_base[0]=firstbase;
for (i = 1 ; i < m_base.num_elements(); i++)
{
ContField2D>::AllocateSharedPtr(
*firstbase,mesh,
m_session->GetVariable(i));
}
}
}
break;
case 3:
{
m_session->GetVariable(0));
m_base[0] = firstbase;
for (i = 1 ; i < m_base.num_elements(); i++)
{
m_session->GetVariable(0));
}
}
break;
default:
ASSERTL0(false,"Expansion dimension not recognised");
break;
}
}
else
{
switch(m_expdim)
{
case 1:
{
// need to use zero for variable as may be more base
// flows than variables
for(i = 0 ; i < m_base.num_elements(); i++)
{
::AllocateSharedPtr(m_session, m_graph,
m_session->GetVariable(0));
}
break;
}
case 2:
{
for(i = 0 ; i < m_base.num_elements(); i++)
{
DisContField2D>::AllocateSharedPtr(
m_session->GetVariable(0));
}
break;
}
case 3:
ASSERTL0(false, "3 D not set up");
default:
ASSERTL0(false, "Expansion dimension not recognised");
break;
}
}
}
SOLVER_UTILS_EXPORT void Nektar::SolverUtils::EquationSystem::SetUpTraceNormals ( void  )
void Nektar::SolverUtils::EquationSystem::TransCoeffToPhys ( void  )
inline

Transform from coefficient to physical space.

Performs the transformation from coefficient to physical space.

Public interface routine to virtual function implementation.

Definition at line 624 of file EquationSystem.h.

References v_TransCoeffToPhys().

void Nektar::SolverUtils::EquationSystem::TransPhysToCoeff ( void  )
inline

Transform from physical to coefficient space.

Performs the transformation from physical to coefficient space.

Public interface routine to virtual function implementation.

Definition at line 634 of file EquationSystem.h.

References v_TransPhysToCoeff().

SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMap& Nektar::SolverUtils::EquationSystem::UpdateFieldMetaDataMap ( )
inline

Get hold of FieldInfoMap so it can be updated.

Array< OneD, MultiRegions::ExpListSharedPtr > & Nektar::SolverUtils::EquationSystem::UpdateFields ( void  )
inline

Definition at line 731 of file EquationSystem.h.

References m_fields.

{
return m_fields;
}
void Nektar::SolverUtils::EquationSystem::v_DoInitialise ( void  )
protectedvirtual

Virtual function for initialisation implementation.

By default, nothing needs initialising at the EquationSystem level.

Reimplemented in Nektar::PulseWaveSystem, Nektar::SolverUtils::UnsteadySystem, Nektar::APE, Nektar::SteadyAdvectionDiffusion, and Nektar::EigenValuesAdvection.

Definition at line 1138 of file EquationSystem.cpp.

Referenced by DoInitialise().

{
}
void Nektar::SolverUtils::EquationSystem::v_DoSolve ( void  )
protectedvirtual

Virtual function for solve implementation.

Reimplemented in Nektar::PulseWaveSystem, Nektar::SolverUtils::UnsteadySystem, Nektar::SteadyAdvectionDiffusion, Nektar::Laplace, and Nektar::EigenValuesAdvection.

Definition at line 1360 of file EquationSystem.cpp.

Referenced by DoSolve().

{
}
void Nektar::SolverUtils::EquationSystem::v_EvaluateExactSolution ( unsigned int  field,
Array< OneD, NekDouble > &  outfield,
const NekDouble  time 
)
protectedvirtual

Reimplemented in Nektar::EulerCFE.

Definition at line 1119 of file EquationSystem.cpp.

References ASSERTL0, EvaluateFunction(), m_fields, m_session, and Vmath::Zero().

Referenced by EvaluateExactSolution().

{
ASSERTL0 (outfield.num_elements() == m_fields[field]->GetNpoints(),
"ExactSolution array size mismatch.");
Vmath::Zero(outfield.num_elements(), outfield, 1);
if (m_session->DefinesFunction("ExactSolution"))
{
EvaluateFunction(m_session->GetVariable(field), outfield,
"ExactSolution", time);
}
}
void Nektar::SolverUtils::EquationSystem::v_ExtraFldOutput ( std::vector< Array< OneD, NekDouble > > &  fieldcoeffs,
std::vector< std::string > &  variables 
)
protectedvirtual

Reimplemented in Nektar::CompressibleFlowSystem.

Definition at line 2297 of file EquationSystem.cpp.

Referenced by WriteFld().

{
}
void Nektar::SolverUtils::EquationSystem::v_GenerateSummary ( SummaryList l)
protectedvirtual
void Nektar::SolverUtils::EquationSystem::v_GetFluxVector ( const int  i,
Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  flux 
)
privatevirtual

Reimplemented in Nektar::IncNavierStokes, Nektar::CFLtester, Nektar::APE, Nektar::PulseWavePropagation, Nektar::ImageWarpingSystem, and Nektar::EigenValuesAdvection.

Definition at line 2228 of file EquationSystem.cpp.

References ASSERTL0.

Referenced by GetFluxVector().

{
ASSERTL0(false, "v_GetFluxVector: This function is not valid "
"for the Base class");
}
void Nektar::SolverUtils::EquationSystem::v_GetFluxVector ( const int  i,
const int  j,
Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  flux 
)
privatevirtual

Reimplemented in Nektar::APE.

Definition at line 2237 of file EquationSystem.cpp.

References ASSERTL0.

{
ASSERTL0(false, "v_GetqFluxVector: This function is not valid "
"for the Base class");
}
void Nektar::SolverUtils::EquationSystem::v_GetFluxVector ( const int  i,
Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  fluxX,
Array< OneD, Array< OneD, NekDouble > > &  fluxY 
)
privatevirtual

Definition at line 2246 of file EquationSystem.cpp.

References ASSERTL0.

{
ASSERTL0(false, "v_GetFluxVector: This function is not valid "
"for the Base class");
}
MultiRegions::ExpListSharedPtr Nektar::SolverUtils::EquationSystem::v_GetPressure ( void  )
protectedvirtual

Reimplemented in Nektar::IncNavierStokes.

Definition at line 2290 of file EquationSystem.cpp.

References ASSERTL0.

Referenced by GetPressure().

{
ASSERTL0(false, "This function is not valid for the Base class");
return null;
}
Array< OneD, bool > Nektar::SolverUtils::EquationSystem::v_GetSystemSingularChecks ( )
privatevirtual

Definition at line 2223 of file EquationSystem.cpp.

References m_session.

Referenced by v_InitObject().

{
return Array<OneD, bool>(m_session->GetVariables().size(), false);
}
void Nektar::SolverUtils::EquationSystem::v_InitObject ( )
protectedvirtual

Initialisation object for EquationSystem.

Continuous field

Setting up the normals

Setting up the normals

Reimplemented in Nektar::CoupledLinearNS, Nektar::PulseWaveSystem, Nektar::CompressibleFlowSystem, Nektar::UnsteadyAdvectionDiffusion, Nektar::IncNavierStokes, Nektar::CFLtester, Nektar::UnsteadyAdvection, Nektar::UnsteadyInviscidBurger, Nektar::SolverUtils::UnsteadySystem, Nektar::ShallowWaterSystem, Nektar::EulerADCFE, Nektar::APE, Nektar::EulerCFE, Nektar::NavierStokesCFE, Nektar::PulseWavePropagation, Nektar::ImageWarpingSystem, Nektar::UnsteadyDiffusion, Nektar::Monodomain, Nektar::Bidomain, Nektar::LinearSWE, Nektar::NonlinearSWE, Nektar::PulseWaveSystemOutput, Nektar::Laplace, Nektar::SteadyAdvectionDiffusion, Nektar::EigenValuesAdvection, Nektar::Helmholtz, Nektar::VelocityCorrectionScheme, Nektar::SteadyAdvectionDiffusionReaction, and Nektar::Poisson.

Definition at line 105 of file EquationSystem.cpp.

References ASSERTL0, Nektar::MultiRegions::eDiscontinuous, Nektar::LibUtilities::eFourier, Nektar::LibUtilities::eFourierEvenlySpaced, Nektar::LibUtilities::eFourierHalfModeIm, Nektar::LibUtilities::eFourierHalfModeRe, Nektar::LibUtilities::eFourierSingleMode, Nektar::LibUtilities::eFourierSingleModeSpaced, Nektar::MultiRegions::eGalerkin, eHomogeneous1D, eHomogeneous2D, eHomogeneous3D, Nektar::MultiRegions::eMixed_CG_Discontinuous, eNotHomogeneous, GetTraceNpoints(), m_boundaryConditions, m_checkIfSystemSingular, m_checksteps, m_checktime, m_expdim, m_fields, m_filename, m_fintime, m_fld, m_graph, m_HalfMode, m_HomoDirec, m_homogen_dealiasing, m_HomogeneousType, m_LhomY, m_LhomZ, m_MultipleModes, m_npointsY, m_npointsZ, m_NumQuadPointsError, m_projectionType, m_session, m_sessionName, m_SingleMode, m_spacedim, m_specHP_dealiasing, m_steps, m_time, m_timestep, m_traceNormals, m_useFFT, Nektar::SpatialDomains::MeshGraph::Read(), v_GetSystemSingularChecks(), and ZeroPhysFields().

Referenced by InitObject().

{
// Filename of the session file
m_filename = m_session->GetFilename();
// Save the basename of input file name for output details
m_sessionName = m_session->GetSessionName();
// Instantiate a field reader/writer
// Read the geometry and the expansion information
// Also read and store the boundary conditions
// Set space dimension for use in class
m_spacedim = m_graph->GetSpaceDimension();
// Setting parameteres for homogenous problems
m_useFFT = false;
m_SingleMode = false;
m_HalfMode = false;
m_MultipleModes = false;
if (m_session->DefinesSolverInfo("HOMOGENEOUS"))
{
std::string HomoStr = m_session->GetSolverInfo("HOMOGENEOUS");
if ((HomoStr == "HOMOGENEOUS1D") || (HomoStr == "Homogeneous1D")
|| (HomoStr == "1D") || (HomoStr == "Homo1D"))
{
m_session->LoadParameter("LZ", m_LhomZ);
if(m_session->DefinesSolverInfo("ModeType"))
{
m_session->MatchSolverInfo("ModeType", "SingleMode",
m_SingleMode, false);
m_session->MatchSolverInfo("ModeType", "HalfMode",
m_HalfMode, false);
m_session->MatchSolverInfo("ModeType", "MultipleModes",
m_MultipleModes, false);
}
// Stability Analysis flags
if (m_session->DefinesSolverInfo("ModeType"))
{
{
}
else if(m_HalfMode)
{
}
else if(m_MultipleModes)
{
m_npointsZ = m_session->GetParameter("HomModesZ");
}
else
{
ASSERTL0(false, "SolverInfo ModeType not valid");
}
}
else
{
m_npointsZ = m_session->GetParameter("HomModesZ");
}
}
if ((HomoStr == "HOMOGENEOUS2D") || (HomoStr == "Homogeneous2D")
|| (HomoStr == "2D") || (HomoStr == "Homo2D"))
{
m_session->LoadParameter("HomModesY", m_npointsY);
m_session->LoadParameter("LY", m_LhomY);
m_session->LoadParameter("HomModesZ", m_npointsZ);
m_session->LoadParameter("LZ", m_LhomZ);
}
if ((HomoStr == "HOMOGENEOUS3D") || (HomoStr == "Homogeneous3D")
|| (HomoStr == "3D") || (HomoStr == "Homo3D"))
{
m_session->LoadParameter("HomModesY", m_npointsY);
m_session->LoadParameter("LY", m_LhomY);
m_session->LoadParameter("HomModesZ", m_npointsZ);
m_session->LoadParameter("LZ", m_LhomZ);
}
m_session->MatchSolverInfo("USEFFT", "FFTW", m_useFFT, false);
m_session->MatchSolverInfo("DEALIASING", "True",
if(m_homogen_dealiasing == false)
{
m_session->MatchSolverInfo("DEALIASING", "On",
}
}
else
{
// set to default value so can use to identify 2d or 3D
// (homogeneous) expansions
m_npointsZ = 1;
}
m_session->MatchSolverInfo("SPECTRALHPDEALIASING", "True",
if (m_specHP_dealiasing == false)
{
m_session->MatchSolverInfo("SPECTRALHPDEALIASING", "On",
}
// Options to determine type of projection from file or directly
// from constructor
if (m_session->DefinesSolverInfo("PROJECTION"))
{
std::string ProjectStr = m_session->GetSolverInfo("PROJECTION");
if ((ProjectStr == "Continuous") || (ProjectStr == "Galerkin") ||
(ProjectStr == "CONTINUOUS") || (ProjectStr == "GALERKIN"))
{
}
else if ((ProjectStr == "MixedCGDG") ||
(ProjectStr == "Mixed_CG_Discontinuous"))
{
}
else if(ProjectStr == "DisContinuous")
{
}
else
{
ASSERTL0(false,"PROJECTION value not recognised");
}
}
else
{
cerr << "Projection type not specified in SOLVERINFO,"
"defaulting to continuous Galerkin" << endl;
}
// Enforce singularity check for some problems
int i;
int nvariables = m_session->GetVariables().size();
bool DeclareCoeffPhysArrays = true;
m_fields = Array<OneD, MultiRegions::ExpListSharedPtr>(nvariables);
m_spacedim = m_graph->GetSpaceDimension()+m_HomoDirec;
m_expdim = m_graph->GetMeshDimension();
/// Continuous field
{
switch(m_expdim)
{
case 1:
{
{
for (i = 0; i < m_fields.num_elements(); i++)
{
::AllocateSharedPtr(
m_session, BkeyY, BkeyZ, m_LhomY,
m_session->GetVariable(i));
}
}
else
{
for (i = 0; i < m_fields.num_elements(); i++)
{
AllocateSharedPtr(
m_session, m_graph,
m_session->GetVariable(i));
}
}
break;
}
case 2:
{
{
// Fourier single mode stability analysis
{
PkeyZ);
for(i = 0; i < m_fields.num_elements(); i++)
{
::AllocateSharedPtr(
m_session, BkeyZ, m_LhomZ,
m_graph,
m_session->GetVariable(i),
}
}
// Half mode stability analysis
else if(m_HalfMode)
{
const LibUtilities::BasisKey BkeyZR(
m_npointsZ, PkeyZ);
const LibUtilities::BasisKey BkeyZI(
m_npointsZ, PkeyZ);
for (i = 0; i < m_fields.num_elements(); i++)
{
if(m_session->GetVariable(i).compare("w")
== 0)
{
::AllocateSharedPtr(
m_session, BkeyZI, m_LhomZ,
m_graph,
m_session->GetVariable(i),
}
::AllocateSharedPtr(
m_session, BkeyZR, m_LhomZ,
m_graph,
m_session->GetVariable(i),
}
}
// Normal homogeneous 1D
else
{
for (i = 0; i < m_fields.num_elements(); i++)
{
::AllocateSharedPtr(
m_session, BkeyZ, m_LhomZ,
m_graph,
m_session->GetVariable(i),
}
}
}
else
{
i = 0;
ContField2D>::AllocateSharedPtr(
m_session, m_graph,
m_session->GetVariable(i),
DeclareCoeffPhysArrays,
m_fields[0] = firstfield;
for (i = 1; i < m_fields.num_elements(); i++)
{
if (m_graph->
SameExpansions(m_session->GetVariable(0),
m_session->GetVariable(i)))
{
ContField2D>::AllocateSharedPtr(
*firstfield, m_graph,
m_session->GetVariable(i),
DeclareCoeffPhysArrays,
}
else
{
::ContField2D>::AllocateSharedPtr(
m_session, m_graph,
m_session->GetVariable(i),
DeclareCoeffPhysArrays,
}
}
{
/// Setting up the normals
Array<OneD, Array<OneD, NekDouble> >
for (i = 0; i < m_spacedim; ++i)
{
m_traceNormals[i] = Array<OneD, NekDouble>
}
m_fields[0]->GetTrace()->
GetNormals(m_traceNormals);
}
}
break;
}
case 3:
{
i = 0;
m_session->GetVariable(i),
m_fields[0] = firstfield;
for (i = 1; i < m_fields.num_elements(); i++)
{
if(m_graph->SameExpansions(
m_session->GetVariable(0),
m_session->GetVariable(i)))
{
::ContField3D>::AllocateSharedPtr(
*firstfield, m_graph,
m_session->GetVariable(i),
}
else
{
::ContField3D>::AllocateSharedPtr(
m_session, m_graph,
m_session->GetVariable(i),
}
}
{
/// Setting up the normals
Array<OneD, Array<OneD, NekDouble> >
for(i = 0; i < m_spacedim; ++i)
{
Array<OneD, NekDouble> (GetTraceNpoints());
}
m_fields[0]->GetTrace()->GetNormals(m_traceNormals);
// Call the trace on all fields to ensure DG setup.
for(i = 1; i < m_fields.num_elements(); ++i)
{
m_fields[i]->GetTrace();
}
}
break;
}
default:
ASSERTL0(false,"Expansion dimension not recognised");
break;
}
}
// Discontinuous field
else
{
switch(m_expdim)
{
case 1:
{
{
for (i = 0; i < m_fields.num_elements(); i++)
{
::AllocateSharedPtr(
m_session, BkeyY, BkeyZ, m_LhomY,
m_session->GetVariable(i));
}
}
else
{
for (i = 0; i < m_fields.num_elements(); i++)
{
DisContField1D>::AllocateSharedPtr(
m_session, m_graph,
m_session->GetVariable(i));
}
}
break;
}
case 2:
{
{
for (i = 0; i < m_fields.num_elements(); i++)
{
::AllocateSharedPtr(
m_session->GetVariable(i));
}
}
else
{
for (i = 0; i < m_fields.num_elements(); i++)
{
DisContField2D>::AllocateSharedPtr(
m_session, m_graph,
m_session->GetVariable(i));
}
}
break;
}
case 3:
{
{
ASSERTL0(false,
"3D fully periodic problems not implemented yet");
}
else
{
for (i = 0; i < m_fields.num_elements(); i++)
{
DisContField3D>::AllocateSharedPtr(
m_session, m_graph,
m_session->GetVariable(i));
}
}
break;
}
default:
ASSERTL0(false, "Expansion dimension not recognised");
break;
}
// Setting up the normals
Array<OneD, Array<OneD, NekDouble> >(m_spacedim);
for (i = 0; i < m_spacedim; ++i)
{
Array<OneD, NekDouble> (GetTraceNpoints(), 0.0);
}
m_fields[0]->GetTrace()->GetNormals(m_traceNormals);
}
// Set Default Parameter
m_session->LoadParameter("Time", m_time, 0.0);
m_session->LoadParameter("TimeStep", m_timestep, 0.01);
m_session->LoadParameter("NumSteps", m_steps, 0);
m_session->LoadParameter("IO_CheckSteps", m_checksteps, 0);
m_session->LoadParameter("IO_CheckTime", m_checktime, 0.0);
m_session->LoadParameter("FinTime", m_fintime, 0);
m_session->LoadParameter("NumQuadPointsError",
// Zero all physical fields initially
}
NekDouble Nektar::SolverUtils::EquationSystem::v_L2Error ( unsigned int  field,
const Array< OneD, NekDouble > &  exactsoln = NullNekDouble1DArray,
bool  Normalised = false 
)
protectedvirtual

Virtual function for the L_2 error computation between fields and a given exact solution.

Compute the error in the L2-norm.

Parameters
fieldThe field to compare.
exactsolnThe exact solution to compare with.
NormalisedNormalise L2-error.
Returns
Error in the L2-norm.

Reimplemented in Nektar::PulseWaveSystem.

Definition at line 887 of file EquationSystem.cpp.

References ErrorExtraPoints(), EvaluateFunction(), GetNpoints(), m_comm, m_fields, m_NumQuadPointsError, m_session, m_time, and Nektar::LibUtilities::ReduceSum.

Referenced by L2Error().

{
NekDouble L2error = -1.0;
{
if (m_fields[field]->GetPhysState() == false)
{
m_fields[field]->BwdTrans(m_fields[field]->GetCoeffs(),
m_fields[field]->UpdatePhys());
}
if (exactsoln.num_elements())
{
L2error = m_fields[field]->L2(m_fields[field]->GetPhys(), exactsoln);
}
else if (m_session->DefinesFunction("ExactSolution"))
{
Array<OneD, NekDouble>
exactsoln(m_fields[field]->GetNpoints());
EvaluateFunction(m_session->GetVariable(field), exactsoln,
"ExactSolution", m_time);
L2error = m_fields[field]->L2(m_fields[field]->GetPhys(), exactsoln);
}
else
{
L2error = m_fields[field]->L2(m_fields[field]->GetPhys());
}
if (Normalised == true)
{
Array<OneD, NekDouble> one(m_fields[field]->GetNpoints(),
1.0);
NekDouble Vol = m_fields[field]->PhysIntegral(one);
m_comm->AllReduce(Vol, LibUtilities::ReduceSum);
L2error = sqrt(L2error*L2error/Vol);
}
}
else
{
Array<OneD,NekDouble> L2INF(2);
L2INF = ErrorExtraPoints(field);
L2error = L2INF[0];
}
return L2error;
}
NekDouble Nektar::SolverUtils::EquationSystem::v_LinfError ( unsigned int  field,
const Array< OneD, NekDouble > &  exactsoln = NullNekDouble1DArray 
)
protectedvirtual

Virtual function for the L_inf error computation between fields and a given exact solution.

Compute the error in the L_inf-norm

Parameters
fieldThe field to compare.
exactsolnThe exact solution to compare with.
Returns
Error in the L_inft-norm.

Reimplemented in Nektar::PulseWaveSystem.

Definition at line 947 of file EquationSystem.cpp.

References ErrorExtraPoints(), EvaluateFunction(), GetNpoints(), m_fields, m_NumQuadPointsError, m_session, and m_time.

Referenced by LinfError().

{
NekDouble Linferror = -1.0;
{
if (m_fields[field]->GetPhysState() == false)
{
m_fields[field]->BwdTrans(m_fields[field]->GetCoeffs(),
m_fields[field]->UpdatePhys());
}
if (exactsoln.num_elements())
{
Linferror = m_fields[field]->Linf(m_fields[field]->GetPhys(), exactsoln);
}
else if (m_session->DefinesFunction("ExactSolution"))
{
Array<OneD, NekDouble>
exactsoln(m_fields[field]->GetNpoints());
EvaluateFunction(m_session->GetVariable(field), exactsoln,
"ExactSolution", m_time);
Linferror = m_fields[field]->Linf(m_fields[field]->GetPhys(), exactsoln);
}
else
{
Linferror = m_fields[field]->Linf(m_fields[field]->GetPhys());
}
}
else
{
Array<OneD,NekDouble> L2INF(2);
L2INF = ErrorExtraPoints(field);
Linferror = L2INF[1];
}
return Linferror;
}
void Nektar::SolverUtils::EquationSystem::v_NumericalFlux ( Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  numflux 
)
privatevirtual

Reimplemented in Nektar::IncNavierStokes, Nektar::CFLtester, Nektar::SolverUtils::UnsteadySystem, Nektar::APE, Nektar::PulseWavePropagation, Nektar::ImageWarpingSystem, and Nektar::EigenValuesAdvection.

Definition at line 2256 of file EquationSystem.cpp.

References ASSERTL0.

Referenced by NumericalFlux().

{
ASSERTL0(false, "v_NumericalFlux: This function is not valid "
"for the Base class");
}
void Nektar::SolverUtils::EquationSystem::v_NumericalFlux ( Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  numfluxX,
Array< OneD, Array< OneD, NekDouble > > &  numfluxY 
)
privatevirtual

Reimplemented in Nektar::SolverUtils::UnsteadySystem, and Nektar::APE.

Definition at line 2264 of file EquationSystem.cpp.

References ASSERTL0.

{
ASSERTL0(false, "v_NumericalFlux: This function is not valid "
"for the Base class");
}
void Nektar::SolverUtils::EquationSystem::v_NumFluxforScalar ( const Array< OneD, Array< OneD, NekDouble > > &  ufield,
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &  uflux 
)
privatevirtual

Reimplemented in Nektar::SolverUtils::UnsteadySystem.

Definition at line 2273 of file EquationSystem.cpp.

References ASSERTL0.

Referenced by NumFluxforScalar().

{
ASSERTL0(false, "v_NumFluxforScalar: This function is not valid "
"for the Base class");
}
void Nektar::SolverUtils::EquationSystem::v_NumFluxforVector ( const Array< OneD, Array< OneD, NekDouble > > &  ufield,
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &  qfield,
Array< OneD, Array< OneD, NekDouble > > &  qflux 
)
privatevirtual

Reimplemented in Nektar::SolverUtils::UnsteadySystem.

Definition at line 2281 of file EquationSystem.cpp.

References ASSERTL0.

Referenced by NumFluxforVector().

{
ASSERTL0(false, "v_NumFluxforVector: This function is not valid "
"for the Base class");
}
void Nektar::SolverUtils::EquationSystem::v_Output ( void  )
protectedvirtual

Write the field data to file. The file is named according to the session name with the extension .fld appended.

Reimplemented in Nektar::PulseWaveSystem.

Definition at line 1392 of file EquationSystem.cpp.

References m_sessionName, and WriteFld().

Referenced by Output().

{
}
void Nektar::SolverUtils::EquationSystem::v_SetInitialConditions ( NekDouble  initialtime = 0.0,
bool  dumpInitialConditions = true,
const int  domain = 0 
)
protectedvirtual

Set the physical fields based on a restart file, or a function describing the initial condition given in the session.

Parameters
initialtimeTime at which to evaluate the function.
dumpInitialConditionsWrite the initial condition to file?

Reimplemented in Nektar::CompressibleFlowSystem, Nektar::EulerADCFE, Nektar::EulerCFE, Nektar::NavierStokesCFE, Nektar::Monodomain, and Nektar::Bidomain.

Definition at line 1068 of file EquationSystem.cpp.

References Checkpoint_Output(), DescribeFunction(), EvaluateFunction(), GetNcoeffs(), m_checksteps, m_fields, m_session, and Vmath::Zero().

Referenced by SetInitialConditions().

{
if (m_session->GetComm()->GetRank() == 0)
{
cout << "Initial Conditions:" << endl;
}
if (m_session->DefinesFunction("InitialConditions"))
{
EvaluateFunction(m_session->GetVariables(), m_fields,
"InitialConditions",domain);
if (m_session->GetComm()->GetRank() == 0)
{
for (int i = 0; i < m_fields.num_elements(); ++i)
{
std::string varName = m_session->GetVariable(i);
cout << " - Field " << varName << ": "
<< DescribeFunction(varName, "InitialConditions",domain)
<< endl;
}
}
}
else
{
int nq = m_fields[0]->GetNpoints();
for (int i = 0; i < m_fields.num_elements(); i++)
{
Vmath::Zero(nq, m_fields[i]->UpdatePhys(), 1);
m_fields[i]->SetPhysState(true);
m_fields[i]->UpdateCoeffs(), 1);
if (m_session->GetComm()->GetRank() == 0)
{
cout << " - Field " << m_session->GetVariable(i)
<< ": 0 (default)" << endl;
}
}
}
if (dumpInitialConditions && m_checksteps)
{
}
}
void Nektar::SolverUtils::EquationSystem::v_TransCoeffToPhys ( void  )
protectedvirtual

Virtual function for transformation to physical space.

Reimplemented in Nektar::IncNavierStokes.

Definition at line 1368 of file EquationSystem.cpp.

Referenced by TransCoeffToPhys().

{
}
void Nektar::SolverUtils::EquationSystem::v_TransPhysToCoeff ( void  )
protectedvirtual

Virtual function for transformation to coefficient space.

Reimplemented in Nektar::IncNavierStokes.

Definition at line 1376 of file EquationSystem.cpp.

Referenced by TransPhysToCoeff().

{
}
void Nektar::SolverUtils::EquationSystem::WeakAdvectionDivergenceForm ( const Array< OneD, Array< OneD, NekDouble > > &  F,
Array< OneD, NekDouble > &  outarray 
)

Compute the inner product $ (\phi, \nabla \cdot F) $.

Calculate Inner product of the divergence advection form $(\phi, \nabla \cdot F)$, where for example $ F = uV $.

Parameters
FFields.
outarrayStorage for result.

Definition at line 1456 of file EquationSystem.cpp.

References Nektar::MultiRegions::DirCartesianMap, m_fields, and Vmath::Vadd().

{
// Use dimension of Velocity vector to dictate dimension of operation
int ndim = F.num_elements();
int nPointsTot = m_fields[0]->GetNpoints();
Array<OneD, NekDouble> tmp(nPointsTot);
Array<OneD, NekDouble> div(nPointsTot, 0.0);
// Evaluate the divergence
for (int i = 0; i < ndim; ++i)
{
//m_fields[0]->PhysDeriv(i,F[i],tmp);
m_fields[0]->PhysDeriv(MultiRegions::DirCartesianMap[i],F[i],tmp);
Vmath::Vadd(nPointsTot, tmp, 1, div, 1, div, 1);
}
m_fields[0]->IProductWRTBase(div, outarray);
}
void Nektar::SolverUtils::EquationSystem::WeakAdvectionGreensDivergenceForm ( const Array< OneD, Array< OneD, NekDouble > > &  F,
Array< OneD, NekDouble > &  outarray 
)

Compute the inner product $ (\nabla \phi \cdot F) $.

Computes the weak Green form of advection terms (without boundary integral), i.e. $ (\nabla \phi \cdot F) $ where for example $ F=uV $.

Parameters
FFields.
outarrayStorage for result.
Note
Assuming all fields are of the same expansion and order so that we can use the parameters of m_fields[0].

Definition at line 1432 of file EquationSystem.cpp.

References m_fields, Vmath::Vadd(), and Vmath::Zero().

Referenced by WeakDGAdvection(), and WeakDGDiffusion().

{
// Use dimension of velocity vector to dictate dimension of operation
int ndim = F.num_elements();
int nCoeffs = m_fields[0]->GetNcoeffs();
Array<OneD, NekDouble> iprod(nCoeffs);
Vmath::Zero(nCoeffs, outarray, 1);
for (int i = 0; i < ndim; ++i)
{
m_fields[0]->IProductWRTDerivBase(i, F[i], iprod);
Vmath::Vadd(nCoeffs, iprod, 1, outarray, 1, outarray, 1);
}
}
void Nektar::SolverUtils::EquationSystem::WeakAdvectionNonConservativeForm ( const Array< OneD, Array< OneD, NekDouble > > &  V,
const Array< OneD, const NekDouble > &  u,
Array< OneD, NekDouble > &  outarray,
bool  UseContCoeffs = false 
)

Compute the inner product $ (\phi, V\cdot \nabla u) $.

Calculate Inner product of the divergence advection form $ (\phi, V\cdot \nabla u) $

Parameters
VFields.
uFields.
outarrayStorage for result.

Definition at line 1484 of file EquationSystem.cpp.

References AdvectionNonConservativeForm(), Nektar::MultiRegions::eGlobal, and m_fields.

{
// use dimension of Velocity vector to dictate dimension of operation
int ndim = V.num_elements();
int nPointsTot = m_fields[0]->GetNpoints();
Array<OneD, NekDouble> tmp(nPointsTot);
Array<OneD, NekDouble> wk(ndim * nPointsTot, 0.0);
if (UseContCoeffs)
{
m_fields[0]->IProductWRTBase(tmp, outarray,
}
else
{
m_fields[0]->IProductWRTBase_IterPerExp(tmp, outarray);
}
}
void Nektar::SolverUtils::EquationSystem::WeakDGAdvection ( const Array< OneD, Array< OneD, NekDouble > > &  InField,
Array< OneD, Array< OneD, NekDouble > > &  OutField,
bool  NumericalFluxIncludesNormal = true,
bool  InFieldIsInPhysSpace = false,
int  nvariables = 0 
)

Calculate the weak discontinuous Galerkin advection.

Calculate weak DG advection in the form $ \langle\phi, \hat{F}\cdot n\rangle - (\nabla \phi \cdot F) $.

Parameters
InFieldFields.
OutFieldStorage for result.
NumericalFluxIncludesNormalDefault: true.
InFieldIsPhysSpaceDefault: false.
nvariablesNumber of fields.

Definition at line 1581 of file EquationSystem.cpp.

References GetFluxVector(), GetNcoeffs(), GetNpoints(), GetTraceNpoints(), m_expdim, m_fields, Vmath::Neg(), NumericalFlux(), and WeakAdvectionGreensDivergenceForm().

Referenced by Nektar::ImageWarpingSystem::DoOdeRhs(), Nektar::PulseWavePropagation::DoOdeRhs(), Nektar::APE::DoOdeRhs(), Nektar::CFLtester::DoOdeRhs(), and Nektar::EigenValuesAdvection::v_DoSolve().

{
int i;
int nVelDim = m_expdim;
int nPointsTot = GetNpoints();
int ncoeffs = GetNcoeffs();
int nTracePointsTot = GetTraceNpoints();
if (!nvariables)
{
nvariables = m_fields.num_elements();
}
Array<OneD, Array<OneD, NekDouble> > fluxvector(nVelDim);
Array<OneD, Array<OneD, NekDouble> > physfield (nvariables);
for(i = 0; i < nVelDim; ++i)
{
fluxvector[i] = Array<OneD, NekDouble>(nPointsTot);
}
// Get the variables in physical space
// already in physical space
if (InFieldIsInPhysSpace == true)
{
for (i = 0; i < nvariables; ++i)
{
physfield[i] = InField[i];
}
}
// otherwise do a backward transformation
else
{
for(i = 0; i < nvariables; ++i)
{
// Could make this point to m_fields[i]->UpdatePhys();
physfield[i] = Array<OneD, NekDouble>(nPointsTot);
m_fields[i]->BwdTrans(InField[i],physfield[i]);
}
}
// Get the advection part (without numerical flux)
for (i = 0; i < nvariables; ++i)
{
// Get the ith component of the flux vector in (physical space)
GetFluxVector(i, physfield, fluxvector);
// Calculate the i^th value of (\grad_i \phi, F)
WeakAdvectionGreensDivergenceForm(fluxvector,OutField[i]);
}
// Get the numerical flux and add to the modal coeffs
// if the NumericalFluxs function already includes the
// normal in the output
if (NumericalFluxIncludesNormal == true)
{
Array<OneD, Array<OneD, NekDouble> > numflux (nvariables);
for (i = 0; i < nvariables; ++i)
{
numflux[i] = Array<OneD, NekDouble>(nTracePointsTot);
}
// Evaluate numerical flux in physical space which may in
// general couple all component of vectors
NumericalFlux(physfield, numflux);
// Evaulate <\phi, \hat{F}\cdot n> - OutField[i]
for (i = 0; i < nvariables; ++i)
{
Vmath::Neg(ncoeffs,OutField[i],1);
m_fields[i]->AddTraceIntegral(numflux[i],OutField[i]);
m_fields[i]->SetPhysState(false);
}
}
// if the NumericalFlux function does not include the
// normal in the output
else
{
Array<OneD, Array<OneD, NekDouble> > numfluxX (nvariables);
Array<OneD, Array<OneD, NekDouble> > numfluxY (nvariables);
for (i = 0; i < nvariables; ++i)
{
numfluxX[i] = Array<OneD, NekDouble>(nTracePointsTot);
numfluxY[i] = Array<OneD, NekDouble>(nTracePointsTot);
}
// Evaluate numerical flux in physical space which may in
// general couple all component of vectors
NumericalFlux(physfield, numfluxX, numfluxY);
// Evaulate <\phi, \hat{F}\cdot n> - OutField[i]
for(i = 0; i < nvariables; ++i)
{
Vmath::Neg(ncoeffs,OutField[i],1);
m_fields[i]->AddTraceIntegral(numfluxX[i], numfluxY[i],
OutField[i]);
m_fields[i]->SetPhysState(false);
}
}
}
void Nektar::SolverUtils::EquationSystem::WeakDGDiffusion ( const Array< OneD, Array< OneD, NekDouble > > &  InField,
Array< OneD, Array< OneD, NekDouble > > &  OutField,
bool  NumericalFluxIncludesNormal = true,
bool  InFieldIsInPhysSpace = false 
)

Calculate weak DG Diffusion in the LDG form.

Calculate weak DG Diffusion in the LDG form $ \langle\psi, \hat{u}\cdot n\rangle - \langle\nabla\psi \cdot u\rangle \langle\phi, \hat{q}\cdot n\rangle - (\nabla \phi \cdot q) \rangle $

Definition at line 1695 of file EquationSystem.cpp.

References GetFluxVector(), GetNcoeffs(), GetNpoints(), GetTraceNpoints(), m_fields, m_spacedim, m_tanbasis, Vmath::Neg(), NumFluxforScalar(), NumFluxforVector(), Vmath::Vadd(), Vmath::Vcopy(), Vmath::Vmul(), and WeakAdvectionGreensDivergenceForm().

{
int i, j, k;
int nPointsTot = GetNpoints();
int ncoeffs = GetNcoeffs();
int nTracePointsTot = GetTraceNpoints();
int nvariables = m_fields.num_elements();
int nqvar = 2;
Array<OneD, NekDouble> qcoeffs (ncoeffs);
Array<OneD, NekDouble> temp (ncoeffs);
Array<OneD, Array<OneD, NekDouble> > fluxvector (m_spacedim);
Array<OneD, Array<OneD, NekDouble> > ufield (nvariables);
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > flux (nqvar);
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > qfield (nqvar);
for (j = 0; j < nqvar; ++j)
{
qfield[j] = Array<OneD, Array<OneD, NekDouble> >(nqvar);
flux[j] = Array<OneD, Array<OneD, NekDouble> >(nqvar);
for (i = 0; i< nvariables; ++i)
{
ufield[i] = Array<OneD, NekDouble>(nPointsTot, 0.0);
qfield[j][i] = Array<OneD, NekDouble>(nPointsTot, 0.0);
flux[j][i] = Array<OneD, NekDouble>(nTracePointsTot, 0.0);
}
}
for (k = 0; k < m_spacedim; ++k)
{
fluxvector[k] = Array<OneD, NekDouble>(nPointsTot, 0.0);
}
// Get the variables in physical space already in physical space
if (InFieldIsInPhysSpace == true)
{
for (i = 0; i < nvariables; ++i)
{
ufield[i] = InField[i];
}
}
// Otherwise do a backward transformation
else
{
for (i = 0; i < nvariables; ++i)
{
// Could make this point to m_fields[i]->UpdatePhys();
ufield[i] = Array<OneD, NekDouble>(nPointsTot);
m_fields[i]->BwdTrans(InField[i],ufield[i]);
}
}
// ##########################################################
// Compute q_{\eta} and q_{\xi} from su
// Obtain Numerical Fluxes
// ##########################################################
NumFluxforScalar(ufield, flux);
for (j = 0; j < nqvar; ++j)
{
for (i = 0; i < nvariables; ++i)
{
// Get the ith component of the flux vector in
// (physical space) fluxvector = m_tanbasis * u,
// where m_tanbasis = 2 by m_spacedim by nPointsTot
if (m_tanbasis.num_elements())
{
for (k = 0; k < m_spacedim; ++k)
{
Vmath::Vmul(nPointsTot, m_tanbasis[j][k], 1,
ufield[i], 1, fluxvector[k], 1);
}
}
else
{
GetFluxVector(i, j, ufield, fluxvector);
}
// Calculate the i^th value of (\grad_i \phi, F)
WeakAdvectionGreensDivergenceForm(fluxvector, qcoeffs);
Vmath::Neg(ncoeffs,qcoeffs,1);
m_fields[i]->AddTraceIntegral(flux[j][i], qcoeffs);
m_fields[i]->SetPhysState(false);
// Add weighted mass matrix = M ( \nabla \cdot Tanbasis )
// if(m_gradtan.num_elements())
// {
// MultiRegions::GlobalMatrixKey key(StdRegions::eMass,
// m_gradtan[j]);
// m_fields[i]->MultiRegions::ExpList::GeneralMatrixOp(key,
// InField[i], temp);
// Vmath::Svtvp(ncoeffs, -1.0, temp, 1, qcoeffs, 1,
// qcoeffs, 1);
// }
//Multiply by the inverse of mass matrix
m_fields[i]->MultiplyByElmtInvMass(qcoeffs, qcoeffs);
// Back to physical space
m_fields[i]->BwdTrans(qcoeffs, qfield[j][i]);
}
}
// ##########################################################
// Compute u from q_{\eta} and q_{\xi}
// ##########################################################
// Obtain Numerical Fluxes
NumFluxforVector(ufield, qfield, flux[0]);
for (i = 0; i < nvariables; ++i)
{
// L = L(tan_eta) q_eta + L(tan_xi) q_xi
OutField[i] = Array<OneD, NekDouble>(ncoeffs, 0.0);
temp = Array<OneD, NekDouble>(ncoeffs, 0.0);
if (m_tanbasis.num_elements())
{
for (j = 0; j < nqvar; ++j)
{
for (k = 0; k < m_spacedim; ++k)
{
Vmath::Vmul(nPointsTot, m_tanbasis[j][k], 1,
qfield[j][i], 1, fluxvector[k], 1);
}
Vmath::Vadd(ncoeffs, temp, 1, OutField[i], 1,
OutField[i], 1);
}
}
else
{
for (k = 0; k < m_spacedim; ++k)
{
Vmath::Vcopy(nPointsTot, qfield[k][i], 1,
fluxvector[k], 1);
}
WeakAdvectionGreensDivergenceForm(fluxvector, OutField[i]);
}
// Evaulate <\phi, \hat{F}\cdot n> - OutField[i]
Vmath::Neg(ncoeffs,OutField[i],1);
m_fields[i]->AddTraceIntegral(flux[0][i], OutField[i]);
m_fields[i]->SetPhysState(false);
}
}
void Nektar::SolverUtils::EquationSystem::WriteFld ( const std::string &  outname)

Write field data to the given filename.

Writes the field data to a file with the given filename.

Parameters
outnameFilename to write to.

Definition at line 1885 of file EquationSystem.cpp.

References GetNcoeffs(), m_boundaryConditions, m_fields, and v_ExtraFldOutput().

Referenced by Checkpoint_Output(), Nektar::EulerCFE::SetInitialRinglebFlow(), Nektar::Monodomain::v_InitObject(), Nektar::CoupledLinearNS::v_Output(), and v_Output().

{
std::vector<Array<OneD, NekDouble> > fieldcoeffs(
m_fields.num_elements());
std::vector<std::string> variables(m_fields.num_elements());
for (int i = 0; i < m_fields.num_elements(); ++i)
{
if (m_fields[i]->GetNcoeffs() == m_fields[0]->GetNcoeffs())
{
fieldcoeffs[i] = m_fields[i]->UpdateCoeffs();
}
else
{
fieldcoeffs[i] = Array<OneD,NekDouble>(m_fields[0]->
m_fields[0]->ExtractCoeffsToCoeffs(m_fields[i],
m_fields[i]->GetCoeffs(),
fieldcoeffs[i]);
}
variables[i] = m_boundaryConditions->GetVariable(i);
}
v_ExtraFldOutput(fieldcoeffs, variables);
WriteFld(outname, m_fields[0], fieldcoeffs, variables);
}
void Nektar::SolverUtils::EquationSystem::WriteFld ( const std::string &  outname,
MultiRegions::ExpListSharedPtr field,
std::vector< Array< OneD, NekDouble > > &  fieldcoeffs,
std::vector< std::string > &  variables 
)

Write input fields to the given filename.

Writes the field data to a file with the given filename.

Parameters
outnameFilename to write to.
fieldExpList on which data is based.
fieldcoeffsAn array of array of expansion coefficients.
variablesAn array of variable names.

Definition at line 1922 of file EquationSystem.cpp.

References m_fieldMetaDataMap, m_fld, and m_time.

{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
= field->GetFieldDefinitions();
std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
// Copy Data into FieldData and set variable
for(int j = 0; j < fieldcoeffs.size(); ++j)
{
for(int i = 0; i < FieldDef.size(); ++i)
{
// Could do a search here to find correct variable
FieldDef[i]->m_fields.push_back(variables[j]);
field->AppendFieldData(FieldDef[i], FieldData[i],
fieldcoeffs[j]);
}
}
// Update time in field info if required
if(m_fieldMetaDataMap.find("Time") != m_fieldMetaDataMap.end())
{
m_fieldMetaDataMap["Time"] = boost::lexical_cast<std::string>(m_time);
}
m_fld->Write(outname, FieldDef, FieldData, m_fieldMetaDataMap);
}
SOLVER_UTILS_EXPORT void Nektar::SolverUtils::EquationSystem::WriteHistoryData ( std::ostream &  out)

Probe each history point and write to file.

void Nektar::SolverUtils::EquationSystem::ZeroPhysFields ( void  )

Zero the physical fields.

Definition at line 1400 of file EquationSystem.cpp.

References GetNpoints(), m_fields, and Vmath::Zero().

Referenced by Nektar::PulseWaveSystem::v_InitObject(), and v_InitObject().

{
for (int i = 0; i < m_fields.num_elements(); i++)
{
m_fields[i]->UpdatePhys(),1);
}
}

Member Data Documentation

Array<OneD, MultiRegions::ExpListSharedPtr> Nektar::SolverUtils::EquationSystem::m_base
protected

Base fields.

Definition at line 400 of file EquationSystem.h.

Referenced by ImportFldBase(), and SetUpBaseFields().

SpatialDomains::BoundaryConditionsSharedPtr Nektar::SolverUtils::EquationSystem::m_boundaryConditions
protected
Array<OneD, bool> Nektar::SolverUtils::EquationSystem::m_checkIfSystemSingular
protected

Flag to indicate if the fields should be checked for singularity.

Definition at line 456 of file EquationSystem.h.

Referenced by v_InitObject().

int Nektar::SolverUtils::EquationSystem::m_checksteps
protected
NekDouble Nektar::SolverUtils::EquationSystem::m_checktime
protected

Time between checkpoints.

Definition at line 420 of file EquationSystem.h.

Referenced by Nektar::SolverUtils::UnsteadySystem::v_DoSolve(), and v_InitObject().

LibUtilities::CommSharedPtr Nektar::SolverUtils::EquationSystem::m_comm
protected
Array<OneD, MultiRegions::ExpListSharedPtr> Nektar::SolverUtils::EquationSystem::m_derivedfields
protected

Array holding all dependent variables.

Definition at line 402 of file EquationSystem.h.

int Nektar::SolverUtils::EquationSystem::m_expdim
protected
LibUtilities::FieldMetaDataMap Nektar::SolverUtils::EquationSystem::m_fieldMetaDataMap
protected
Array<OneD, MultiRegions::ExpListSharedPtr> Nektar::SolverUtils::EquationSystem::m_fields
protected

Array holding all dependent variables.

Definition at line 398 of file EquationSystem.h.

Referenced by Nektar::NonlinearSWE::AddCoriolis(), Nektar::LinearSWE::AddCoriolis(), Nektar::APE::AddSource(), Nektar::NonlinearSWE::AddVariableDepth(), AdvectionNonConservativeForm(), Nektar::IncNavierStokes::CalcSteadyState(), Nektar::SolverUtils::UnsteadySystem::CheckForRestartTime(), Nektar::CoupledLinearNS::Continuation(), Nektar::ShallowWaterSystem::CopyBoundaryTrace(), CopyFromPhysField(), CopyToPhysField(), Nektar::CoupledLinearNS::DefineForcingTerm(), Nektar::Bidomain::DoImplicitSolve(), Nektar::Monodomain::DoImplicitSolve(), Nektar::UnsteadyDiffusion::DoImplicitSolve(), Nektar::UnsteadyAdvectionDiffusion::DoImplicitSolve(), Nektar::NonlinearSWE::DoOdeProjection(), Nektar::LinearSWE::DoOdeProjection(), Nektar::UnsteadyInviscidBurger::DoOdeProjection(), Nektar::UnsteadyDiffusion::DoOdeProjection(), Nektar::APE::DoOdeProjection(), Nektar::UnsteadyAdvection::DoOdeProjection(), Nektar::UnsteadyAdvectionDiffusion::DoOdeProjection(), Nektar::CFLtester::DoOdeProjection(), Nektar::PulseWavePropagation::DoOdeRhs(), Nektar::ImageWarpingSystem::DoOdeRhs(), Nektar::NonlinearSWE::DoOdeRhs(), Nektar::LinearSWE::DoOdeRhs(), Nektar::UnsteadyInviscidBurger::DoOdeRhs(), Nektar::UnsteadyDiffusion::DoOdeRhs(), Nektar::Bidomain::DoOdeRhs(), Nektar::NavierStokesCFE::DoOdeRhs(), Nektar::APE::DoOdeRhs(), Nektar::EulerCFE::DoOdeRhs(), Nektar::EulerADCFE::DoOdeRhs(), Nektar::UnsteadyAdvection::DoOdeRhs(), Nektar::UnsteadyAdvectionDiffusion::DoOdeRhs(), Nektar::CFLtester::DoOdeRhs(), ErrorExtraPoints(), Nektar::CoupledLinearNS::EvaluateAdvection(), Nektar::VelocityCorrectionScheme::EvaluateAdvection_SetPressureBCs(), Nektar::IncNavierStokes::EvaluateAdvectionTerms(), EvaluateFunction(), Nektar::CoupledLinearNS::EvaluateNewtonRHS(), Nektar::CompressibleFlowSystem::ExtrapOrder0BC(), FwdTransFields(), Nektar::APE::GetBasefield(), Nektar::IncNavierStokes::GetCFLEstimate(), GetCoeff_Offset(), Nektar::IncNavierStokes::GetElmtCFLVals(), Nektar::EulerCFE::GetExactIsentropicVortex(), Nektar::EulerCFE::GetExactRinglebFlow(), GetExpSize(), Nektar::NonlinearSWE::GetFluxVector(), Nektar::LinearSWE::GetFluxVector(), Nektar::CompressibleFlowSystem::GetFluxVector(), Nektar::UnsteadyAdvectionDiffusion::GetFluxVectorAdv(), Nektar::UnsteadyAdvection::GetFluxVectorDeAlias(), Nektar::CompressibleFlowSystem::GetFluxVectorDeAlias(), GetNcoeffs(), Nektar::UnsteadyInviscidBurger::GetNormalVelocity(), Nektar::UnsteadyAdvection::GetNormalVelocity(), Nektar::UnsteadyAdvectionDiffusion::GetNormalVelocity(), GetNpoints(), GetNumElmVelocity(), GetNumExpModesPerExp(), GetPhys_Offset(), Nektar::CFLtester::GetStdVelocity(), GetTotPoints(), GetTraceNpoints(), Nektar::CompressibleFlowSystem::GetViscousFluxVector(), Nektar::CompressibleFlowSystem::GetViscousFluxVectorDeAlias(), ImportFld(), ImportFldBase(), ImportFldToMultiDomains(), Nektar::CompressibleFlowSystem::RiemannInvariantBC(), SessionSummary(), Nektar::NavierStokesCFE::SetBoundaryConditions(), Nektar::NonlinearSWE::SetBoundaryConditions(), Nektar::EulerADCFE::SetBoundaryConditions(), Nektar::EulerCFE::SetBoundaryConditions(), Nektar::LinearSWE::SetBoundaryConditions(), Nektar::APE::SetBoundaryConditions(), Nektar::IncNavierStokes::SetBoundaryConditions(), SetBoundaryConditions(), Nektar::EulerCFE::SetBoundaryIsentropicVortex(), Nektar::EulerCFE::SetBoundaryRinglebFlow(), Nektar::EulerCFE::SetInitialIsentropicVortex(), Nektar::EulerCFE::SetInitialRinglebFlow(), Nektar::IncNavierStokes::SetRadiationBoundaryForcing(), Nektar::CoupledLinearNS::SetUpCoupledMatrix(), Nektar::VelocityCorrectionScheme::SetUpPressureForcing(), Nektar::VelocityCorrectionScheme::SetUpViscousForcing(), Nektar::CoupledLinearNS::Solve(), Nektar::CoupledLinearNS::SolveLinearNS(), Nektar::CoupledLinearNS::SolveSteadyNavierStokes(), Nektar::VelocityCorrectionScheme::SolveUnsteadyStokesSystem(), Nektar::CoupledLinearNS::SolveUnsteadyStokesSystem(), Nektar::CompressibleFlowSystem::SymmetryBC(), UpdateFields(), Nektar::SolverUtils::UnsteadySystem::v_AppendOutput1D(), Nektar::NonlinearSWE::v_ConservativeToPrimitive(), Nektar::LinearSWE::v_ConservativeToPrimitive(), Nektar::SteadyAdvectionDiffusion::v_DoInitialise(), Nektar::VelocityCorrectionScheme::v_DoInitialise(), Nektar::PulseWaveSystem::v_DoInitialise(), Nektar::CoupledLinearNS::v_DoInitialise(), Nektar::EigenValuesAdvection::v_DoSolve(), Nektar::Laplace::v_DoSolve(), Nektar::SteadyAdvectionDiffusion::v_DoSolve(), Nektar::SolverUtils::UnsteadySystem::v_DoSolve(), Nektar::PulseWaveSystem::v_DoSolve(), v_EvaluateExactSolution(), Nektar::Poisson::v_GenerateSummary(), Nektar::IncNavierStokes::v_GetFluxVector(), Nektar::CFLtester::v_GetTimeStep(), Nektar::Poisson::v_InitObject(), Nektar::VelocityCorrectionScheme::v_InitObject(), Nektar::LinearSWE::v_InitObject(), Nektar::NonlinearSWE::v_InitObject(), Nektar::Bidomain::v_InitObject(), Nektar::Monodomain::v_InitObject(), Nektar::UnsteadyDiffusion::v_InitObject(), Nektar::ImageWarpingSystem::v_InitObject(), Nektar::APE::v_InitObject(), Nektar::EulerADCFE::v_InitObject(), Nektar::ShallowWaterSystem::v_InitObject(), Nektar::UnsteadyInviscidBurger::v_InitObject(), Nektar::UnsteadyAdvection::v_InitObject(), Nektar::IncNavierStokes::v_InitObject(), Nektar::UnsteadyAdvectionDiffusion::v_InitObject(), Nektar::CompressibleFlowSystem::v_InitObject(), Nektar::PulseWaveSystem::v_InitObject(), Nektar::CoupledLinearNS::v_InitObject(), v_InitObject(), v_L2Error(), v_LinfError(), Nektar::EigenValuesAdvection::v_NumericalFlux(), Nektar::ImageWarpingSystem::v_NumericalFlux(), Nektar::APE::v_NumericalFlux(), Nektar::CFLtester::v_NumericalFlux(), Nektar::IncNavierStokes::v_NumericalFlux(), Nektar::SolverUtils::UnsteadySystem::v_NumFluxforScalar(), Nektar::SolverUtils::UnsteadySystem::v_NumFluxforVector(), Nektar::CoupledLinearNS::v_Output(), Nektar::NonlinearSWE::v_PrimitiveToConservative(), Nektar::LinearSWE::v_PrimitiveToConservative(), Nektar::NavierStokesCFE::v_SetInitialConditions(), Nektar::EulerCFE::v_SetInitialConditions(), v_SetInitialConditions(), Nektar::VelocityCorrectionScheme::v_TransCoeffToPhys(), Nektar::CoupledLinearNS::v_TransCoeffToPhys(), Nektar::VelocityCorrectionScheme::v_TransPhysToCoeff(), Nektar::CoupledLinearNS::v_TransPhysToCoeff(), Nektar::APE::WallBC(), Nektar::CompressibleFlowSystem::WallBC(), Nektar::NonlinearSWE::WallBoundary(), Nektar::LinearSWE::WallBoundary(), Nektar::NonlinearSWE::WallBoundary2D(), Nektar::LinearSWE::WallBoundary2D(), Nektar::CompressibleFlowSystem::WallViscousBC(), WeakAdvectionDivergenceForm(), WeakAdvectionGreensDivergenceForm(), WeakAdvectionNonConservativeForm(), WeakDGAdvection(), WeakDGDiffusion(), Nektar::SolverUtils::UnsteadySystem::WeakPenaltyforScalar(), Nektar::SolverUtils::UnsteadySystem::WeakPenaltyforVector(), WriteFld(), and ZeroPhysFields().

std::string Nektar::SolverUtils::EquationSystem::m_filename
protected

Filename.

Definition at line 408 of file EquationSystem.h.

Referenced by v_InitObject().

NekDouble Nektar::SolverUtils::EquationSystem::m_fintime
protected

Finish time of the simulation.

Definition at line 414 of file EquationSystem.h.

Referenced by Nektar::SolverUtils::UnsteadySystem::v_DoSolve(), Nektar::PulseWaveSystem::v_InitObject(), and v_InitObject().

LibUtilities::FieldIOSharedPtr Nektar::SolverUtils::EquationSystem::m_fld
protected
Array<OneD, Array<OneD, Array<OneD,NekDouble> > > Nektar::SolverUtils::EquationSystem::m_gradtan
protected

1 x nvariable x nq

Definition at line 452 of file EquationSystem.h.

SpatialDomains::MeshGraphSharedPtr Nektar::SolverUtils::EquationSystem::m_graph
protected
bool Nektar::SolverUtils::EquationSystem::m_HalfMode
protected

Flag to determine if half homogeneous mode is used.

Definition at line 432 of file EquationSystem.h.

Referenced by SetUpBaseFields(), and v_InitObject().

int Nektar::SolverUtils::EquationSystem::m_HomoDirec
protected

number of homogenous directions

Definition at line 484 of file EquationSystem.h.

Referenced by v_InitObject().

bool Nektar::SolverUtils::EquationSystem::m_homogen_dealiasing
protected

Flag to determine if dealiasing is used for homogeneous simulations.

Definition at line 441 of file EquationSystem.h.

Referenced by SetUpBaseFields(), Nektar::VelocityCorrectionScheme::v_GenerateSummary(), Nektar::CoupledLinearNS::v_InitObject(), and v_InitObject().

enum HomogeneousType Nektar::SolverUtils::EquationSystem::m_HomogeneousType
protected
NekDouble Nektar::SolverUtils::EquationSystem::m_lambda
protected

Lambda constant in real system if one required.

Definition at line 418 of file EquationSystem.h.

Referenced by SetLambda(), and Nektar::CoupledLinearNS::v_DoInitialise().

NekDouble Nektar::SolverUtils::EquationSystem::m_LhomX
protected

physical length in X direction (if homogeneous)

Definition at line 476 of file EquationSystem.h.

NekDouble Nektar::SolverUtils::EquationSystem::m_LhomY
protected

physical length in Y direction (if homogeneous)

Definition at line 477 of file EquationSystem.h.

Referenced by v_InitObject().

NekDouble Nektar::SolverUtils::EquationSystem::m_LhomZ
protected

physical length in Z direction (if homogeneous)

Definition at line 478 of file EquationSystem.h.

Referenced by SetUpBaseFields(), Nektar::CoupledLinearNS::SetUpCoupledMatrix(), Nektar::CoupledLinearNS::v_InitObject(), and v_InitObject().

bool Nektar::SolverUtils::EquationSystem::m_MultipleModes
protected

Flag to determine if use multiple homogenenous modes are used.

Definition at line 434 of file EquationSystem.h.

Referenced by SessionSummary(), and v_InitObject().

int Nektar::SolverUtils::EquationSystem::m_npointsX
protected

number of points in X direction (if homogeneous)

Definition at line 480 of file EquationSystem.h.

int Nektar::SolverUtils::EquationSystem::m_npointsY
protected

number of points in Y direction (if homogeneous)

Definition at line 481 of file EquationSystem.h.

Referenced by SessionSummary(), and v_InitObject().

int Nektar::SolverUtils::EquationSystem::m_npointsZ
protected
int Nektar::SolverUtils::EquationSystem::m_NumMode
protected

Mode to use in case of single mode analysis.

Definition at line 486 of file EquationSystem.h.

Referenced by SessionSummary().

int Nektar::SolverUtils::EquationSystem::m_NumQuadPointsError
protected
enum MultiRegions::ProjectionType Nektar::SolverUtils::EquationSystem::m_projectionType
protected

Type of projection; e.g continuous or discontinuous.

Definition at line 448 of file EquationSystem.h.

Referenced by Nektar::NonlinearSWE::AddCoriolis(), Nektar::LinearSWE::AddCoriolis(), Nektar::APE::AddSource(), Nektar::NonlinearSWE::AddVariableDepth(), Nektar::ImageWarpingSystem::DoOdeProjection(), Nektar::NonlinearSWE::DoOdeProjection(), Nektar::LinearSWE::DoOdeProjection(), Nektar::UnsteadyInviscidBurger::DoOdeProjection(), Nektar::UnsteadyDiffusion::DoOdeProjection(), Nektar::NavierStokesCFE::DoOdeProjection(), Nektar::APE::DoOdeProjection(), Nektar::EulerCFE::DoOdeProjection(), Nektar::EulerADCFE::DoOdeProjection(), Nektar::UnsteadyAdvection::DoOdeProjection(), Nektar::UnsteadyAdvectionDiffusion::DoOdeProjection(), Nektar::CFLtester::DoOdeProjection(), Nektar::ImageWarpingSystem::DoOdeRhs(), Nektar::NonlinearSWE::DoOdeRhs(), Nektar::LinearSWE::DoOdeRhs(), Nektar::APE::DoOdeRhs(), Nektar::UnsteadyAdvectionDiffusion::DoOdeRhs(), Nektar::CFLtester::DoOdeRhs(), SessionSummary(), SetUpBaseFields(), Nektar::EigenValuesAdvection::v_DoSolve(), Nektar::VelocityCorrectionScheme::v_InitObject(), Nektar::LinearSWE::v_InitObject(), Nektar::NonlinearSWE::v_InitObject(), Nektar::UnsteadyDiffusion::v_InitObject(), Nektar::APE::v_InitObject(), Nektar::ShallowWaterSystem::v_InitObject(), Nektar::UnsteadyInviscidBurger::v_InitObject(), Nektar::UnsteadyAdvection::v_InitObject(), Nektar::UnsteadyAdvectionDiffusion::v_InitObject(), Nektar::CompressibleFlowSystem::v_InitObject(), Nektar::PulseWaveSystem::v_InitObject(), and v_InitObject().

LibUtilities::SessionReaderSharedPtr Nektar::SolverUtils::EquationSystem::m_session
protected

The session reader.

Definition at line 394 of file EquationSystem.h.

Referenced by Nektar::SolverUtils::UnsteadySystem::CheckForRestartTime(), Nektar::CoupledLinearNS::DefineForcingTerm(), DescribeFunction(), Nektar::Bidomain::DoImplicitSolve(), Nektar::ImageWarpingSystem::DoOdeRhs(), Nektar::Bidomain::DoOdeRhs(), ErrorExtraPoints(), EvaluateFunction(), GetNvariables(), GetSession(), GetVariable(), Nektar::Helmholtz::Helmholtz(), ImportFld(), ImportFldBase(), ImportFldToMultiDomains(), PrintSummary(), SessionSummary(), Nektar::NavierStokesCFE::SetBoundaryConditions(), Nektar::NonlinearSWE::SetBoundaryConditions(), Nektar::EulerADCFE::SetBoundaryConditions(), Nektar::EulerCFE::SetBoundaryConditions(), Nektar::LinearSWE::SetBoundaryConditions(), Nektar::APE::SetBoundaryConditions(), Nektar::IncNavierStokes::SetBoundaryConditions(), SetBoundaryConditions(), Nektar::EulerCFE::SetBoundaryRinglebFlow(), Nektar::PulseWavePropagation::SetPulseWaveBoundaryConditions(), SetUpBaseFields(), Nektar::CoupledLinearNS::SetUpCoupledMatrix(), Nektar::SteadyAdvectionDiffusion::v_DoInitialise(), Nektar::PulseWaveSystem::v_DoInitialise(), Nektar::CoupledLinearNS::v_DoInitialise(), Nektar::SolverUtils::UnsteadySystem::v_DoSolve(), Nektar::PulseWaveSystem::v_DoSolve(), v_EvaluateExactSolution(), Nektar::Poisson::v_GenerateSummary(), Nektar::LinearSWE::v_GenerateSummary(), Nektar::Monodomain::v_GenerateSummary(), Nektar::SolverUtils::UnsteadySystem::v_GenerateSummary(), Nektar::VelocityCorrectionScheme::v_GetForceDimension(), Nektar::CoupledLinearNS::v_GetForceDimension(), Nektar::Poisson::v_GetSystemSingularChecks(), Nektar::Helmholtz::v_GetSystemSingularChecks(), Nektar::Laplace::v_GetSystemSingularChecks(), Nektar::VelocityCorrectionScheme::v_GetSystemSingularChecks(), v_GetSystemSingularChecks(), Nektar::Poisson::v_InitObject(), Nektar::SteadyAdvectionDiffusionReaction::v_InitObject(), Nektar::VelocityCorrectionScheme::v_InitObject(), Nektar::PulseWaveSystemOutput::v_InitObject(), Nektar::LinearSWE::v_InitObject(), Nektar::NonlinearSWE::v_InitObject(), Nektar::Bidomain::v_InitObject(), Nektar::Monodomain::v_InitObject(), Nektar::UnsteadyDiffusion::v_InitObject(), Nektar::ImageWarpingSystem::v_InitObject(), Nektar::PulseWavePropagation::v_InitObject(), Nektar::APE::v_InitObject(), Nektar::EulerCFE::v_InitObject(), Nektar::NavierStokesCFE::v_InitObject(), Nektar::EulerADCFE::v_InitObject(), Nektar::ShallowWaterSystem::v_InitObject(), Nektar::SolverUtils::UnsteadySystem::v_InitObject(), Nektar::UnsteadyInviscidBurger::v_InitObject(), Nektar::UnsteadyAdvection::v_InitObject(), Nektar::IncNavierStokes::v_InitObject(), Nektar::UnsteadyAdvectionDiffusion::v_InitObject(), Nektar::CompressibleFlowSystem::v_InitObject(), Nektar::PulseWaveSystem::v_InitObject(), Nektar::CoupledLinearNS::v_InitObject(), v_InitObject(), Nektar::PulseWaveSystem::v_L2Error(), v_L2Error(), Nektar::PulseWaveSystem::v_LinfError(), v_LinfError(), Nektar::NavierStokesCFE::v_SetInitialConditions(), Nektar::EulerCFE::v_SetInitialConditions(), v_SetInitialConditions(), Nektar::SolverUtils::UnsteadySystem::WeakPenaltyforScalar(), Nektar::SolverUtils::UnsteadySystem::WeakPenaltyforVector(), and Nektar::PulseWaveSystem::WriteVessels().

std::string Nektar::SolverUtils::EquationSystem::m_sessionName
protected
bool Nektar::SolverUtils::EquationSystem::m_SingleMode
protected

Flag to determine if single homogeneous mode is used.

Definition at line 430 of file EquationSystem.h.

Referenced by SetUpBaseFields(), and v_InitObject().

int Nektar::SolverUtils::EquationSystem::m_spacedim
protected

Spatial dimension (>= expansion dim).

Definition at line 426 of file EquationSystem.h.

Referenced by Nektar::NonlinearSWE::AddVariableDepth(), Nektar::Bidomain::DoImplicitSolve(), Nektar::NonlinearSWE::DoOdeRhs(), Nektar::LinearSWE::DoOdeRhs(), Nektar::NavierStokesCFE::DoOdeRhs(), Nektar::APE::DoOdeRhs(), Nektar::EulerCFE::DoOdeRhs(), Nektar::EulerCFE::EvaluateIsentropicVortex(), Nektar::CompressibleFlowSystem::ExtrapOrder0BC(), Nektar::APE::GetBasefield(), Nektar::EulerCFE::GetExactIsentropicVortex(), Nektar::NonlinearSWE::GetFluxVector(), Nektar::LinearSWE::GetFluxVector(), Nektar::CompressibleFlowSystem::GetFluxVector(), Nektar::UnsteadyAdvection::GetFluxVectorDeAlias(), Nektar::CompressibleFlowSystem::GetFluxVectorDeAlias(), Nektar::UnsteadyInviscidBurger::GetNormalVelocity(), Nektar::CompressibleFlowSystem::GetPressure(), Nektar::NonlinearSWE::GetVelocityVector(), Nektar::LinearSWE::GetVelocityVector(), Nektar::CompressibleFlowSystem::GetViscousFluxVector(), Nektar::CompressibleFlowSystem::GetViscousFluxVectorDeAlias(), InitialiseBaseFlow(), Nektar::CompressibleFlowSystem::RiemannInvariantBC(), SessionSummary(), Nektar::EulerCFE::SetInitialIsentropicVortex(), Nektar::CompressibleFlowSystem::SymmetryBC(), Nektar::SolverUtils::UnsteadySystem::v_DoSolve(), Nektar::EigenValuesAdvection::v_InitObject(), Nektar::SteadyAdvectionDiffusion::v_InitObject(), Nektar::Bidomain::v_InitObject(), Nektar::Monodomain::v_InitObject(), Nektar::ImageWarpingSystem::v_InitObject(), Nektar::APE::v_InitObject(), Nektar::EulerADCFE::v_InitObject(), Nektar::ShallowWaterSystem::v_InitObject(), Nektar::UnsteadyAdvection::v_InitObject(), Nektar::CFLtester::v_InitObject(), Nektar::IncNavierStokes::v_InitObject(), Nektar::UnsteadyAdvectionDiffusion::v_InitObject(), Nektar::CompressibleFlowSystem::v_InitObject(), v_InitObject(), Nektar::EigenValuesAdvection::v_NumericalFlux(), Nektar::ImageWarpingSystem::v_NumericalFlux(), Nektar::APE::v_NumericalFlux(), Nektar::CFLtester::v_NumericalFlux(), Nektar::IncNavierStokes::v_NumericalFlux(), Nektar::APE::WallBC(), Nektar::CompressibleFlowSystem::WallBC(), Nektar::NonlinearSWE::WallBoundary(), Nektar::LinearSWE::WallBoundary(), Nektar::CompressibleFlowSystem::WallViscousBC(), and WeakDGDiffusion().

bool Nektar::SolverUtils::EquationSystem::m_specHP_dealiasing
protected

Flag to determine if dealisising is usde for the Spectral/hp element discretisation.

Definition at line 446 of file EquationSystem.h.

Referenced by Nektar::UnsteadyAdvection::v_InitObject(), Nektar::CompressibleFlowSystem::v_InitObject(), and v_InitObject().

int Nektar::SolverUtils::EquationSystem::m_steps
protected
Array<OneD, Array<OneD, Array<OneD,NekDouble> > > Nektar::SolverUtils::EquationSystem::m_tanbasis
protected

2 x m_spacedim x nq

Definition at line 454 of file EquationSystem.h.

Referenced by WeakDGDiffusion().

NekDouble Nektar::SolverUtils::EquationSystem::m_time
protected
NekDouble Nektar::SolverUtils::EquationSystem::m_timestep
protected
Array<OneD, Array<OneD, NekDouble> > Nektar::SolverUtils::EquationSystem::m_traceNormals
protected
bool Nektar::SolverUtils::EquationSystem::m_useFFT
protected

Flag to determine if FFT is used for homogeneous transform.

Definition at line 436 of file EquationSystem.h.

Referenced by SessionSummary(), SetUpBaseFields(), Nektar::CoupledLinearNS::v_InitObject(), and v_InitObject().