Nektar++
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Nektar::NonlinearPeregrine Class Reference

#include <NonlinearPeregrine.h>

Inheritance diagram for Nektar::NonlinearPeregrine:
[legend]

Public Member Functions

virtual ~NonlinearPeregrine ()
 problem type selector More...
 
- Public Member Functions inherited from Nektar::ShallowWaterSystem
virtual ~ShallowWaterSystem ()
 Destructor. More...
 
- Public Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
virtual SOLVER_UTILS_EXPORT ~UnsteadySystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT NekDouble GetTimeStep (const Array< OneD, const Array< OneD, NekDouble >> &inarray)
 Calculate the larger time-step mantaining the problem stable. More...
 
- Public Member Functions inherited from Nektar::SolverUtils::EquationSystem
virtual SOLVER_UTILS_EXPORT ~EquationSystem ()
 Destructor. More...
 
SOLVER_UTILS_EXPORT void SetUpTraceNormals (void)
 
SOLVER_UTILS_EXPORT void InitObject ()
 Initialises the members of this object. More...
 
SOLVER_UTILS_EXPORT void DoInitialise ()
 Perform any initialisation necessary before solving the problem. More...
 
SOLVER_UTILS_EXPORT void DoSolve ()
 Solve the problem. More...
 
SOLVER_UTILS_EXPORT void TransCoeffToPhys ()
 Transform from coefficient to physical space. More...
 
SOLVER_UTILS_EXPORT void TransPhysToCoeff ()
 Transform from physical to coefficient space. More...
 
SOLVER_UTILS_EXPORT void Output ()
 Perform output operations after solve. More...
 
SOLVER_UTILS_EXPORT NekDouble LinfError (unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
 Linf error computation. More...
 
SOLVER_UTILS_EXPORT std::string GetSessionName ()
 Get Session name. More...
 
template<class T >
std::shared_ptr< T > as ()
 
SOLVER_UTILS_EXPORT void ResetSessionName (std::string newname)
 Reset Session name. More...
 
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr GetSession ()
 Get Session name. More...
 
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure ()
 Get pressure field if available. More...
 
SOLVER_UTILS_EXPORT void ExtraFldOutput (std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
 
SOLVER_UTILS_EXPORT void PrintSummary (std::ostream &out)
 Print a summary of parameters and solver characteristics. More...
 
SOLVER_UTILS_EXPORT void SetLambda (NekDouble lambda)
 Set parameter m_lambda. More...
 
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction (std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
 Get a SessionFunction by name. More...
 
SOLVER_UTILS_EXPORT void SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Initialise the data in the dependent fields. More...
 
SOLVER_UTILS_EXPORT void EvaluateExactSolution (int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 Evaluates an exact solution. More...
 
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. More...
 
SOLVER_UTILS_EXPORT NekDouble L2Error (unsigned int field, bool Normalised=false)
 Compute the L2 error of the fields. More...
 
SOLVER_UTILS_EXPORT Array< OneD, NekDoubleErrorExtraPoints (unsigned int field)
 Compute error (L2 and L_inf) over an larger set of quadrature points return [L2 Linf]. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_Output (const int n)
 Write checkpoint file of m_fields. More...
 
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. More...
 
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow (const int n)
 Write base flow file of m_fields. More...
 
SOLVER_UTILS_EXPORT void WriteFld (const std::string &outname)
 Write field data to the given filename. More...
 
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. More...
 
SOLVER_UTILS_EXPORT void ImportFld (const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
 Input field data from the given file. More...
 
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. More...
 
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. More...
 
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. More...
 
SOLVER_UTILS_EXPORT void SessionSummary (SummaryList &vSummary)
 Write out a session summary. More...
 
SOLVER_UTILS_EXPORT Array< OneD, MultiRegions::ExpListSharedPtr > & UpdateFields ()
 
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMapUpdateFieldMetaDataMap ()
 Get hold of FieldInfoMap so it can be updated. More...
 
SOLVER_UTILS_EXPORT NekDouble GetFinalTime ()
 Return final time. More...
 
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 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 SetSteps (const int steps)
 
SOLVER_UTILS_EXPORT void ZeroPhysFields ()
 
SOLVER_UTILS_EXPORT void FwdTransFields ()
 
SOLVER_UTILS_EXPORT void SetModifiedBasis (const bool modbasis)
 
SOLVER_UTILS_EXPORT int GetCheckpointNumber ()
 
SOLVER_UTILS_EXPORT void SetCheckpointNumber (int num)
 
SOLVER_UTILS_EXPORT int GetCheckpointSteps ()
 
SOLVER_UTILS_EXPORT void SetCheckpointSteps (int num)
 
SOLVER_UTILS_EXPORT void SetTime (const NekDouble time)
 
SOLVER_UTILS_EXPORT void SetInitialStep (const int step)
 
SOLVER_UTILS_EXPORT void SetBoundaryConditions (NekDouble time)
 Evaluates the boundary conditions at the given time. More...
 
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp ()
 Virtual function to identify if operator is negated in DoSolve. More...
 

Static Public Member Functions

static SolverUtils::EquationSystemSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Creates an instance of this class. More...
 
- Static Public Member Functions inherited from Nektar::ShallowWaterSystem
static SolverUtils::EquationSystemSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Creates an instance of this class. More...
 

Public Attributes

ProblemType m_problemType
 
- Public Attributes inherited from Nektar::SolverUtils::UnsteadySystem
NekDouble m_cflSafetyFactor
 CFL safety factor (comprise between 0 to 1). More...
 

Static Public Attributes

static std::string className
 Name of class. More...
 
- Static Public Attributes inherited from Nektar::ShallowWaterSystem
static std::string className
 Name of class. More...
 

Protected Member Functions

 NonlinearPeregrine (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 
virtual void v_InitObject ()
 Init object for UnsteadySystem class. More...
 
void DoOdeRhs (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 
void DoOdeProjection (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
 
void GetFluxVector (const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
 
virtual void v_GenerateSummary (SolverUtils::SummaryList &s)
 Print a summary of time stepping parameters. More...
 
virtual void v_PrimitiveToConservative ()
 
virtual void v_ConservativeToPrimitive ()
 
virtual void v_SetInitialConditions (NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
 Set the initial conditions. More...
 
const Array< OneD, NekDouble > & GetDepthFwd ()
 
const Array< OneD, NekDouble > & GetDepthBwd ()
 
- Protected Member Functions inherited from Nektar::ShallowWaterSystem
 ShallowWaterSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises UnsteadySystem class members. More...
 
void PrimitiveToConservative ()
 
void ConservativeToPrimitive ()
 
NekDouble GetGravity ()
 
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs ()
 
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals ()
 
const Array< OneD, NekDouble > & GetDepth ()
 
bool IsConstantDepth ()
 
void CopyBoundaryTrace (const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
 
- Protected Member Functions inherited from Nektar::SolverUtils::UnsteadySystem
SOLVER_UTILS_EXPORT UnsteadySystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises UnsteadySystem class members. More...
 
SOLVER_UTILS_EXPORT NekDouble MaxTimeStepEstimator ()
 Get the maximum timestep estimator for cfl control. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoSolve ()
 Solves an unsteady problem. More...
 
virtual SOLVER_UTILS_EXPORT void v_DoInitialise ()
 Sets up initial conditions. More...
 
virtual SOLVER_UTILS_EXPORT void v_AppendOutput1D (Array< OneD, Array< OneD, NekDouble >> &solution1D)
 Print the solution at each solution point in a txt file. More...
 
virtual SOLVER_UTILS_EXPORT NekDouble v_GetTimeStep (const Array< OneD, const Array< OneD, NekDouble >> &inarray)
 Return the timestep to be used for the next step in the time-marching loop. More...
 
virtual SOLVER_UTILS_EXPORT bool v_PreIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_PostIntegrate (int step)
 
virtual SOLVER_UTILS_EXPORT bool v_RequireFwdTrans ()
 
SOLVER_UTILS_EXPORT void CheckForRestartTime (NekDouble &time, int &nchk)
 
SOLVER_UTILS_EXPORT void SVVVarDiffCoeff (const Array< OneD, Array< OneD, NekDouble >> vel, StdRegions::VarCoeffMap &varCoeffMap)
 Evaluate the SVV diffusion coefficient according to Moura's paper where it should proportional to h time velocity. More...
 
- Protected Member Functions inherited from Nektar::SolverUtils::EquationSystem
SOLVER_UTILS_EXPORT EquationSystem (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Initialises EquationSystem class members. More...
 
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. More...
 
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. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys ()
 Virtual function for transformation to physical space. More...
 
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff ()
 Virtual function for transformation to coefficient space. More...
 
virtual SOLVER_UTILS_EXPORT void v_EvaluateExactSolution (unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
 
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

StdRegions::ConstFactorMap m_factors
 
Array< OneD, NekDoublem_dFwd
 Still water depth traces. More...
 
Array< OneD, NekDoublem_dBwd
 
- Protected Attributes inherited from Nektar::ShallowWaterSystem
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
 
SolverUtils::RiemannSolverSharedPtr m_riemannSolverLDG
 
SolverUtils::AdvectionSharedPtr m_advection
 
SolverUtils::DiffusionSharedPtr m_diffusion
 
bool m_primitive
 Indicates if variables are primitive or conservative. More...
 
bool m_constantDepth
 Indicates if constant depth case. More...
 
NekDouble m_g
 Acceleration of gravity. More...
 
Array< OneD, NekDoublem_depth
 Still water depth. More...
 
Array< OneD, Array< OneD, NekDouble > > m_bottomSlope
 
Array< OneD, NekDoublem_coriolis
 Coriolis force. More...
 
Array< OneD, Array< OneD, NekDouble > > m_vecLocs
 
- Protected Attributes inherited from Nektar::SolverUtils::UnsteadySystem
int m_infosteps
 Number of time steps between outputting status information. More...
 
int m_abortSteps
 Number of steps between checks for abort conditions. More...
 
int m_filtersInfosteps
 Number of time steps between outputting filters information. More...
 
int m_nanSteps
 
LibUtilities::TimeIntegrationWrapperSharedPtr m_intScheme
 Wrapper to the time integration scheme. More...
 
LibUtilities::TimeIntegrationSchemeOperators m_ode
 The time integration scheme operators to use. More...
 
LibUtilities::TimeIntegrationSolutionSharedPtr m_intSoln
 
NekDouble m_epsilon
 
bool m_explicitDiffusion
 Indicates if explicit or implicit treatment of diffusion is used. More...
 
bool m_explicitAdvection
 Indicates if explicit or implicit treatment of advection is used. More...
 
bool m_explicitReaction
 Indicates if explicit or implicit treatment of reaction is used. More...
 
bool m_homoInitialFwd
 Flag to determine if simulation should start in homogeneous forward transformed state. More...
 
NekDouble m_steadyStateTol
 Tolerance to which steady state should be evaluated at. More...
 
int m_steadyStateSteps
 Check for steady state at step interval. More...
 
Array< OneD, Array< OneD, NekDouble > > m_previousSolution
 Storage for previous solution for steady-state check. More...
 
std::ofstream m_errFile
 
std::vector< int > m_intVariables
 
std::vector< std::pair< std::string, FilterSharedPtr > > m_filters
 
NekDouble m_filterTimeWarning
 Number of time steps between outputting status information. More...
 
- Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
LibUtilities::CommSharedPtr m_comm
 Communicator. More...
 
LibUtilities::SessionReaderSharedPtr m_session
 The session reader. More...
 
std::map< std::string, SolverUtils::SessionFunctionSharedPtrm_sessionFunctions
 Map of known SessionFunctions. More...
 
LibUtilities::FieldIOSharedPtr m_fld
 Field input/output. More...
 
Array< OneD, MultiRegions::ExpListSharedPtrm_fields
 Array holding all dependent variables. More...
 
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
 Pointer to boundary conditions object. More...
 
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to graph defining mesh. More...
 
std::string m_sessionName
 Name of the session. More...
 
NekDouble m_time
 Current time of simulation. More...
 
int m_initialStep
 Number of the step where the simulation should begin. More...
 
NekDouble m_fintime
 Finish time of the simulation. More...
 
NekDouble m_timestep
 Time step size. More...
 
NekDouble m_lambda
 Lambda constant in real system if one required. More...
 
NekDouble m_checktime
 Time between checkpoints. More...
 
int m_nchk
 Number of checkpoints written so far. More...
 
int m_steps
 Number of steps to take. More...
 
int m_checksteps
 Number of steps between checkpoints. More...
 
int m_spacedim
 Spatial dimension (>= expansion dim). More...
 
int m_expdim
 Expansion dimension. More...
 
bool m_singleMode
 Flag to determine if single homogeneous mode is used. More...
 
bool m_halfMode
 Flag to determine if half homogeneous mode is used. More...
 
bool m_multipleModes
 Flag to determine if use multiple homogenenous modes are used. More...
 
bool m_useFFT
 Flag to determine if FFT is used for homogeneous transform. More...
 
bool m_homogen_dealiasing
 Flag to determine if dealiasing is used for homogeneous simulations. More...
 
bool m_specHP_dealiasing
 Flag to determine if dealisising is usde for the Spectral/hp element discretisation. More...
 
enum MultiRegions::ProjectionType m_projectionType
 Type of projection; e.g continuous or discontinuous. More...
 
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
 Array holding trace normals for DG simulations in the forwards direction. More...
 
Array< OneD, bool > m_checkIfSystemSingular
 Flag to indicate if the fields should be checked for singularity. More...
 
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
 Map to identify relevant solver info to dump in output fields. More...
 
int m_NumQuadPointsError
 Number of Quadrature points used to work out the error. More...
 
enum HomogeneousType m_HomogeneousType
 
NekDouble m_LhomX
 physical length in X direction (if homogeneous) More...
 
NekDouble m_LhomY
 physical length in Y direction (if homogeneous) More...
 
NekDouble m_LhomZ
 physical length in Z direction (if homogeneous) More...
 
int m_npointsX
 number of points in X direction (if homogeneous) More...
 
int m_npointsY
 number of points in Y direction (if homogeneous) More...
 
int m_npointsZ
 number of points in Z direction (if homogeneous) More...
 
int m_HomoDirec
 number of homogenous directions More...
 

Private Member Functions

void NumericalFlux1D (Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numfluxX)
 
void NumericalFlux2D (Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &numfluxX, Array< OneD, Array< OneD, NekDouble > > &numfluxY)
 
void LaitoneSolitaryWave (NekDouble amp, NekDouble d, NekDouble time, NekDouble x_offset)
 
void SetBoundaryConditions (Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
 
void WallBoundary2D (int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
 
void WallBoundary (int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
 Wall boundary condition. More...
 
void AddCoriolis (const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
void AddVariableDepth (const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
 
void ConservativeToPrimitive (const Array< OneD, const Array< OneD, NekDouble > > &physin, Array< OneD, Array< OneD, NekDouble > > &physout)
 
void PrimitiveToConservative (const Array< OneD, const Array< OneD, NekDouble > > &physin, Array< OneD, Array< OneD, NekDouble > > &physout)
 
void GetVelocityVector (const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
 Compute the velocity field \( \mathbf{v} \) given the momentum \( h\mathbf{v} \). More...
 
void WCESolve (Array< OneD, NekDouble > &fce, NekDouble lambda)
 
void NumericalFluxForcing (const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &numfluxX, Array< OneD, NekDouble > &numfluxY)
 
void SetBoundaryConditionsForcing (Array< OneD, Array< OneD, NekDouble > > &inarray, NekDouble time)
 
void WallBoundaryForcing (int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
 
void SetBoundaryConditionsContVariables (Array< OneD, NekDouble > &inarray, NekDouble time)
 
void WallBoundaryContVariables (int bcRegion, int cnt, Array< OneD, NekDouble > &inarray)
 
void NumericalFluxConsVariables (Array< OneD, NekDouble > &physfield, Array< OneD, NekDouble > &outX, Array< OneD, NekDouble > &outY)
 

Private Attributes

NekDouble m_const_depth
 

Friends

class MemoryManager< NonlinearPeregrine >
 

Additional Inherited Members

- Protected Types inherited from Nektar::SolverUtils::EquationSystem
enum  HomogeneousType { eHomogeneous1D, eHomogeneous2D, eHomogeneous3D, eNotHomogeneous }
 Parameter for homogeneous expansions. More...
 
- Static Protected Attributes inherited from Nektar::SolverUtils::EquationSystem
static std::string equationSystemTypeLookupIds []
 

Detailed Description

Definition at line 58 of file NonlinearPeregrine.h.

Constructor & Destructor Documentation

◆ ~NonlinearPeregrine()

Nektar::NonlinearPeregrine::~NonlinearPeregrine ( )
virtual

problem type selector

Definition at line 169 of file NonlinearPeregrine.cpp.

170 {
171 
172 }

◆ NonlinearPeregrine()

Nektar::NonlinearPeregrine::NonlinearPeregrine ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
protected

Definition at line 55 of file NonlinearPeregrine.cpp.

References Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eFactorTau, and m_factors.

58  : ShallowWaterSystem(pSession, pGraph), m_factors()
59 {
61  m_factors[StdRegions::eFactorTau] = 1000000.0;
62  // note: eFactorTau = 1.0 becomes unstable...
63  // we need to investigate the behaviuor w.r.t. tau
64 }
ShallowWaterSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.
StdRegions::ConstFactorMap m_factors

Member Function Documentation

◆ AddCoriolis()

void Nektar::NonlinearPeregrine::AddCoriolis ( const Array< OneD, const Array< OneD, NekDouble > > &  physarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
private

Definition at line 175 of file NonlinearPeregrine.cpp.

References ASSERTL0, Nektar::MultiRegions::eDiscontinuous, Nektar::MultiRegions::eGalerkin, Nektar::MultiRegions::eMixed_CG_Discontinuous, Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::ShallowWaterSystem::m_coriolis, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_projectionType, Vmath::Neg(), Vmath::Vadd(), and Vmath::Vmul().

Referenced by DoOdeRhs().

178 {
179 
180  int ncoeffs = GetNcoeffs();
181  int nq = GetTotPoints();
182 
183  Array<OneD, NekDouble> tmp(nq);
184  Array<OneD, NekDouble> mod(ncoeffs);
185 
186  switch (m_projectionType)
187  {
189  {
190  // add to hu equation
191  Vmath::Vmul(nq, m_coriolis, 1, physarray[2], 1, tmp, 1);
192  m_fields[0]->IProductWRTBase(tmp, mod);
193  m_fields[0]->MultiplyByElmtInvMass(mod, mod);
194  m_fields[0]->BwdTrans(mod, tmp);
195  Vmath::Vadd(nq, tmp, 1, outarray[1], 1, outarray[1], 1);
196 
197  // add to hv equation
198  Vmath::Vmul(nq, m_coriolis, 1, physarray[1], 1, tmp, 1);
199  Vmath::Neg(nq, tmp, 1);
200  m_fields[0]->IProductWRTBase(tmp, mod);
201  m_fields[0]->MultiplyByElmtInvMass(mod, mod);
202  m_fields[0]->BwdTrans(mod, tmp);
203  Vmath::Vadd(nq, tmp, 1, outarray[2], 1, outarray[2], 1);
204  break;
205  }
208  {
209  // add to hu equation
210  Vmath::Vmul(nq, m_coriolis, 1, physarray[2], 1, tmp, 1);
211  Vmath::Vadd(nq, tmp, 1, outarray[1], 1, outarray[1], 1);
212 
213  // add to hv equation
214  Vmath::Vmul(nq, m_coriolis, 1, physarray[1], 1, tmp, 1);
215  Vmath::Neg(nq, tmp, 1);
216  Vmath::Vadd(nq, tmp, 1, outarray[2], 1, outarray[2], 1);
217  break;
218  }
219  default:
220  ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
221  break;
222  }
223 
224 }
Array< OneD, NekDouble > m_coriolis
Coriolis force.
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT int GetTotPoints()
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetNcoeffs()
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ AddVariableDepth()

void Nektar::NonlinearPeregrine::AddVariableDepth ( const Array< OneD, const Array< OneD, NekDouble > > &  physarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray 
)
private

Definition at line 227 of file NonlinearPeregrine.cpp.

References ASSERTL0, Nektar::MultiRegions::eDiscontinuous, Nektar::MultiRegions::eGalerkin, Nektar::MultiRegions::eMixed_CG_Discontinuous, Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::ShallowWaterSystem::m_bottomSlope, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::ShallowWaterSystem::m_g, Nektar::SolverUtils::EquationSystem::m_projectionType, Nektar::SolverUtils::EquationSystem::m_spacedim, Vmath::Smul(), Vmath::Vadd(), and Vmath::Vmul().

230 {
231 
232  int ncoeffs = GetNcoeffs();
233  int nq = GetTotPoints();
234 
235  Array<OneD, NekDouble> tmp(nq);
236  Array<OneD, NekDouble> mod(ncoeffs);
237 
238  switch (m_projectionType)
239  {
241  {
242  for (int i = 0; i < m_spacedim; ++i)
243  {
244  Vmath::Vmul(nq, m_bottomSlope[i], 1, physarray[0], 1, tmp, 1);
245  Vmath::Smul(nq, m_g, tmp, 1, tmp, 1);
246  m_fields[0]->IProductWRTBase(tmp, mod);
247  m_fields[0]->MultiplyByElmtInvMass(mod, mod);
248  m_fields[0]->BwdTrans(mod, tmp);
249  Vmath::Vadd(nq, tmp, 1, outarray[i + 1], 1, outarray[i + 1], 1);
250  }
251  break;
252  }
255  {
256  for (int i = 0; i < m_spacedim; ++i)
257  {
258  Vmath::Vmul(nq, m_bottomSlope[i], 1, physarray[0], 1, tmp, 1);
259  Vmath::Smul(nq, m_g, tmp, 1, tmp, 1);
260  Vmath::Vadd(nq, tmp, 1, outarray[i + 1], 1, outarray[i + 1], 1);
261  }
262  break;
263  }
264  default:
265  ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
266  break;
267  }
268 
269 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT int GetTotPoints()
Array< OneD, Array< OneD, NekDouble > > m_bottomSlope
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
int m_spacedim
Spatial dimension (>= expansion dim).
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetNcoeffs()
NekDouble m_g
Acceleration of gravity.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ ConservativeToPrimitive()

void Nektar::NonlinearPeregrine::ConservativeToPrimitive ( const Array< OneD, const Array< OneD, NekDouble > > &  physin,
Array< OneD, Array< OneD, NekDouble > > &  physout 
)
private

Definition at line 753 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::ShallowWaterSystem::m_depth, Vmath::Vcopy(), Vmath::Vdiv(), and Vmath::Vsub().

756 {
757  int nq = GetTotPoints();
758 
759  if (physin.get() == physout.get())
760  {
761  // copy indata and work with tmp array
762  Array<OneD, Array<OneD, NekDouble> > tmp(3);
763  for (int i = 0; i < 3; ++i)
764  {
765  // deep copy
766  tmp[i] = Array<OneD, NekDouble>(nq);
767  Vmath::Vcopy(nq, physin[i], 1, tmp[i], 1);
768  }
769 
770  // \eta = h - d
771  Vmath::Vsub(nq, tmp[0], 1, m_depth, 1, physout[0], 1);
772 
773  // u = hu/h
774  Vmath::Vdiv(nq, tmp[1], 1, tmp[0], 1, physout[1], 1);
775 
776  // v = hv/ v
777  Vmath::Vdiv(nq, tmp[2], 1, tmp[0], 1, physout[2], 1);
778  }
779  else
780  {
781  // \eta = h - d
782  Vmath::Vsub(nq, physin[0], 1, m_depth, 1, physout[0], 1);
783 
784  // u = hu/h
785  Vmath::Vdiv(nq, physin[1], 1, physin[0], 1, physout[1], 1);
786 
787  // v = hv/ v
788  Vmath::Vdiv(nq, physin[2], 1, physin[0], 1, physout[2], 1);
789  }
790 }
Array< OneD, NekDouble > m_depth
Still water depth.
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:244
SOLVER_UTILS_EXPORT int GetTotPoints()
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

◆ create()

static SolverUtils::EquationSystemSharedPtr Nektar::NonlinearPeregrine::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
inlinestatic

Creates an instance of this class.

Definition at line 64 of file NonlinearPeregrine.h.

References CellMLToNektar.cellml_metadata::p.

67  {
69  NonlinearPeregrine>::AllocateSharedPtr(pSession, pGraph);
70  p->InitObject();
71  return p;
72  }
NonlinearPeregrine(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.

◆ DoOdeProjection()

void Nektar::NonlinearPeregrine::DoOdeProjection ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protected

Definition at line 494 of file NonlinearPeregrine.cpp.

References ASSERTL0, Nektar::MultiRegions::eDiscontinuous, Nektar::MultiRegions::eGalerkin, Nektar::MultiRegions::eMixed_CG_Discontinuous, Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::GetNpoints(), Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_projectionType, SetBoundaryConditions(), Nektar::SolverUtils::EquationSystem::SetBoundaryConditions(), and Vmath::Vcopy().

Referenced by v_InitObject().

498 {
499  int i;
500  int nvariables = inarray.num_elements();
501 
502  switch (m_projectionType)
503  {
505  {
506 
507  // Just copy over array
508  int npoints = GetNpoints();
509 
510  for (i = 0; i < nvariables; ++i)
511  {
512  Vmath::Vcopy(npoints, inarray[i], 1, outarray[i], 1);
513  }
514 
515  SetBoundaryConditions(outarray, time);
516  break;
517  }
520  {
521 
523  Array<OneD, NekDouble> coeffs(m_fields[0]->GetNcoeffs());
524 
525  for (i = 0; i < nvariables; ++i)
526  {
527  m_fields[i]->FwdTrans(inarray[i], coeffs);
528  m_fields[i]->BwdTrans_IterPerExp(coeffs, outarray[i]);
529  }
530  break;
531  }
532  default:
533  ASSERTL0(false, "Unknown projection scheme");
534  break;
535  }
536 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
void SetBoundaryConditions(Array< OneD, Array< OneD, NekDouble > > &physarray, NekDouble time)
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
SOLVER_UTILS_EXPORT int GetNpoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetNcoeffs()
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

◆ DoOdeRhs()

void Nektar::NonlinearPeregrine::DoOdeRhs ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble  time 
)
protected

Definition at line 271 of file NonlinearPeregrine.cpp.

References AddCoriolis(), ASSERTL0, Nektar::MultiRegions::eDiscontinuous, Nektar::MultiRegions::eGalerkin, Nektar::MultiRegions::eMixed_CG_Discontinuous, Nektar::SolverUtils::EquationSystem::GetNcoeffs(), Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), Nektar::ShallowWaterSystem::m_advection, m_const_depth, Nektar::ShallowWaterSystem::m_constantDepth, Nektar::ShallowWaterSystem::m_coriolis, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_projectionType, Vmath::Neg(), NumericalFluxConsVariables(), NumericalFluxForcing(), SetBoundaryConditionsContVariables(), SetBoundaryConditionsForcing(), Vmath::Smul(), Vmath::Vadd(), Vmath::Vcopy(), and WCESolve().

Referenced by v_InitObject().

274 {
275  int i;
276  int nvariables = inarray.num_elements();
277  int ncoeffs = GetNcoeffs();
278  int nq = GetTotPoints();
279 
280  switch (m_projectionType)
281  {
283  {
284 
285  //-------------------------------------------------------
286  //inarray in physical space
287 
288  Array<OneD, Array<OneD, NekDouble> > modarray(nvariables);
289  for (i = 0; i < nvariables; ++i)
290  {
291  modarray[i] = Array<OneD, NekDouble>(ncoeffs, 0.0);
292  }
293  //-------------------------------------------------------
294 
295  //-------------------------------------------------------
296  // Compute the DG advection including the numerical flux
297  // by using SolverUtils/Advection
298  // Input and output in physical space
299  Array<OneD, Array<OneD, NekDouble> > advVel;
300 
301  m_advection->Advect(nvariables - 1, m_fields, advVel, inarray,
302  outarray, time);
303  //-------------------------------------------------------
304 
305  //-------------------------------------------------------
306  // negate the outarray since moving terms to the rhs
307  for (i = 0; i < nvariables - 1; ++i)
308  {
309  Vmath::Neg(nq, outarray[i], 1);
310  }
311  //-------------------------------------------------------
312 
313  //-------------------------------------------------
314  // Add "source terms"
315  // Input and output in physical space
316 
317  // Coriolis forcing
318  if (m_coriolis.num_elements() != 0)
319  {
320  AddCoriolis(inarray, outarray);
321  }
322 
323  // Variable Depth
324  if (m_constantDepth != true)
325  {
326  ASSERTL0(false,
327  "Variable depth not supported for the Peregrine "
328  "equations");
329  }
330 
331  //-------------------------------------------------
332 
333  //---------------------------------------
334  // As no more terms is required for the
335  // continuity equation and we have aleady evaluated
336  // the values for h_t we are done for h
337  //---------------------------------------
338 
339  //-------------------------------------------------
340  // go to modal space
341  m_fields[0]->IProductWRTBase(outarray[1], modarray[1]);
342  m_fields[0]->IProductWRTBase(outarray[2], modarray[2]);
343 
344  // store f1 and f2 for later use (modal space)
345  Array<OneD, NekDouble> f1(ncoeffs);
346  Array<OneD, NekDouble> f2(ncoeffs);
347 
348  Vmath::Vcopy(ncoeffs, modarray[1], 1, f1, 1); // f1
349  Vmath::Vcopy(ncoeffs, modarray[2], 1, f2, 1); // f2
350 
351  // Solve the remaining block-diagonal systems
352  m_fields[0]->MultiplyByElmtInvMass(modarray[1], modarray[1]);
353  m_fields[0]->MultiplyByElmtInvMass(modarray[2], modarray[2]);
354  //---------------------------------------------
355 
356  //---------------------------------------------
357 
358  //-------------------------------------------------
359  // create tmp fields to be used during
360  // the dispersive section
361 
362  Array<OneD, Array<OneD, NekDouble> > coeffsfield(2);
363  Array<OneD, Array<OneD, NekDouble> > physfield(2);
364 
365  for (i = 0; i < 2; ++i)
366  {
367  coeffsfield[i] = Array<OneD, NekDouble>(ncoeffs);
368  physfield[i] = Array<OneD, NekDouble>(nq);
369  }
370  //---------------------------------------------
371 
372  //---------------------------------------------
373  // Go from modal to physical space
374  Vmath::Vcopy(nq, outarray[1], 1, physfield[0], 1);
375  Vmath::Vcopy(nq, outarray[2], 1, physfield[1], 1);
376  //---------------------------------------
377 
378  //---------------------------------------
379  // Start for solve of mixed dispersive terms
380  // using the 'WCE method'
381  // (Eskilsson & Sherwin, JCP 2006)
382 
383  // constant depth case
384  // \nabla \cdot (\nabla z) - invgamma z
385  // = - invgamma (\nabla \cdot {\bf f}_(2,3)
386 
387  NekDouble gamma = (m_const_depth * m_const_depth) * (1.0 / 3.0);
388  NekDouble invgamma = 1.0 / gamma;
389 
390  int nTraceNumPoints = GetTraceTotPoints();
391  Array<OneD, Array<OneD, NekDouble> > upwindX(1);
392  Array<OneD, Array<OneD, NekDouble> > upwindY(1);
393  upwindX[0] = Array<OneD, NekDouble>(nTraceNumPoints);
394  upwindY[0] = Array<OneD, NekDouble>(nTraceNumPoints);
395  //--------------------------------------------
396 
397  //--------------------------------------------
398  // Compute the forcing function for the
399  // wave continuity equation
400 
401  // Set boundary condidtions for z
402  SetBoundaryConditionsForcing(physfield, time);
403 
404  // \nabla \phi \cdot f_{2,3}
405  m_fields[0]->IProductWRTDerivBase(0, physfield[0], coeffsfield[0]);
406  m_fields[0]->IProductWRTDerivBase(1, physfield[1], coeffsfield[1]);
407  Vmath::Vadd(ncoeffs, coeffsfield[0], 1, coeffsfield[1], 1,
408  coeffsfield[0], 1);
409  Vmath::Neg(ncoeffs, coeffsfield[0], 1);
410 
411  // Evaluate upwind numerical flux (physical space)
412  NumericalFluxForcing(physfield, upwindX[0], upwindY[0]);
413 
414  m_fields[0]->AddTraceIntegral(upwindX[0], upwindY[0],
415  coeffsfield[0]);
416  m_fields[0]->MultiplyByElmtInvMass(coeffsfield[0], coeffsfield[0]);
417  m_fields[0]->BwdTrans(coeffsfield[0], physfield[0]);
418 
419  Vmath::Smul(nq, -invgamma, physfield[0], 1, physfield[0], 1);
420 
421  // ok: forcing function for HelmSolve... done!
422  //--------------------------------------
423 
424  //--------------------------------------
425  // Solve the Helmhotz-type equation
426  // for the wave continuity equation
427  // (missing slope terms...)
428 
429  // note: this is just valid for the constant depth case:
430 
431  // as of now we need not to specify any
432  // BC routine for the WCE: periodic
433  // and zero Neumann (for walls)
434 
435  WCESolve(physfield[0], invgamma);
436 
437  Vmath::Vcopy(nq, physfield[0], 1, outarray[3], 1); // store z
438 
439  // ok: Wave Continuity Equation... done!
440  //------------------------------------
441 
442  //------------------------------------
443  // Return to the primary variables
444 
445  // (h {\bf u})_t = gamma \nabla z + {\bf f}_{2,3}
446 
447  Vmath::Smul(nq, gamma, physfield[0], 1, physfield[0], 1);
448 
449  // Set boundary conditions
450  SetBoundaryConditionsContVariables(physfield[0], time);
451 
452  m_fields[0]->IProductWRTDerivBase(0, physfield[0], coeffsfield[0]);
453  m_fields[1]->IProductWRTDerivBase(1, physfield[0], coeffsfield[1]);
454 
455  Vmath::Neg(ncoeffs, coeffsfield[0], 1);
456  Vmath::Neg(ncoeffs, coeffsfield[1], 1);
457 
458  // Evaluate upwind numerical flux (physical space)
459  NumericalFluxConsVariables(physfield[0], upwindX[0], upwindY[0]);
460 
461  {
462  Array<OneD, NekDouble> uptemp(nTraceNumPoints, 0.0);
463 
464  m_fields[0]->AddTraceIntegral(upwindX[0], uptemp,
465  coeffsfield[0]);
466  m_fields[0]->AddTraceIntegral(uptemp, upwindY[0],
467  coeffsfield[1]);
468  }
469 
470  Vmath::Vadd(ncoeffs, f1, 1, coeffsfield[0], 1, modarray[1], 1);
471  Vmath::Vadd(ncoeffs, f2, 1, coeffsfield[1], 1, modarray[2], 1);
472 
473  m_fields[1]->MultiplyByElmtInvMass(modarray[1], modarray[1]);
474  m_fields[2]->MultiplyByElmtInvMass(modarray[2], modarray[2]);
475 
476  m_fields[1]->BwdTrans(modarray[1], outarray[1]);
477  m_fields[2]->BwdTrans(modarray[2], outarray[2]);
478 
479  // ok: returned to conservative variables... done!
480  //---------------------
481 
482  break;
483  }
486  ASSERTL0(false, "Unknown projection scheme for the Peregrine");
487  break;
488  default:
489  ASSERTL0(false, "Unknown projection scheme for the NonlinearSWE");
490  break;
491  }
492 }
Array< OneD, NekDouble > m_coriolis
Coriolis force.
void SetBoundaryConditionsContVariables(Array< OneD, NekDouble > &inarray, NekDouble time)
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
void NumericalFluxForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, NekDouble > &numfluxX, Array< OneD, NekDouble > &numfluxY)
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SolverUtils::AdvectionSharedPtr m_advection
SOLVER_UTILS_EXPORT int GetTotPoints()
void NumericalFluxConsVariables(Array< OneD, NekDouble > &physfield, Array< OneD, NekDouble > &outX, Array< OneD, NekDouble > &outY)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
void WCESolve(Array< OneD, NekDouble > &fce, NekDouble lambda)
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
double NekDouble
void SetBoundaryConditionsForcing(Array< OneD, Array< OneD, NekDouble > > &inarray, NekDouble time)
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
SOLVER_UTILS_EXPORT int GetNcoeffs()
bool m_constantDepth
Indicates if constant depth case.
void AddCoriolis(const Array< OneD, const Array< OneD, NekDouble > > &physarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302

◆ GetDepthBwd()

const Array<OneD, NekDouble>& Nektar::NonlinearPeregrine::GetDepthBwd ( )
inlineprotected

Definition at line 122 of file NonlinearPeregrine.h.

References m_dBwd.

123  {
124  return m_dBwd;
125  }
Array< OneD, NekDouble > m_dBwd

◆ GetDepthFwd()

const Array<OneD, NekDouble>& Nektar::NonlinearPeregrine::GetDepthFwd ( )
inlineprotected

Definition at line 118 of file NonlinearPeregrine.h.

References m_dFwd.

119  {
120  return m_dFwd;
121  }
Array< OneD, NekDouble > m_dFwd
Still water depth traces.

◆ GetFluxVector()

void Nektar::NonlinearPeregrine::GetFluxVector ( const Array< OneD, const Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &  flux 
)
protected

Definition at line 714 of file NonlinearPeregrine.cpp.

References GetVelocityVector(), Nektar::SolverUtils::EquationSystem::m_fields, Nektar::ShallowWaterSystem::m_g, Nektar::SolverUtils::EquationSystem::m_spacedim, Vmath::Smul(), Vmath::Vadd(), Vmath::Vcopy(), and Vmath::Vmul().

Referenced by v_InitObject().

717 {
718  int i, j;
719  int nq = m_fields[0]->GetTotPoints();
720 
721  NekDouble g = m_g;
722  Array<OneD, Array<OneD, NekDouble> > velocity(m_spacedim);
723 
724  // Flux vector for the mass equation
725  for (i = 0; i < m_spacedim; ++i)
726  {
727  velocity[i] = Array<OneD, NekDouble>(nq);
728  Vmath::Vcopy(nq, physfield[i + 1], 1, flux[0][i], 1);
729  }
730 
731  GetVelocityVector(physfield, velocity);
732 
733  // Put (0.5 g h h) in tmp
734  Array<OneD, NekDouble> tmp(nq);
735  Vmath::Vmul(nq, physfield[0], 1, physfield[0], 1, tmp, 1);
736  Vmath::Smul(nq, 0.5 * g, tmp, 1, tmp, 1);
737 
738  // Flux vector for the momentum equations
739  for (i = 0; i < m_spacedim; ++i)
740  {
741  for (j = 0; j < m_spacedim; ++j)
742  {
743  Vmath::Vmul(nq, velocity[j], 1, physfield[i + 1], 1,
744  flux[i + 1][j], 1);
745  }
746 
747  // Add (0.5 g h h) to appropriate field
748  Vmath::Vadd(nq, flux[i + 1][i], 1, tmp, 1, flux[i + 1][i], 1);
749  }
750 
751 }
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
int m_spacedim
Spatial dimension (>= expansion dim).
double NekDouble
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void GetVelocityVector(const Array< OneD, Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, NekDouble > > &velocity)
Compute the velocity field given the momentum .
NekDouble m_g
Acceleration of gravity.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ GetVelocityVector()

void Nektar::NonlinearPeregrine::GetVelocityVector ( const Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  velocity 
)
private

Compute the velocity field \( \mathbf{v} \) given the momentum \( h\mathbf{v} \).

Parameters
physfieldMomentum field.
velocityVelocity field.

Definition at line 876 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::m_spacedim, and Vmath::Vdiv().

Referenced by GetFluxVector().

879 {
880  const int npts = physfield[0].num_elements();
881 
882  for (int i = 0; i < m_spacedim; ++i)
883  {
884  Vmath::Vdiv(npts, physfield[1 + i], 1, physfield[0], 1, velocity[i], 1);
885  }
886 }
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:244
int m_spacedim
Spatial dimension (>= expansion dim).

◆ LaitoneSolitaryWave()

void Nektar::NonlinearPeregrine::LaitoneSolitaryWave ( NekDouble  amp,
NekDouble  d,
NekDouble  time,
NekDouble  x_offset 
)
private

Definition at line 1168 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::SolverUtils::EquationSystem::m_fields, Nektar::ShallowWaterSystem::m_g, Vmath::Sadd(), Vmath::Vcopy(), and Vmath::Vmul().

Referenced by v_SetInitialConditions().

1173 {
1174  int nq = GetTotPoints();
1175 
1176  NekDouble A = 1.0;
1177  NekDouble C = sqrt(m_g * d) * (1.0 + 0.5 * (amp / d));
1178 
1179  Array<OneD, NekDouble> x0(nq);
1180  Array<OneD, NekDouble> x1(nq);
1181  Array<OneD, NekDouble> zeros(nq, 0.0);
1182 
1183  // get the coordinates (assuming all fields have the same
1184  // discretisation)
1185  m_fields[0]->GetCoords(x0, x1);
1186 
1187  for (int i = 0; i < nq; i++)
1188  {
1189  (m_fields[0]->UpdatePhys())[i] = amp * pow((1.0 / cosh(
1190  sqrt(0.75 * (amp / (d * d * d))) *
1191  (A * (x0[i] + x_offset) - C * time))), 2.0);
1192  (m_fields[1]->UpdatePhys())[i] = (amp / d) * pow((1.0 / cosh(
1193  sqrt(0.75 * (amp / (d * d * d))) *
1194  (A * (x0[i] + x_offset) - C * time)
1195  )), 2.0) * sqrt(m_g * d);
1196  }
1197 
1198  Vmath::Sadd(nq, d, m_fields[0]->GetPhys(), 1, m_fields[0]->UpdatePhys(), 1);
1199  Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[1]->GetPhys(), 1,
1200  m_fields[1]->UpdatePhys(), 1);
1201  Vmath::Vcopy(nq, zeros, 1, m_fields[2]->UpdatePhys(), 1);
1202  Vmath::Vcopy(nq, zeros, 1, m_fields[3]->UpdatePhys(), 1);
1203 
1204  // Forward transform to fill the coefficient space
1205  for (int i = 0; i < 4; ++i)
1206  {
1207  m_fields[i]->SetPhysState(true);
1208  m_fields[i]->FwdTrans(m_fields[i]->GetPhys(),
1209  m_fields[i]->UpdateCoeffs());
1210  }
1211 
1212 }
SOLVER_UTILS_EXPORT int GetTotPoints()
double NekDouble
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
Definition: Vmath.cpp:318
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
NekDouble m_g
Acceleration of gravity.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ NumericalFlux1D()

void Nektar::NonlinearPeregrine::NumericalFlux1D ( Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  numfluxX 
)
private

◆ NumericalFlux2D()

void Nektar::NonlinearPeregrine::NumericalFlux2D ( Array< OneD, Array< OneD, NekDouble > > &  physfield,
Array< OneD, Array< OneD, NekDouble > > &  numfluxX,
Array< OneD, Array< OneD, NekDouble > > &  numfluxY 
)
private

◆ NumericalFluxConsVariables()

void Nektar::NonlinearPeregrine::NumericalFluxConsVariables ( Array< OneD, NekDouble > &  physfield,
Array< OneD, NekDouble > &  outX,
Array< OneD, NekDouble > &  outY 
)
private

Definition at line 1134 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), and Nektar::SolverUtils::EquationSystem::m_fields.

Referenced by DoOdeRhs().

1137 {
1138  int i;
1139  int nTraceNumPoints = GetTraceTotPoints();
1140 
1141  //-----------------------------------------------------
1142  // get temporary arrays
1143  Array<OneD, Array<OneD, NekDouble> > Fwd(1);
1144  Array<OneD, Array<OneD, NekDouble> > Bwd(1);
1145 
1146  Fwd[0] = Array<OneD, NekDouble>(nTraceNumPoints);
1147  Bwd[0] = Array<OneD, NekDouble>(nTraceNumPoints);
1148  //-----------------------------------------------------
1149 
1150  //-----------------------------------------------------
1151  // get the physical values at the trace
1152  // (we have put any time-dependent BC in field[1])
1153 
1154  m_fields[1]->GetFwdBwdTracePhys(physfield, Fwd[0], Bwd[0]);
1155  //-----------------------------------------------------
1156 
1157  //-----------------------------------------------------
1158  // use centred fluxes for the numerical flux
1159  for (i = 0; i < nTraceNumPoints; ++i)
1160  {
1161  outX[i] = 0.5 * (Fwd[0][i] + Bwd[0][i]);
1162  outY[i] = 0.5 * (Fwd[0][i] + Bwd[0][i]);
1163  }
1164  //-----------------------------------------------------
1165 }
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ NumericalFluxForcing()

void Nektar::NonlinearPeregrine::NumericalFluxForcing ( const Array< OneD, const Array< OneD, NekDouble > > &  inarray,
Array< OneD, NekDouble > &  numfluxX,
Array< OneD, NekDouble > &  numfluxY 
)
private

Definition at line 924 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), and Nektar::SolverUtils::EquationSystem::m_fields.

Referenced by DoOdeRhs().

928 {
929  int i;
930  int nTraceNumPoints = GetTraceTotPoints();
931 
932  //-----------------------------------------------------
933  // get temporary arrays
934  Array<OneD, Array<OneD, NekDouble> > Fwd(2);
935  Array<OneD, Array<OneD, NekDouble> > Bwd(2);
936 
937  for (i = 0; i < 2; ++i)
938  {
939  Fwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
940  Bwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
941  }
942  //-----------------------------------------------------
943 
944  //-----------------------------------------------------
945  // get the physical values at the trace
946  // (any time-dependent BC previuosly put in fields[1] and [2]
947 
948  m_fields[1]->GetFwdBwdTracePhys(inarray[0], Fwd[0], Bwd[0]);
949  m_fields[2]->GetFwdBwdTracePhys(inarray[1], Fwd[1], Bwd[1]);
950  //-----------------------------------------------------
951 
952  //-----------------------------------------------------
953  // use centred fluxes for the numerical flux
954  for (i = 0; i < nTraceNumPoints; ++i)
955  {
956  numfluxX[i] = 0.5 * (Fwd[0][i] + Bwd[0][i]);
957  numfluxY[i] = 0.5 * (Fwd[1][i] + Bwd[1][i]);
958  }
959  //-----------------------------------------------------
960 }
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ PrimitiveToConservative()

void Nektar::NonlinearPeregrine::PrimitiveToConservative ( const Array< OneD, const Array< OneD, NekDouble > > &  physin,
Array< OneD, Array< OneD, NekDouble > > &  physout 
)
private

Definition at line 809 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::ShallowWaterSystem::m_depth, Vmath::Vadd(), Vmath::Vcopy(), and Vmath::Vmul().

812 {
813 
814  int nq = GetTotPoints();
815 
816  if (physin.get() == physout.get())
817  {
818  // copy indata and work with tmp array
819  Array<OneD, Array<OneD, NekDouble> > tmp(3);
820  for (int i = 0; i < 3; ++i)
821  {
822  // deep copy
823  tmp[i] = Array<OneD, NekDouble>(nq);
824  Vmath::Vcopy(nq, physin[i], 1, tmp[i], 1);
825  }
826 
827  // h = \eta + d
828  Vmath::Vadd(nq, tmp[0], 1, m_depth, 1, physout[0], 1);
829 
830  // hu = h * u
831  Vmath::Vmul(nq, physout[0], 1, tmp[1], 1, physout[1], 1);
832 
833  // hv = h * v
834  Vmath::Vmul(nq, physout[0], 1, tmp[2], 1, physout[2], 1);
835 
836  }
837  else
838  {
839  // h = \eta + d
840  Vmath::Vadd(nq, physin[0], 1, m_depth, 1, physout[0], 1);
841 
842  // hu = h * u
843  Vmath::Vmul(nq, physout[0], 1, physin[1], 1, physout[1], 1);
844 
845  // hv = h * v
846  Vmath::Vmul(nq, physout[0], 1, physin[2], 1, physout[2], 1);
847 
848  }
849 
850 }
Array< OneD, NekDouble > m_depth
Still water depth.
SOLVER_UTILS_EXPORT int GetTotPoints()
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ SetBoundaryConditions()

void Nektar::NonlinearPeregrine::SetBoundaryConditions ( Array< OneD, Array< OneD, NekDouble > > &  physarray,
NekDouble  time 
)
private

Definition at line 539 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), Nektar::SolverUtils::EquationSystem::m_fields, and WallBoundary2D().

Referenced by DoOdeProjection().

542 {
543 
544  int nvariables = m_fields.num_elements();
545  int cnt = 0;
546  int nTracePts = GetTraceTotPoints();
547 
548  // Extract trace for boundaries. Needs to be done on all processors to avoid
549  // deadlock.
550  Array<OneD, Array<OneD, NekDouble> > Fwd(nvariables);
551  for (int i = 0; i < nvariables; ++i)
552  {
553  Fwd[i] = Array<OneD, NekDouble>(nTracePts);
554  m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
555  }
556 
557  // loop over Boundary Regions
558  for (int n = 0; n < m_fields[0]->GetBndConditions().num_elements(); ++n)
559  {
560 
561  // Wall Boundary Condition
562  if (boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),"Wall"))
563  {
564  WallBoundary2D(n, cnt, Fwd, inarray);
565  }
566 
567  // Time Dependent Boundary Condition (specified in meshfile)
568  if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
569  {
570  for (int i = 0; i < nvariables; ++i)
571  {
572  m_fields[i]->EvaluateBoundaryConditions(time);
573  }
574  }
575  cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
576  }
577 }
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
void WallBoundary2D(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &Fwd, Array< OneD, Array< OneD, NekDouble > > &physarray)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ SetBoundaryConditionsContVariables()

void Nektar::NonlinearPeregrine::SetBoundaryConditionsContVariables ( Array< OneD, NekDouble > &  inarray,
NekDouble  time 
)
private

Definition at line 1075 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::m_fields, and WallBoundaryContVariables().

Referenced by DoOdeRhs().

1078 {
1079  boost::ignore_unused(time);
1080 
1081  int cnt = 0;
1082 
1083  // loop over Boundary Regions
1084  for (int n = 0; n < m_fields[0]->GetBndConditions().num_elements(); ++n)
1085  {
1086  // Use wall for all
1087  // Wall Boundary Condition
1088  if(boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),"Wall"))
1089  {
1090  WallBoundaryContVariables(n, cnt, inarray);
1091  }
1092 
1093  if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
1094  {
1095  WallBoundaryContVariables(n, cnt, inarray);
1096  }
1097 
1098  cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize() - 1;
1099  }
1100 }
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void WallBoundaryContVariables(int bcRegion, int cnt, Array< OneD, NekDouble > &inarray)

◆ SetBoundaryConditionsForcing()

void Nektar::NonlinearPeregrine::SetBoundaryConditionsForcing ( Array< OneD, Array< OneD, NekDouble > > &  inarray,
NekDouble  time 
)
private

Definition at line 962 of file NonlinearPeregrine.cpp.

References ASSERTL0, Nektar::SolverUtils::EquationSystem::m_fields, and WallBoundaryForcing().

Referenced by DoOdeRhs().

965 {
966  boost::ignore_unused(time);
967 
968  int cnt = 0;
969 
970  // loop over Boundary Regions
971  for (int n = 0; n < m_fields[0]->GetBndConditions().num_elements(); ++n)
972  {
973  // Use wall for all BC...
974  // Wall Boundary Condition
975  if (boost::iequals(m_fields[0]->GetBndConditions()[n]->GetUserDefined(),"Wall"))
976  {
977  WallBoundaryForcing(n, cnt, inarray);
978  }
979 
980  //Timedependent Boundary Condition
981  if (m_fields[0]->GetBndConditions()[n]->IsTimeDependent())
982  {
983  ASSERTL0(false, "time-dependent BC not implemented for Boussinesq");
984  }
985  cnt += m_fields[0]->GetBndCondExpansions()[n]->GetExpSize();
986  }
987 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
void WallBoundaryForcing(int bcRegion, int cnt, Array< OneD, Array< OneD, NekDouble > > &inarray)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ v_ConservativeToPrimitive()

void Nektar::NonlinearPeregrine::v_ConservativeToPrimitive ( )
protectedvirtual

Reimplemented from Nektar::ShallowWaterSystem.

Definition at line 792 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::ShallowWaterSystem::m_depth, Nektar::SolverUtils::EquationSystem::m_fields, Vmath::Vdiv(), and Vmath::Vsub().

793 {
794  int nq = GetTotPoints();
795 
796  // u = hu/h
797  Vmath::Vdiv(nq, m_fields[1]->GetPhys(), 1, m_fields[0]->GetPhys(), 1,
798  m_fields[1]->UpdatePhys(), 1);
799 
800  // v = hv/ v
801  Vmath::Vdiv(nq, m_fields[2]->GetPhys(), 1, m_fields[0]->GetPhys(), 1,
802  m_fields[2]->UpdatePhys(), 1);
803 
804  // \eta = h - d
805  Vmath::Vsub(nq, m_fields[0]->GetPhys(), 1, m_depth, 1,
806  m_fields[0]->UpdatePhys(), 1);
807 }
Array< OneD, NekDouble > m_depth
Still water depth.
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:244
SOLVER_UTILS_EXPORT int GetTotPoints()
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:346
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.

◆ v_GenerateSummary()

void Nektar::NonlinearPeregrine::v_GenerateSummary ( SolverUtils::SummaryList s)
protectedvirtual

Print a summary of time stepping parameters.

Reimplemented from Nektar::ShallowWaterSystem.

Definition at line 888 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::AddSummaryItem(), and Nektar::ShallowWaterSystem::v_GenerateSummary().

889 {
891  SolverUtils::AddSummaryItem(s, "Variables", "h should be in field[0]");
892  SolverUtils::AddSummaryItem(s, "", "hu should be in field[1]");
893  SolverUtils::AddSummaryItem(s, "", "hv should be in field[2]");
894  SolverUtils::AddSummaryItem(s, "", "z should be in field[3]");
895 }
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
Definition: Misc.cpp:49
virtual void v_GenerateSummary(SolverUtils::SummaryList &s)
Print a summary of time stepping parameters.

◆ v_InitObject()

void Nektar::NonlinearPeregrine::v_InitObject ( )
protectedvirtual

Init object for UnsteadySystem class.

Initialization object for UnsteadySystem class.

Reimplemented from Nektar::ShallowWaterSystem.

Definition at line 66 of file NonlinearPeregrine.cpp.

References ASSERTL0, Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineOdeRhs(), Nektar::LibUtilities::TimeIntegrationSchemeOperators::DefineProjection(), DoOdeProjection(), DoOdeRhs(), Nektar::MultiRegions::eDiscontinuous, Nektar::MultiRegions::eGalerkin, Nektar::SolverUtils::GetAdvectionFactory(), Nektar::ShallowWaterSystem::GetDepth(), GetFluxVector(), Nektar::ShallowWaterSystem::GetGravity(), Nektar::ShallowWaterSystem::GetNormals(), Nektar::SolverUtils::GetRiemannSolverFactory(), Nektar::ShallowWaterSystem::GetVecLocs(), Nektar::ShallowWaterSystem::m_advection, m_const_depth, Nektar::SolverUtils::UnsteadySystem::m_explicitAdvection, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::UnsteadySystem::m_ode, m_problemType, Nektar::SolverUtils::EquationSystem::m_projectionType, Nektar::ShallowWaterSystem::m_riemannSolver, Nektar::SolverUtils::EquationSystem::m_session, Nektar::ProblemTypeMap, Nektar::SIZE_ProblemType, and Nektar::ShallowWaterSystem::v_InitObject().

67 {
69 
70  if (m_session->DefinesSolverInfo("PROBLEMTYPE"))
71  {
72  int i;
73  std::string ProblemTypeStr = m_session->GetSolverInfo("PROBLEMTYPE");
74  for (i = 0; i < (int) SIZE_ProblemType; ++i)
75  {
76  if (boost::iequals(ProblemTypeMap[i], ProblemTypeStr))
77  {
79  break;
80  }
81  }
82  }
83  else
84  {
86  }
87 
89  {
92  }
93  else
94  {
95  ASSERTL0(false, "Implicit Peregrine not set up.");
96  }
97 
98  // NB! At the moment only the constant depth case is
99  // supported for the Peregrine eq.
100  if (m_session->DefinesParameter("ConstDepth"))
101  {
102  m_const_depth = m_session->GetParameter("ConstDepth");
103  }
104  else
105  {
106  ASSERTL0(false, "Constant Depth not specified");
107  }
108 
109  // Type of advection class to be used
110  switch (m_projectionType)
111  {
112  // Continuous field
114  {
115  ASSERTL0(false,
116  "Continuous projection type not supported for Peregrine.");
117  break;
118  }
119  // Discontinuous field
121  {
122  string advName;
123  string diffName;
124  string riemName;
125 
126  //---------------------------------------------------------------
127  // Setting up advection and diffusion operators
128  // NB: diffusion not set up for SWE at the moment
129  // but kept here for future use ...
130  m_session->LoadSolverInfo("AdvectionType", advName, "WeakDG");
131  // m_session->LoadSolverInfo("DiffusionType", diffName, "LDG");
133  advName, advName);
134 
136  this);
137 
138  // Setting up Riemann solver for advection operator
139  m_session->LoadSolverInfo("UpwindType", riemName, "NoSolver");
140 
143  riemName, m_session);
144 
145  // Setting up parameters for advection operator Riemann solver
146  m_riemannSolver->SetParam("gravity",
148  m_riemannSolver->SetAuxVec("vecLocs",
151  this);
152  m_riemannSolver->SetScalar("depth", &NonlinearPeregrine::GetDepth,
153  this);
154 
155  // Concluding initialisation of advection / diffusion operators
156  m_advection->SetRiemannSolver(m_riemannSolver);
157  m_advection->InitObject(m_session, m_fields);
158  break;
159  }
160  default:
161  {
162  ASSERTL0(false, "Unsupported projection type.");
163  break;
164  }
165  }
166 
167 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
void GetFluxVector(const Array< OneD, const Array< OneD, NekDouble > > &physfield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &flux)
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
const Array< OneD, const Array< OneD, NekDouble > > & GetVecLocs()
Length of enum list.
SolverUtils::AdvectionSharedPtr m_advection
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
const Array< OneD, const Array< OneD, NekDouble > > & GetNormals()
const Array< OneD, NekDouble > & GetDepth()
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:144
bool m_explicitAdvection
Indicates if explicit or implicit treatment of advection is used.
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
virtual void v_InitObject()
Init object for UnsteadySystem class.
const char *const ProblemTypeMap[]
RiemannSolverFactory & GetRiemannSolverFactory()
SolverUtils::RiemannSolverSharedPtr m_riemannSolver
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
Definition: Advection.cpp:47
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.

◆ v_PrimitiveToConservative()

void Nektar::NonlinearPeregrine::v_PrimitiveToConservative ( )
protectedvirtual

Reimplemented from Nektar::ShallowWaterSystem.

Definition at line 852 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTotPoints(), Nektar::ShallowWaterSystem::m_depth, Nektar::SolverUtils::EquationSystem::m_fields, Vmath::Vadd(), and Vmath::Vmul().

853 {
854  int nq = GetTotPoints();
855 
856  // h = \eta + d
857  Vmath::Vadd(nq, m_fields[0]->GetPhys(), 1, m_depth, 1,
858  m_fields[0]->UpdatePhys(), 1);
859 
860  // hu = h * u
861  Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[1]->GetPhys(), 1,
862  m_fields[1]->UpdatePhys(), 1);
863 
864  // hv = h * v
865  Vmath::Vmul(nq, m_fields[0]->GetPhys(), 1, m_fields[2]->GetPhys(), 1,
866  m_fields[2]->UpdatePhys(), 1);
867 }
Array< OneD, NekDouble > m_depth
Still water depth.
SOLVER_UTILS_EXPORT int GetTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:302
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ v_SetInitialConditions()

void Nektar::NonlinearPeregrine::v_SetInitialConditions ( NekDouble  initialtime = 0.0,
bool  dumpInitialConditions = true,
const int  domain = 0 
)
protectedvirtual

Set the initial conditions.

Reimplemented from Nektar::SolverUtils::EquationSystem.

Definition at line 1217 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::Checkpoint_Output(), Nektar::eSolitaryWave, LaitoneSolitaryWave(), m_const_depth, m_problemType, and Nektar::SolverUtils::EquationSystem::v_SetInitialConditions().

1221 {
1222  boost::ignore_unused(domain);
1223 
1224  switch (m_problemType)
1225  {
1226  case eSolitaryWave:
1227  {
1228  LaitoneSolitaryWave(0.1, m_const_depth, 0.0, 0.0);
1229  break;
1230  }
1231  default:
1232  {
1233  EquationSystem::v_SetInitialConditions(initialtime, false);
1234  break;
1235  }
1236  }
1237 
1238  if (dumpInitialConditions)
1239  {
1240  // Dump initial conditions to file
1241  Checkpoint_Output(0);
1242  }
1243 }
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
First order Laitone solitary wave.
void LaitoneSolitaryWave(NekDouble amp, NekDouble d, NekDouble time, NekDouble x_offset)

◆ WallBoundary()

void Nektar::NonlinearPeregrine::WallBoundary ( int  bcRegion,
int  cnt,
Array< OneD, Array< OneD, NekDouble > > &  Fwd,
Array< OneD, Array< OneD, NekDouble > > &  physarray 
)
private

Wall boundary condition.

Definition at line 583 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_spacedim, Nektar::SolverUtils::EquationSystem::m_traceNormals, Vmath::Smul(), Vmath::Vcopy(), and Vmath::Vvtvp().

586 {
587  int i;
588  int nvariables = physarray.num_elements();
589 
590  // Adjust the physical values of the trace to take
591  // user defined boundaries into account
592  int e, id1, id2, npts;
594  m_fields[0]->GetBndCondExpansions()[bcRegion];
595  for (e = 0; e < bcexp->GetExpSize(); ++e)
596  {
597  npts = bcexp->GetExp(e)->GetTotPoints();
598  id1 = bcexp->GetPhys_Offset(e);
599  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
600  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
601  cnt + e));
602 
603  // For 2D/3D, define: v* = v - 2(v.n)n
604  Array<OneD, NekDouble> tmp(npts, 0.0);
605 
606  // Calculate (v.n)
607  for (i = 0; i < m_spacedim; ++i)
608  {
609  Vmath::Vvtvp(npts, &Fwd[1 + i][id2], 1, &m_traceNormals[i][id2], 1,
610  &tmp[0], 1, &tmp[0], 1);
611  }
612 
613  // Calculate 2.0(v.n)
614  Vmath::Smul(npts, -2.0, &tmp[0], 1, &tmp[0], 1);
615 
616  // Calculate v* = v - 2.0(v.n)n
617  for (i = 0; i < m_spacedim; ++i)
618  {
619  Vmath::Vvtvp(npts, &tmp[0], 1, &m_traceNormals[i][id2], 1,
620  &Fwd[1 + i][id2], 1, &Fwd[1 + i][id2], 1);
621  }
622 
623  // copy boundary adjusted values into the boundary expansion
624  for (i = 0; i < nvariables; ++i)
625  {
626  bcexp = m_fields[i]->GetBndCondExpansions()[bcRegion];
627  Vmath::Vcopy(npts, &Fwd[i][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
628  }
629  }
630 }
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:216
int m_spacedim
Spatial dimension (>= expansion dim).
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

◆ WallBoundary2D()

void Nektar::NonlinearPeregrine::WallBoundary2D ( int  bcRegion,
int  cnt,
Array< OneD, Array< OneD, NekDouble > > &  Fwd,
Array< OneD, Array< OneD, NekDouble > > &  physarray 
)
private

Definition at line 632 of file NonlinearPeregrine.cpp.

References ASSERTL0, Nektar::SolverUtils::EquationSystem::m_expdim, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_traceNormals, Vmath::Neg(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vvtvm(), and Vmath::Vvtvp().

Referenced by SetBoundaryConditions().

637 {
638  boost::ignore_unused(physarray);
639 
640  int i;
641  int nvariables = 3;
642 
643  // Adjust the physical values of the trace to take
644  // user defined boundaries into account
645  int e, id1, id2, npts;
647  m_fields[0]->GetBndCondExpansions()[bcRegion];
648 
649  for (e = 0; e < bcexp->GetExpSize();
650  ++e)
651  {
652  npts = bcexp->GetExp(e)->GetNumPoints(0);
653  id1 = bcexp->GetPhys_Offset(e);
654  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
655  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
656  cnt + e));
657 
658  switch (m_expdim)
659  {
660  case 1:
661  {
662  // negate the forward flux
663  Vmath::Neg(npts, &Fwd[1][id2], 1);
664  break;
665  }
666  case 2:
667  {
668  Array<OneD, NekDouble> tmp_n(npts);
669  Array<OneD, NekDouble> tmp_t(npts);
670 
671  Vmath::Vmul (npts, &Fwd[1][id2], 1, &m_traceNormals[0][id2], 1,
672  &tmp_n[0], 1);
673  Vmath::Vvtvp(npts, &Fwd[2][id2], 1, &m_traceNormals[1][id2], 1,
674  &tmp_n[0], 1, &tmp_n[0], 1);
675 
676  Vmath::Vmul (npts, &Fwd[1][id2], 1, &m_traceNormals[1][id2], 1,
677  &tmp_t[0], 1);
678  Vmath::Vvtvm(npts, &Fwd[2][id2], 1, &m_traceNormals[0][id2], 1,
679  &tmp_t[0], 1, &tmp_t[0], 1);
680 
681  // negate the normal flux
682  Vmath::Neg(npts, tmp_n, 1);
683 
684  // rotate back to Cartesian
685  Vmath::Vmul (npts, &tmp_t[0], 1, &m_traceNormals[1][id2], 1,
686  &Fwd[1][id2], 1);
687  Vmath::Vvtvm(npts, &tmp_n[0], 1, &m_traceNormals[0][id2], 1,
688  &Fwd[1][id2], 1, &Fwd[1][id2], 1);
689 
690  Vmath::Vmul(npts, &tmp_t[0], 1, &m_traceNormals[0][id2], 1,
691  &Fwd[2][id2], 1);
692  Vmath::Vvtvp(npts, &tmp_n[0], 1, &m_traceNormals[1][id2], 1,
693  &Fwd[2][id2], 1, &Fwd[2][id2], 1);
694  break;
695  }
696  case 3:
697  ASSERTL0(false,
698  "3D not implemented for Shallow Water Equations");
699  break;
700  default:
701  ASSERTL0(false, "Illegal expansion dimension");
702  }
703 
704  // copy boundary adjusted values into the boundary expansion
705  for (i = 0; i < nvariables; ++i)
706  {
707  bcexp = m_fields[i]->GetBndCondExpansions()[bcRegion];
708  Vmath::Vcopy(npts, &Fwd[i][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
709  }
710  }
711 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
int m_expdim
Expansion dimension.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vvtvm(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvm (vector times vector plus vector): z = w*x - y
Definition: Vmath.cpp:468
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ WallBoundaryContVariables()

void Nektar::NonlinearPeregrine::WallBoundaryContVariables ( int  bcRegion,
int  cnt,
Array< OneD, NekDouble > &  inarray 
)
private

Definition at line 1102 of file NonlinearPeregrine.cpp.

References Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), Nektar::SolverUtils::EquationSystem::m_fields, and Vmath::Vcopy().

Referenced by SetBoundaryConditionsContVariables().

1106 {
1107  int nTraceNumPoints = GetTraceTotPoints();
1108 
1109  // get physical values of z for the forward trace
1110  Array<OneD, NekDouble> z(nTraceNumPoints);
1111  m_fields[0]->ExtractTracePhys(inarray, z);
1112 
1113  // Adjust the physical values of the trace to take
1114  // user defined boundaries into account
1115  int e, id1, id2, npts;
1117  m_fields[0]->GetBndCondExpansions()[bcRegion];
1118 
1119  for (e = 0; e < bcexp->GetExpSize(); ++e)
1120  {
1121  npts = bcexp->GetExp(e)->GetTotPoints();
1122  id1 = bcexp->GetPhys_Offset(e);
1123  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
1124  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
1125  cnt + e));
1126 
1127  // copy boundary adjusted values into the boundary expansion field[1] and field[2]
1128  bcexp = m_fields[1]->GetBndCondExpansions()[bcRegion];
1129  Vmath::Vcopy(npts, &z[id2], 1, &(bcexp->UpdatePhys())[id1], 1);
1130 
1131  }
1132 }
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064

◆ WallBoundaryForcing()

void Nektar::NonlinearPeregrine::WallBoundaryForcing ( int  bcRegion,
int  cnt,
Array< OneD, Array< OneD, NekDouble > > &  inarray 
)
private

Definition at line 990 of file NonlinearPeregrine.cpp.

References ASSERTL0, Nektar::SolverUtils::EquationSystem::GetTraceTotPoints(), Nektar::SolverUtils::EquationSystem::m_expdim, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::SolverUtils::EquationSystem::m_traceNormals, Vmath::Neg(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vvtvm(), and Vmath::Vvtvp().

Referenced by SetBoundaryConditionsForcing().

994 {
995 
996  //std::cout << " WallBoundaryForcing" << std::endl;
997 
998  int nTraceNumPoints = GetTraceTotPoints();
999  int nvariables = 2;
1000 
1001  // get physical values of f1 and f2 for the forward trace
1002  Array<OneD, Array<OneD, NekDouble> > Fwd(nvariables);
1003  for (int i = 0; i < nvariables; ++i)
1004  {
1005  Fwd[i] = Array<OneD, NekDouble>(nTraceNumPoints);
1006  m_fields[i]->ExtractTracePhys(inarray[i], Fwd[i]);
1007  }
1008 
1009  // Adjust the physical values of the trace to take
1010  // user defined boundaries into account
1011  int e, id1, id2, npts;
1013  m_fields[0]->GetBndCondExpansions()[bcRegion];
1014  for (e = 0; e < bcexp->GetExpSize(); ++e)
1015  {
1016  npts = bcexp->GetExp(e)->GetTotPoints();
1017  id1 = bcexp->GetPhys_Offset(e);
1018  id2 = m_fields[0]->GetTrace()->GetPhys_Offset(
1019  m_fields[0]->GetTraceMap()->GetBndCondCoeffsToGlobalCoeffsMap(
1020  cnt + e));
1021 
1022  switch (m_expdim)
1023  {
1024  case 1:
1025  {
1026  ASSERTL0(false, "1D not yet implemented for Boussinesq");
1027  break;
1028  }
1029  case 2:
1030  {
1031  Array<OneD, NekDouble> tmp_n(npts);
1032  Array<OneD, NekDouble> tmp_t(npts);
1033 
1034  Vmath::Vmul (npts, &Fwd[0][id2], 1, &m_traceNormals[0][id2], 1,
1035  &tmp_n[0], 1);
1036  Vmath::Vvtvp(npts, &Fwd[1][id2], 1, &m_traceNormals[1][id2], 1,
1037  &tmp_n[0], 1, &tmp_n[0], 1);
1038 
1039  Vmath::Vmul (npts, &Fwd[0][id2], 1, &m_traceNormals[1][id2], 1,
1040  &tmp_t[0], 1);
1041  Vmath::Vvtvm(npts, &Fwd[1][id2], 1, &m_traceNormals[0][id2], 1,
1042  &tmp_t[0], 1, &tmp_t[0], 1);
1043 
1044  // negate the normal flux
1045  Vmath::Neg(npts, tmp_n, 1);
1046 
1047  // rotate back to Cartesian
1048  Vmath::Vmul (npts, &tmp_t[0], 1, &m_traceNormals[1][id2], 1,
1049  &Fwd[0][id2], 1);
1050  Vmath::Vvtvm(npts, &tmp_n[0], 1, &m_traceNormals[0][id2], 1,
1051  &Fwd[0][id2], 1, &Fwd[0][id2], 1);
1052 
1053  Vmath::Vmul (npts, &tmp_t[0], 1, &m_traceNormals[0][id2], 1,
1054  &Fwd[1][id2], 1);
1055  Vmath::Vvtvp(npts, &tmp_n[0], 1, &m_traceNormals[1][id2], 1,
1056  &Fwd[1][id2], 1, &Fwd[1][id2], 1);
1057  break;
1058  }
1059  case 3:
1060  ASSERTL0(false, "3D not implemented for Boussinesq equations");
1061  break;
1062  default:
1063  ASSERTL0(false, "Illegal expansion dimension");
1064  }
1065 
1066  // copy boundary adjusted values into the boundary expansion
1067  bcexp = m_fields[1]->GetBndCondExpansions()[bcRegion];
1068  Vmath::Vcopy(npts, &Fwd[0][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
1069 
1070  bcexp = m_fields[2]->GetBndCondExpansions()[bcRegion];
1071  Vmath::Vcopy(npts, &Fwd[1][id2], 1, &(bcexp->UpdatePhys())[id1], 1);
1072  }
1073 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
int m_expdim
Expansion dimension.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:445
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:399
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vvtvm(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvm (vector times vector plus vector): z = w*x - y
Definition: Vmath.cpp:468
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:186

◆ WCESolve()

void Nektar::NonlinearPeregrine::WCESolve ( Array< OneD, NekDouble > &  fce,
NekDouble  lambda 
)
private

Definition at line 897 of file NonlinearPeregrine.cpp.

References Nektar::StdRegions::eFactorLambda, Nektar::SolverUtils::EquationSystem::GetTotPoints(), m_factors, Nektar::SolverUtils::EquationSystem::m_fields, Nektar::NullFlagList, and Vmath::Vcopy().

Referenced by DoOdeRhs().

900 {
901  int nq = GetTotPoints();
902 
904 
905  for (int j = 0; j < nq; j++)
906  {
907  (m_fields[3]->UpdatePhys())[j] = fce[j];
908  }
909 
910  m_fields[3]->SetPhysState(true);
911 
912  m_fields[3]->HelmSolve(m_fields[3]->GetPhys(),
913  m_fields[3]->UpdateCoeffs(),
914  NullFlagList,
915  m_factors);
916 
917  m_fields[3]->BwdTrans(m_fields[3]->GetCoeffs(), m_fields[3]->UpdatePhys());
918 
919  m_fields[3]->SetPhysState(true);
920 
921  Vmath::Vcopy(nq, m_fields[3]->GetPhys(), 1, fce, 1);
922 }
SOLVER_UTILS_EXPORT int GetTotPoints()
StdRegions::ConstFactorMap m_factors
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
static FlagList NullFlagList
An empty flag list.

Friends And Related Function Documentation

◆ MemoryManager< NonlinearPeregrine >

friend class MemoryManager< NonlinearPeregrine >
friend

Definition at line 61 of file NonlinearPeregrine.h.

Member Data Documentation

◆ className

string Nektar::NonlinearPeregrine::className
static
Initial value:
=
"NonlinearPeregrine", NonlinearPeregrine::create,
"Nonlinear Peregrine equations in conservative variables.")

Name of class.

Definition at line 74 of file NonlinearPeregrine.h.

◆ m_const_depth

NekDouble Nektar::NonlinearPeregrine::m_const_depth
private

Definition at line 128 of file NonlinearPeregrine.h.

Referenced by DoOdeRhs(), v_InitObject(), and v_SetInitialConditions().

◆ m_dBwd

Array<OneD, NekDouble> Nektar::NonlinearPeregrine::m_dBwd
protected

Definition at line 91 of file NonlinearPeregrine.h.

Referenced by GetDepthBwd().

◆ m_dFwd

Array<OneD, NekDouble> Nektar::NonlinearPeregrine::m_dFwd
protected

Still water depth traces.

Definition at line 90 of file NonlinearPeregrine.h.

Referenced by GetDepthFwd().

◆ m_factors

StdRegions::ConstFactorMap Nektar::NonlinearPeregrine::m_factors
protected

Definition at line 82 of file NonlinearPeregrine.h.

Referenced by NonlinearPeregrine(), and WCESolve().

◆ m_problemType

ProblemType Nektar::NonlinearPeregrine::m_problemType

Definition at line 79 of file NonlinearPeregrine.h.

Referenced by v_InitObject(), and v_SetInitialConditions().