18 using namespace navier;
20 struct s_NavierContext
23 double kin_vis = 0.001;
38 u(0) = 16.0 * U * yi * zi * sin(M_PI * t / 8.0) * (0.41 - yi)
39 * (0.41 - zi) / pow(0.41, 4.0);
49 int main(
int argc,
char *argv[])
54 int serial_refinements = 0;
56 Mesh *mesh =
new Mesh(
"box-cylinder.mesh");
58 for (
int i = 0; i < serial_refinements; ++i)
65 std::cout <<
"Number of elements: " << mesh->
GetNE() << std::endl;
68 auto *pmesh =
new ParMesh(MPI_COMM_WORLD, *mesh);
91 double t_final =
ctx.t_final;
92 bool last_step =
false;
109 for (
int step = 0; !last_step; ++step)
111 if (t + dt >= t_final - dt / 2)
116 flowsolver.
Step(t, dt, step);
127 printf(
"%11s %11s\n",
"Time",
"dt");
128 printf(
"%.5E %.5E\n", t, dt);
void PrintTimingData()
Print timing summary of the solving routine.
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(), hypre will be finalized automatically at program exit.
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
void SetDataFormat(VTKFormat fmt)
Helper class for ParaView visualization data.
int GetNE() const
Returns number of elements.
virtual void ProjectCoefficient(Coefficient &coeff)
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
void Setup(double dt)
Initialize forms, solvers and preconditioners.
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Add a grid function to the collection.
struct s_NavierContext ctx
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
ParGridFunction * GetCurrentPressure()
Return a pointer to the current pressure ParGridFunction.
void EnablePA(bool pa)
Enable partial assembly for every operator.
void AddVelDirichletBC(VectorCoefficient *coeff, Array< int > &attr)
Add a Dirichlet boundary condition to the velocity field.
void SetHighOrderOutput(bool high_order_output_)
static void Init()
Singleton creation with Mpi::Init();.
void SetTime(double t)
Set physical time (for time-dependent simulations)
static bool Root()
Return true if the rank in MPI_COMM_WORLD is zero.
A general vector function coefficient.
ParGridFunction * GetCurrentVelocity()
Return a pointer to the current velocity ParGridFunction.
void vel(const Vector &x, double t, Vector &u)
void SetLevelsOfDetail(int levels_of_detail_)
void Step(double &time, double dt, int cur_step, bool provisional=false)
Compute solution at the next time step t+dt.
virtual void Save() override
double u(const Vector &xvec)
Class for parallel grid function.
Class for parallel meshes.
Transient incompressible Navier Stokes solver in a split scheme formulation.