void FluidSim::apply_projection(float dt) { //Compute finite-volume type face area weight for each velocity sample. compute_pressure_weights(); //Set up and solve the variational pressure solve. solve_pressure(dt); }
void FluidSim::project(float dt) { //Estimate the liquid signed distance compute_phi(); //Compute finite-volume type face area weight for each velocity sample. compute_weights(); //Set up and solve the variational pressure solve. solve_pressure(dt); }
void Solve_Stokes(Element_List **V, Element_List **Vf, Bndry **Vbc, Bsystem **Vbsys) { static double *RHS = (double*)0; static double *U0 = (double*)0; static int nglob = 0; static int eDIM = V[0]->flist[0]->dim(); if(Vbsys[eDIM]->nglobal > nglob) { if(nglob) { free(U0); free(RHS); } nglob = Vbsys[eDIM]->nglobal; RHS = dvector(0,nglob-1); U0 = dvector(0,nglob-1); } dzero(nglob,U0,1); st = clock(); /* ----------------------------*/ /* Compute the Right-Hand Side */ setupRHS(V, Vf, RHS, U0, Vbc, Vbsys); /*-----------------------------*/ Timing("SetupRHS......."); /*-----------------------------*/ /* Solve the boundary system */ solve_boundary(V, RHS, U0, Vbsys); /*-----------------------------*/ Timing("Boundary......."); /*-----------------------------*/ /* Solve the pressure system */ solve_pressure(V, RHS, Vbsys); /*-----------------------------*/ Timing("Pressure......."); /*-----------------------------*/ /* solve the Interior system */ solve_velocity_interior(V, Vbsys); /*-----------------------------*/ Timing("VInterior......"); }