35 using namespace navier;
37 struct s_NavierContext
40 double kinvis = 1.0 / 100000.0;
41 double 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);
65 int main(
int argc,
char *argv[])
69 int serial_refinements = 2;
71 Mesh *mesh =
new Mesh(
"../../data/periodic-square.mesh");
77 for (
int i = 0; i < serial_refinements; ++i)
84 std::cout <<
"Number of elements: " << mesh->
GetNE() << std::endl;
87 auto *pmesh =
new ParMesh(MPI_COMM_WORLD, *mesh);
101 double t_final =
ctx.t_final;
102 bool last_step =
false;
104 flowsolver.
Setup(dt);
123 for (
int step = 0; !last_step; ++step)
125 if (t + dt >= t_final - dt / 2)
130 flowsolver.
Step(t, dt, step);
142 printf(
"%11s %11s\n",
"Time",
"dt");
143 printf(
"%.5E %.5E\n", t, dt);
void PrintTimingData()
Print timing summary of the solving routine.
Class for grid function - Vector with associated FE space.
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 vel_shear_ic(const Vector &x, double t, Vector &u)
void Setup(double dt)
Initialize forms, solvers and preconditioners.
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 SetHighOrderOutput(bool high_order_output_)
void ComputeCurl2D(ParGridFunction &u, ParGridFunction &cu, bool assume_scalar=false)
Compute for .
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 SetLevelsOfDetail(int levels_of_detail_)
void GetNodes(Vector &node_coord) const
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.