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

[Core] AMGCL NS - Allow using different var for pressure #11687

Merged
Merged
Changes from 1 commit
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
5 changes: 4 additions & 1 deletion kratos/linear_solvers/amgcl_ns_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class AMGCL_NS_Solver : public LinearSolver< TSparseSpaceType,
//kratos specific settings
mTol = rParameters["inner_settings"]["solver"]["tol"].GetDouble();
mVerbosity=rParameters["verbosity"].GetInt();
mPressureVarName = rParameters["schur_variable"].GetString();
mndof = 1;

//pass settings to amgcl
Expand Down Expand Up @@ -403,12 +404,13 @@ class AMGCL_NS_Solver : public LinearSolver< TSparseSpaceType,
//*****************************
//compute pressure mask
if(mp.size() != rA.size1()) mp.resize( rA.size1() );
const auto& r_pressure_var = KratosComponents<Variable<double>>::Get(mPressureVarName);
for (ModelPart::DofsArrayType::iterator it = rDofSet.begin(); it!=rDofSet.end(); it++)
{
const unsigned int eq_id = it->EquationId();
if( eq_id < rA.size1() )
{
mp[eq_id] = (it->GetVariable().Key() == PRESSURE);
mp[eq_id] = (it->GetVariable().Key() == r_pressure_var);
}
}

Expand All @@ -419,6 +421,7 @@ class AMGCL_NS_Solver : public LinearSolver< TSparseSpaceType,

double mTol;
int mVerbosity;
std::string mPressureVarName;
loumalouomega marked this conversation as resolved.
Show resolved Hide resolved
int mndof;
std::vector< char > mp;

Expand Down