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[])
53 int serial_refinements = 0;
55 Mesh *mesh =
new Mesh(
"box-cylinder.mesh");
57 for (
int i = 0; i < serial_refinements; ++i)
64 std::cout <<
"Number of elements: " << mesh->
GetNE() << std::endl;
67 auto *pmesh =
new ParMesh(MPI_COMM_WORLD, *mesh);
90 double t_final =
ctx.t_final;
91 bool last_step =
false;
108 for (
int step = 0; !last_step; ++step)
110 if (t + dt >= t_final - dt / 2)
115 flowsolver.
Step(t, dt, step);
126 printf(
"%11s %11s\n",
"Time",
"dt");
127 printf(
"%.5E %.5E\n", t, dt);
void PrintTimingData()
Print timing summary of the solving routine.
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)
int main(int argc, char *argv[])
void Setup(double dt)
Initialize forms, solvers and preconditioners.
void Step(double &time, double dt, int cur_step)
Compute solution at the next time step t+dt.
A simple convenience class that calls MPI_Init() at construction and MPI_Finalize() at destruction...
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.
bool Root() const
Return true if WorldRank() == 0.
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_)
void SetTime(double t)
Set physical time (for time-dependent simulations)
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_)
virtual void Save() override
Class for parallel grid function.
Class for parallel meshes.
Transient incompressible Navier Stokes solver in a split scheme formulation.