Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable usage of residual projection for velocity solvers (#122) #123

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/core/insSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ ins_t* insSetup(MPI_Comm comm, occa::device device, setupAide &options, int buil
ins->vOptions.setArgs("DISCRETIZATION", options.getArgs("VELOCITY DISCRETIZATION"));
ins->vOptions.setArgs("BASIS", options.getArgs("VELOCITY BASIS"));
ins->vOptions.setArgs("PRECONDITIONER", options.getArgs("VELOCITY PRECONDITIONER"));
ins->vOptions.setArgs("RESIDUAL PROJECTION", options.getArgs("VELOCITY RESIDUAL PROJECTION"));
ins->vOptions.setArgs("RESIDUAL PROJECTION VECTORS", options.getArgs("VELOCITY RESIDUAL PROJECTION VECTORS"));
ins->vOptions.setArgs("RESIDUAL PROJECTION START", options.getArgs("VELOCITY RESIDUAL PROJECTION START"));
ins->vOptions.setArgs("MULTIGRID COARSENING", options.getArgs("VELOCITY MULTIGRID COARSENING"));
ins->vOptions.setArgs("MULTIGRID SMOOTHER", options.getArgs("VELOCITY MULTIGRID SMOOTHER"));
ins->vOptions.setArgs("MULTIGRID CHEBYSHEV DEGREE",
Expand Down
19 changes: 19 additions & 0 deletions src/core/parReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ void setDefaultSettings(libParanumal::setupAide &options, string casename, int r
options.setArgs("VELOCITY BASIS", "NODAL");
options.setArgs("VELOCITY PRECONDITIONER", "JACOBI");
options.setArgs("VELOCITY DISCRETIZATION", "CONTINUOUS");
options.setArgs("VELOCITY RESIDUAL PROJECTION", "FALSE");
options.setArgs("VELOCITY RESIDUAL PROJECTION VECTORS", "8");
options.setArgs("VELOCITY RESIDUAL PROJECTION START", "5");

options.setArgs("VARIABLE VISCOSITY", "FALSE");
options.setArgs("LOWMACH", "FALSE");
Expand Down Expand Up @@ -452,12 +455,28 @@ libParanumal::setupAide parRead(std::string &setupFile, MPI_Comm comm)

string vsolver;
int flow = 1;
bool v_rproj;
if(ini.extract("velocity", "residualproj", v_rproj)) {
if(v_rproj)
options.setArgs("VELOCITY RESIDUAL PROJECTION", "TRUE");
else
options.setArgs("VELOCITY RESIDUAL PROJECTION", "FALSE");

int v_nProjVec;
if(ini.extract("velocity", "residualprojectionvectors", v_nProjVec))
options.setArgs("VELOCITY RESIDUAL PROJECTION VECTORS", std::to_string(v_nProjVec));
int v_nProjStep;
if(ini.extract("velocity", "residualprojectionstart", v_nProjStep))
options.setArgs("VELOCITY RESIDUAL PROJECTION START", std::to_string(v_nProjStep));
}
ini.extract("velocity", "solver", vsolver);
if(vsolver == "none") {
options.setArgs("VELOCITY SOLVER", "NONE");
flow = 0;
} else if(std::strstr(vsolver.c_str(), "block")) {
options.setArgs("VELOCITY BLOCK SOLVER", "TRUE");
if(options.compareArgs("VELOCITY RESIDUAL PROJECTION","TRUE"))
exit("Residual projection is not enabled for the velocity block solver!", EXIT_FAILURE);
}

double v_residualTol;
Expand Down