Nektar++
EquationSystem.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: EquationSystem.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Base class for individual solvers.
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_SOLVERUTILS_EQUATIONSYSTEM_H
36#define NEKTAR_SOLVERUTILS_EQUATIONSYSTEM_H
37
51#include <boost/numeric/ublas/matrix.hpp>
52
53namespace Nektar
54{
55namespace FieldUtils
56{
57template <typename T> class Interpolator;
58}
59namespace SolverUtils
60{
61class EquationSystem;
62class FilterOperators;
63
64/// A shared pointer to an EquationSystem object
65typedef std::shared_ptr<EquationSystem> EquationSystemSharedPtr;
66/// Datatype of the NekFactory used to instantiate classes derived from
67/// the EquationSystem class.
68typedef LibUtilities::NekFactory<std::string, EquationSystem,
73
74/// A base class for describing how to solve specific equations.
75class EquationSystem : public std::enable_shared_from_this<EquationSystem>
76{
77public:
78 /// Destructor
80
81 /// Initialises the members of this object.
82 SOLVER_UTILS_EXPORT inline void InitObject(bool DeclareField = true)
83 {
84 v_InitObject(DeclareField);
85 }
86
87 /// Perform any initialisation necessary before solving the problem.
89 bool dumpInitialConditions = true)
90 {
91 v_DoInitialise(dumpInitialConditions);
92 }
93
94 /// Solve the problem.
96 {
97 v_DoSolve();
98 }
99
100 /// Transform from coefficient to physical space.
102 {
104 }
105
106 /// Transform from physical to coefficient space.
108 {
110 }
111
112 /// Perform output operations after solve.
114 {
115 v_Output();
116 }
117
118 /// Get Session name
120 {
121 return m_sessionName;
122 }
123
124 template <class T> std::shared_ptr<T> as()
125 {
126 return std::dynamic_pointer_cast<T>(shared_from_this());
127 }
128
129 /// Reset Session name
130 SOLVER_UTILS_EXPORT void ResetSessionName(std::string newname)
131 {
132 m_sessionName = newname;
133 }
134
135 /// Get Session name
137 {
138 return m_session;
139 }
140
141 /// Get pressure field if available
143 {
144 return v_GetPressure();
145 }
146
148 std::vector<Array<OneD, NekDouble>> &fieldcoeffs,
149 std::vector<std::string> &variables)
150 {
151 v_ExtraFldOutput(fieldcoeffs, variables);
152 }
153
154 /// Print a summary of parameters and solver characteristics.
155 SOLVER_UTILS_EXPORT inline void PrintSummary(std::ostream &out);
156
157 /// Set parameter m_lambda
159 {
160 m_lambda = lambda;
161 }
162
163 /// Get a SessionFunction by name
165 GetFunction(std::string name,
168 bool cache = false);
169
170 /// Initialise the data in the dependent fields.
172 NekDouble initialtime = 0.0, bool dumpInitialConditions = true,
173 const int domain = 0)
174 {
175 v_SetInitialConditions(initialtime, dumpInitialConditions, domain);
176 }
177
178 /// Evaluates an exact solution
180 int field, Array<OneD, NekDouble> &outfield, const NekDouble time)
181 {
182 v_EvaluateExactSolution(field, outfield, time);
183 }
184
185 /// Compute the L2 error between fields and a given exact
186 /// solution.
188 L2Error(unsigned int field, const Array<OneD, NekDouble> &exactsoln,
189 bool Normalised = false)
190 {
191 return v_L2Error(field, exactsoln, Normalised);
192 }
193
194 /// Compute the L2 error of the fields
196 bool Normalised = false)
197 {
198 return L2Error(field, NullNekDouble1DArray, Normalised);
199 }
200
201 /// Linf error computation
203 LinfError(unsigned int field,
205 {
206 return v_LinfError(field, exactsoln);
207 }
208
209 /// Compute the H1 error between fields and a given exact
210 /// solution.
212 H1Error(unsigned int field, const Array<OneD, NekDouble> &exactsoln,
213 bool Normalised = false)
214 {
215 return v_H1Error(field, exactsoln, Normalised);
216 }
217
218 /// Compute error (L2 and L_inf) over an larger set of quadrature
219 /// points return [L2 Linf]
221 unsigned int field);
222
223 /// Write checkpoint file of #m_fields.
224 SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n);
225
226 /// Write checkpoint file of custom data fields.
229 std::vector<Array<OneD, NekDouble>> &fieldcoeffs,
230 std::vector<std::string> &variables);
231
232 /// Write base flow file of #m_fields.
234
235 /// Write field data to the given filename.
236 SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname);
237
238 /// Write input fields to the given filename.
240 const std::string &outname, MultiRegions::ExpListSharedPtr &field,
241 std::vector<Array<OneD, NekDouble>> &fieldcoeffs,
242 std::vector<std::string> &variables);
243
244 /// Input field data from the given file.
246 const std::string &infile,
248
249 /// Input field data from the given file to multiple domains
251 const std::string &infile,
253 const int ndomains);
254
255 /// Output a field.
256 /// Input field data into array from the given file.
258 const std::string &infile, std::vector<std::string> &fieldStr,
260
261 /// Output a field.
262 /// Input field data into ExpList from the given file.
263 SOLVER_UTILS_EXPORT void ImportFld(const std::string &infile,
265 std::string &pFieldName);
266
267 /// Write out a session summary.
269
271 UpdateFields();
272
273 /// Get hold of FieldInfoMap so it can be updated
276
277 /// Return final time
279 {
280 return m_time;
281 }
282
284 {
285 return m_fields[0]->GetNcoeffs();
286 }
287
288 SOLVER_UTILS_EXPORT inline int GetNcoeffs(const int eid)
289 {
290 return m_fields[0]->GetNcoeffs(eid);
291 }
292
294 {
295 return m_graph->GetExpansionInfo()
296 .begin()
297 ->second->m_basisKeyVector[0]
298 .GetNumModes();
299 }
300
302 {
303 return m_fields[0]->EvalBasisNumModesMaxPerExp();
304 }
305
307 {
308 return m_session->GetVariables().size();
309 }
310
311 SOLVER_UTILS_EXPORT inline const std::string GetVariable(unsigned int i)
312 {
313 return m_session->GetVariable(i);
314 }
315
317 {
318 return GetTraceNpoints();
319 }
320
322 {
323 return m_fields[0]->GetTrace()->GetNpoints();
324 }
325
327 {
328 return m_fields[0]->GetExpSize();
329 }
330
332 {
333 return m_fields[0]->GetPhys_Offset(n);
334 }
335
337 {
338 return m_fields[0]->GetCoeff_Offset(n);
339 }
340
342 {
343 return m_fields[0]->GetNpoints();
344 }
345
347 {
348 return m_fields[0]->GetTotPoints(n);
349 }
350
352 {
353 return m_fields[0]->GetNpoints();
354 }
355
357 {
358 return m_steps;
359 }
360
361 SOLVER_UTILS_EXPORT inline void SetSteps(const int steps)
362 {
363 m_steps = steps;
364 }
365
367 {
368 return m_timestep;
369 }
370
372 const int i, Array<OneD, NekDouble> &output);
373
375 const int i, const Array<OneD, const NekDouble> &input);
376
378 const int i);
379
381
383
384 SOLVER_UTILS_EXPORT inline void SetModifiedBasis(const bool modbasis);
385
387 {
388 return m_nchk;
389 }
390
392 {
393 m_nchk = num;
394 }
395
397 {
398 return m_checksteps;
399 }
400
402 {
403 m_checksteps = num;
404 }
405
407 {
408 return m_infosteps;
409 }
410
412 {
413 m_infosteps = num;
414 }
415
417 {
418 m_iterPIT = num;
419 }
420
422 {
423 m_windowPIT = num;
424 }
425
427 {
428 return m_traceNormals;
429 }
430
432 {
433 m_time = time;
434 }
435
437 {
438 m_timestep = timestep;
439 }
440
442 {
443 m_initialStep = step;
444 }
445
446 /// Evaluates the boundary conditions at the given time.
448
449 /// Identify if operator is negated in DoSolve
451 {
452 return v_NegatedOp();
453 }
454
455protected:
456 /// Communicator
459 /// The session reader
461 /// Map of known SessionFunctions
462 std::map<std::string, SolverUtils::SessionFunctionSharedPtr>
464 /// Field input/output
466 /// Array holding all dependent variables.
468 /// Pointer to boundary conditions object.
470 /// Pointer to graph defining mesh.
472 /// Name of the session.
473 std::string m_sessionName;
474 /// Current time of simulation.
476 /// Number of the step where the simulation should begin
478 /// Finish time of the simulation.
480 /// Time step size
482
483 /// Lambda constant in real system if one required.
485 /// Time between checkpoints.
488
490
491 /// Number of checkpoints written so far
493 /// Number of steps to take.
495 /// Number of steps between checkpoints.
497 /// Number of time steps between outputting status information.
499 /// Number of parallel-in-time time iteration.
500 int m_iterPIT = 0;
501 /// Index of windows for parallel-in-time time iteration.
502 int m_windowPIT = 0;
503 /// Spatial dimension (>= expansion dim).
505 /// Expansion dimension.
507 /// Flag to determine if single homogeneous mode is used.
509 /// Flag to determine if half homogeneous mode is used.
511 /// Flag to determine if use multiple homogenenous modes are used.
513 /// Flag to determine if FFT is used for homogeneous transform.
515 /**
516 * \brief Flag to determine if dealiasing is used for
517 * homogeneous simulations.
518 */
520 /**
521 * \brief Flag to determine if dealisising is usde for the
522 * Spectral/hp element discretisation.
523 */
525 /// Type of projection; e.g continuous or discontinuous.
527 /// Array holding trace normals for DG simulations in the forwards
528 /// direction.
530 /// Flag to indicate if the fields should be checked for singularity.
532 /// Map to identify relevant solver info to dump in output fields
534
535 /// Moving reference frame status in the inertial frame
536 /// X, Y, Z, Theta_x, Theta_y, Theta_z,
537 /// U, V, W, Omega_x, Omega_y, Omega_z,
538 /// A_x, A_y, A_z, DOmega_x, DOmega_y, DOmega_z,
539 /// pivot_x, pivot_y, pivot_z
541 /// variable name in m_movingFrameData
542 std::vector<std::string> m_strFrameData;
543
544 /// Number of Quadrature points used to work out the error
546
547 /// Parameter for homogeneous expansions
549 {
554 };
555
557
558 NekDouble m_LhomX; ///< physical length in X direction (if homogeneous)
559 NekDouble m_LhomY; ///< physical length in Y direction (if homogeneous)
560 NekDouble m_LhomZ; ///< physical length in Z direction (if homogeneous)
561
562 int m_npointsX; ///< number of points in X direction (if homogeneous)
563 int m_npointsY; ///< number of points in Y direction (if homogeneous)
564 int m_npointsZ; ///< number of points in Z direction (if homogeneous)
565
566 int m_HomoDirec; ///< number of homogenous directions
567
568 /// Initialises EquationSystem class members.
572
573 SOLVER_UTILS_EXPORT virtual void v_InitObject(bool DeclareFeld = true);
574
575 /// Virtual function for initialisation implementation.
577 bool dumpInitialConditions = true);
578
579 /// Virtual function for solve implementation.
580 SOLVER_UTILS_EXPORT virtual void v_DoSolve();
581
582 /// Virtual function for the L_inf error computation between fields and a
583 /// given exact solution.
585 unsigned int field,
587
588 /// Virtual function for the L_2 error computation between fields and a
589 /// given exact solution.
591 unsigned int field,
593 bool Normalised = false);
594
595 /// Virtual function for the H_1 error computation between fields and a
596 /// given exact solution.
598 unsigned int field,
600 bool Normalised = false);
601
602 /// Virtual function for transformation to physical space.
604
605 /// Virtual function for transformation to coefficient space.
607
608 /// Virtual function for generating summary information.
610
612 NekDouble initialtime = 0.0, bool dumpInitialConditions = true,
613 const int domain = 0);
614
616 unsigned int field, Array<OneD, NekDouble> &outfield,
617 const NekDouble time);
618
619 // Ouptut field information
620 SOLVER_UTILS_EXPORT virtual void v_Output(void);
621
622 // Get pressure field if available
624 void);
625
626 /// Virtual function to identify if operator is negated in DoSolve
627 SOLVER_UTILS_EXPORT virtual bool v_NegatedOp(void);
628
630 std::vector<Array<OneD, NekDouble>> &fieldcoeffs,
631 std::vector<std::string> &variables);
632
633 static std::string equationSystemTypeLookupIds[];
634 static std::string projectionTypeLookupIds[];
635
636private:
638
639 SOLVER_UTILS_EXPORT void PrintProgressbar(const int position,
640 const int goal) const
641 {
642 LibUtilities::PrintProgressbar(position, goal, "Interpolating");
643 }
644};
645
646/**
647 * Prints a summary of variables and problem parameters.
648 *
649 * Public interface routine to virtual function implementation.
650 *
651 * @param out The ostream object to write to.
652 */
653inline void EquationSystem::PrintSummary(std::ostream &out)
654{
655 if (m_session->GetComm()->GetRank() == 0)
656 {
657 std::vector<std::pair<std::string, std::string>> vSummary;
658 v_GenerateSummary(vSummary);
659
660 out << "==============================================================="
661 "========"
662 << std::endl
663 << std::flush;
664 for (auto &x : vSummary)
665 {
666 out << "\t";
667 out.width(20);
668 out << x.first << ": " << x.second << std::endl << std::flush;
669 }
670 out << "==============================================================="
671 "========"
672 << std::endl
673 << std::flush;
674 }
675}
676
678 UpdateFields(void)
679{
680 return m_fields;
681}
682
683inline void EquationSystem::CopyFromPhysField(const int i,
685{
686 Vmath::Vcopy(output.size(), m_fields[i]->GetPhys(), 1, output, 1);
687}
688
690 const int i, const Array<OneD, const NekDouble> &input)
691{
692 Vmath::Vcopy(input.size(), input, 1, m_fields[i]->UpdatePhys(), 1);
693}
694
696{
697 return m_fields[i]->UpdatePhys();
698}
699
700} // namespace SolverUtils
701} // namespace Nektar
702
703#endif
#define SOLVER_UTILS_EXPORT
Provides a generic Factory class.
A base class for describing how to solve specific equations.
SOLVER_UTILS_EXPORT void ResetSessionName(std::string newname)
Reset Session name.
SOLVER_UTILS_EXPORT Array< OneD, MultiRegions::ExpListSharedPtr > & UpdateFields()
int m_spacedim
Spatial dimension (>= expansion dim).
SOLVER_UTILS_EXPORT void SetInitialStep(const int step)
bool m_useFFT
Flag to determine if FFT is used for homogeneous transform.
SOLVER_UTILS_EXPORT int GetCheckpointSteps()
int m_expdim
Expansion dimension.
LibUtilities::FieldIOSharedPtr m_fld
Field input/output.
SOLVER_UTILS_EXPORT void SessionSummary(SummaryList &vSummary)
Write out a session summary.
virtual SOLVER_UTILS_EXPORT void v_SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
virtual SOLVER_UTILS_EXPORT ~EquationSystem()
Destructor.
SpatialDomains::MeshGraphSharedPtr m_graph
Pointer to graph defining mesh.
int m_npointsX
number of points in X direction (if homogeneous)
LibUtilities::CommSharedPtr m_comm
Communicator.
NekDouble m_timestep
Time step size.
int m_infosteps
Number of time steps between outputting status information.
SOLVER_UTILS_EXPORT void ImportFld(const std::string &infile, Array< OneD, MultiRegions::ExpListSharedPtr > &pFields)
Input field data from the given file.
NekDouble m_time
Current time of simulation.
SOLVER_UTILS_EXPORT void SetWindowNumberPIT(int num)
int m_iterPIT
Number of parallel-in-time time iteration.
bool m_multipleModes
Flag to determine if use multiple homogenenous modes are used.
SOLVER_UTILS_EXPORT MultiRegions::ExpListSharedPtr GetPressure()
Get pressure field if available.
SOLVER_UTILS_EXPORT int GetTraceNpoints()
SOLVER_UTILS_EXPORT void SetLambda(NekDouble lambda)
Set parameter m_lambda.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
int m_windowPIT
Index of windows for parallel-in-time time iteration.
NekDouble m_LhomX
physical length in X direction (if homogeneous)
virtual SOLVER_UTILS_EXPORT void v_TransPhysToCoeff()
Virtual function for transformation to coefficient space.
SOLVER_UTILS_EXPORT int GetNpoints()
SOLVER_UTILS_EXPORT void DoInitialise(bool dumpInitialConditions=true)
Perform any initialisation necessary before solving the problem.
std::vector< std::string > m_strFrameData
variable name in m_movingFrameData
SOLVER_UTILS_EXPORT NekDouble L2Error(unsigned int field, bool Normalised=false)
Compute the L2 error of the fields.
virtual SOLVER_UTILS_EXPORT bool v_NegatedOp(void)
Virtual function to identify if operator is negated in DoSolve.
NekDouble m_fintime
Finish time of the simulation.
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 MultiRegions::ExpListSharedPtr v_GetPressure(void)
NekDouble m_lambda
Lambda constant in real system if one required.
static std::string projectionTypeLookupIds[]
SOLVER_UTILS_EXPORT Array< OneD, NekDouble > & UpdatePhysField(const int i)
SOLVER_UTILS_EXPORT void SetCheckpointNumber(int num)
SOLVER_UTILS_EXPORT int GetNcoeffs()
int m_npointsZ
number of points in Z direction (if homogeneous)
SOLVER_UTILS_EXPORT void Checkpoint_Output(const int n)
Write checkpoint file of m_fields.
virtual SOLVER_UTILS_EXPORT void v_ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
SOLVER_UTILS_EXPORT NekDouble H1Error(unsigned int field, const Array< OneD, NekDouble > &exactsoln, bool Normalised=false)
Compute the H1 error between fields and a given exact solution.
std::map< std::string, SolverUtils::SessionFunctionSharedPtr > m_sessionFunctions
Map of known SessionFunctions.
NekDouble m_checktime
Time between checkpoints.
SOLVER_UTILS_EXPORT int GetSteps()
virtual SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareFeld=true)
Initialisation object for EquationSystem.
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.
static std::string equationSystemTypeLookupIds[]
SOLVER_UTILS_EXPORT int GetInfoSteps()
SOLVER_UTILS_EXPORT int GetNumExpModes()
virtual SOLVER_UTILS_EXPORT void v_EvaluateExactSolution(unsigned int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
virtual SOLVER_UTILS_EXPORT void v_DoInitialise(bool dumpInitialConditions=true)
Virtual function for initialisation implementation.
SOLVER_UTILS_EXPORT void WriteFld(const std::string &outname)
Write field data to the given filename.
SOLVER_UTILS_EXPORT int GetPhys_Offset(int n)
SOLVER_UTILS_EXPORT int GetExpSize()
SOLVER_UTILS_EXPORT NekDouble GetTimeStep()
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 bool NegatedOp()
Identify if operator is negated in DoSolve.
SOLVER_UTILS_EXPORT LibUtilities::FieldMetaDataMap & UpdateFieldMetaDataMap()
Get hold of FieldInfoMap so it can be updated.
NekDouble m_LhomY
physical length in Y direction (if homogeneous)
int m_npointsY
number of points in Y direction (if homogeneous)
SOLVER_UTILS_EXPORT void SetSteps(const int steps)
SOLVER_UTILS_EXPORT int GetNcoeffs(const int eid)
SOLVER_UTILS_EXPORT void SetModifiedBasis(const bool modbasis)
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.
std::string m_sessionName
Name of the session.
SOLVER_UTILS_EXPORT NekDouble GetTime()
Return final time.
SOLVER_UTILS_EXPORT void Checkpoint_BaseFlow(const int n)
Write base flow file of m_fields.
bool m_specHP_dealiasing
Flag to determine if dealisising is usde for the Spectral/hp element discretisation.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT Array< OneD, const Array< OneD, NekDouble > > GetTraceNormals()
bool m_singleMode
Flag to determine if single homogeneous mode is used.
SOLVER_UTILS_EXPORT void SetIterationNumberPIT(int num)
HomogeneousType
Parameter for homogeneous expansions.
SOLVER_UTILS_EXPORT void ZeroPhysFields()
SOLVER_UTILS_EXPORT void SetInitialConditions(NekDouble initialtime=0.0, bool dumpInitialConditions=true, const int domain=0)
Initialise the data in the dependent fields.
int m_HomoDirec
number of homogenous directions
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array holding trace normals for DG simulations in the forwards direction.
SOLVER_UTILS_EXPORT void SetCheckpointSteps(int num)
int m_initialStep
Number of the step where the simulation should begin.
SOLVER_UTILS_EXPORT int GetCoeff_Offset(int n)
enum HomogeneousType m_HomogeneousType
SOLVER_UTILS_EXPORT void ExtraFldOutput(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
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 std::string GetSessionName()
Get Session name.
Array< OneD, bool > m_checkIfSystemSingular
Flag to indicate if the fields should be checked for singularity.
bool m_homogen_dealiasing
Flag to determine if dealiasing is used for homogeneous simulations.
SOLVER_UTILS_EXPORT void SetTimeStep(const NekDouble timestep)
SOLVER_UTILS_EXPORT int GetTotPoints()
SOLVER_UTILS_EXPORT void TransCoeffToPhys()
Transform from coefficient to physical space.
int m_nchk
Number of checkpoints written so far.
SOLVER_UTILS_EXPORT LibUtilities::SessionReaderSharedPtr GetSession()
Get Session name.
SOLVER_UTILS_EXPORT void SetInfoSteps(int num)
enum MultiRegions::ProjectionType m_projectionType
Type of projection; e.g continuous or discontinuous.
SOLVER_UTILS_EXPORT void CopyFromPhysField(const int i, Array< OneD, NekDouble > &output)
virtual SOLVER_UTILS_EXPORT void v_DoSolve()
Virtual function for solve implementation.
virtual SOLVER_UTILS_EXPORT Array< OneD, bool > v_GetSystemSingularChecks()
SOLVER_UTILS_EXPORT const Array< OneD, int > GetNumExpModesPerExp()
int m_steps
Number of steps to take.
int m_NumQuadPointsError
Number of Quadrature points used to work out the error.
SOLVER_UTILS_EXPORT void PrintProgressbar(const int position, const int goal) const
SOLVER_UTILS_EXPORT EquationSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises EquationSystem class members.
SOLVER_UTILS_EXPORT int GetTotPoints(int n)
SOLVER_UTILS_EXPORT void DoSolve()
Solve the problem.
SOLVER_UTILS_EXPORT int GetTraceTotPoints()
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Map to identify relevant solver info to dump in output fields.
SOLVER_UTILS_EXPORT void Output()
Perform output operations after solve.
SpatialDomains::BoundaryConditionsSharedPtr m_boundaryConditions
Pointer to boundary conditions object.
Array< OneD, NekDouble > m_movingFrameData
Moving reference frame status in the inertial frame X, Y, Z, Theta_x, Theta_y, Theta_z,...
SOLVER_UTILS_EXPORT void SetBoundaryConditions(NekDouble time)
Evaluates the boundary conditions at the given time.
NekDouble m_LhomZ
physical length in Z direction (if homogeneous)
SOLVER_UTILS_EXPORT NekDouble LinfError(unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray)
Linf error computation.
virtual SOLVER_UTILS_EXPORT void v_GenerateSummary(SummaryList &l)
Virtual function for generating summary information.
bool m_halfMode
Flag to determine if half homogeneous mode is used.
SOLVER_UTILS_EXPORT void FwdTransFields()
virtual SOLVER_UTILS_EXPORT NekDouble v_H1Error(unsigned int field, const Array< OneD, NekDouble > &exactsoln=NullNekDouble1DArray, bool Normalised=false)
Virtual function for the H_1 error computation between fields and a given exact solution.
int m_checksteps
Number of steps between checkpoints.
SOLVER_UTILS_EXPORT void TransPhysToCoeff()
Transform from physical to coefficient space.
SOLVER_UTILS_EXPORT void EvaluateExactSolution(int field, Array< OneD, NekDouble > &outfield, const NekDouble time)
Evaluates an exact solution.
SOLVER_UTILS_EXPORT void CopyToPhysField(const int i, const Array< OneD, const NekDouble > &input)
SOLVER_UTILS_EXPORT int GetCheckpointNumber()
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
virtual SOLVER_UTILS_EXPORT void v_Output(void)
SOLVER_UTILS_EXPORT void SetTime(const NekDouble time)
SOLVER_UTILS_EXPORT int GetNvariables()
SOLVER_UTILS_EXPORT void InitObject(bool DeclareField=true)
Initialises the members of this object.
virtual SOLVER_UTILS_EXPORT void v_TransCoeffToPhys()
Virtual function for transformation to physical space.
SOLVER_UTILS_EXPORT const std::string GetVariable(unsigned int i)
SOLVER_UTILS_EXPORT void PrintSummary(std::ostream &out)
Print a summary of parameters and solver characteristics.
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:322
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:50
int PrintProgressbar(const int position, const int goal, const std::string message, int lastprogress=-1)
Prints a progressbar.
Definition: Progressbar.hpp:65
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
ProjectionType
Type of Galerkin projection.
static ExpListSharedPtr NullExpListSharedPtr
Definition: ExpList.h:1499
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
LibUtilities::NekFactory< std::string, EquationSystem, const LibUtilities::SessionReaderSharedPtr &, const SpatialDomains::MeshGraphSharedPtr & > EquationSystemFactory
Datatype of the NekFactory used to instantiate classes derived from the EquationSystem class.
std::vector< std::pair< std::string, std::string > > SummaryList
Definition: Misc.h:46
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< SessionFunction > SessionFunctionSharedPtr
std::shared_ptr< BoundaryConditions > BoundaryConditionsSharedPtr
Definition: Conditions.h:289
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
static Array< OneD, NekDouble > NullNekDouble1DArray
double NekDouble
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825