18using namespace navier;
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);
49int 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);
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);
virtual void RegisterField(const std::string &field_name, GridFunction *gf)
Add a grid function to the collection.
void SetCycle(int c)
Set time cycle (for time-dependent simulations)
void SetTime(real_t t)
Set physical time (for time-dependent simulations)
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
int GetNE() const
Returns number of elements.
void UniformRefinement(int i, const DSTable &, int *, int *, int *)
static bool Root()
Return true if the rank in MPI_COMM_WORLD is zero.
static void Init(int &argc, char **&argv, int required=default_thread_required, int *provided=nullptr)
Singleton creation with Mpi::Init(argc, argv).
Class for parallel grid function.
void ProjectCoefficient(Coefficient &coeff) override
Project coeff Coefficient to this GridFunction. The projection computation depends on the choice of t...
Class for parallel meshes.
Helper class for ParaView visualization data.
void SetHighOrderOutput(bool high_order_output_)
void SetLevelsOfDetail(int levels_of_detail_)
virtual void Save() override
void SetDataFormat(VTKFormat fmt)
A general vector function coefficient.
Transient incompressible Navier Stokes solver in a split scheme formulation.
void Setup(real_t dt)
Initialize forms, solvers and preconditioners.
void AddVelDirichletBC(VectorCoefficient *coeff, Array< int > &attr)
Add a Dirichlet boundary condition to the velocity field.
ParGridFunction * GetCurrentPressure()
Return a pointer to the current pressure ParGridFunction.
void PrintTimingData()
Print timing summary of the solving routine.
void EnablePA(bool pa)
Enable partial assembly for every operator.
ParGridFunction * GetCurrentVelocity()
Return a pointer to the current velocity ParGridFunction.
void Step(real_t &time, real_t dt, int cur_step, bool provisional=false)
Compute solution at the next time step t+dt.
real_t u(const Vector &xvec)
struct s_NavierContext ctx
void vel(const Vector &x, real_t t, Vector &u)