35using namespace navier;
40 real_t kinvis = 1.0 / 100000.0;
41 real_t t_final = 10 * 1e-3;
55 u(0) = tanh(rho * (yi - 0.25));
59 u(0) = tanh(rho * (0.75 - yi));
62 u(1) =
delta * sin(2.0 * M_PI * xi);
65int main(
int argc,
char *argv[])
70 int serial_refinements = 2;
72 Mesh *mesh =
new Mesh(
"../../data/periodic-square.mesh");
78 for (
int i = 0; i < serial_refinements; ++i)
85 std::cout <<
"Number of elements: " << mesh->
GetNE() << std::endl;
88 auto *pmesh =
new ParMesh(MPI_COMM_WORLD, *mesh);
103 bool last_step =
false;
105 flowsolver.
Setup(dt);
124 for (
int step = 0; !last_step; ++step)
126 if (
t + dt >= t_final - dt / 2)
131 flowsolver.
Step(
t, dt, step);
143 printf(
"%11s %11s\n",
"Time",
"dt");
144 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)
Class for grid function - Vector with associated FE space.
static void Init()
Initialize hypre by calling HYPRE_Init() and set default options. After calling Hypre::Init(),...
void EnsureNodes()
Make sure that the mesh has valid nodes, i.e. its geometry is described by a vector finite element gr...
int GetNE() const
Returns number of elements.
void GetNodes(Vector &node_coord) const
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.
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.
void ComputeCurl2D(ParGridFunction &u, ParGridFunction &cu, bool assume_scalar=false)
Compute for .
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_shear_ic(const Vector &x, real_t t, Vector &u)