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 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
6 changes: 5 additions & 1 deletion kratos/linear_solvers/amgcl_ns_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

// Project includes
#include "includes/define.h"
#include "includes/kratos_components.h"
#include "linear_solvers/iterative_solver.h"

#include <boost/property_tree/json_parser.hpp>
Expand Down Expand Up @@ -118,6 +119,8 @@ class AMGCL_NS_Solver : public LinearSolver< TSparseSpaceType,
//kratos specific settings
mTol = rParameters["inner_settings"]["solver"]["tol"].GetDouble();
mVerbosity=rParameters["verbosity"].GetInt();
const std::string pressure_var_name = rParameters["schur_variable"].GetString();
mpPressureVar = &KratosComponents<Variable<double>>::Get(pressure_var_name);
mndof = 1;

//pass settings to amgcl
Expand Down Expand Up @@ -408,7 +411,7 @@ class AMGCL_NS_Solver : public LinearSolver< TSparseSpaceType,
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() == *mpPressureVar);
ddiezrod marked this conversation as resolved.
Show resolved Hide resolved
}
}

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

double mTol;
int mVerbosity;
const Variable<double>* mpPressureVar = nullptr;
int mndof;
std::vector< char > mp;

Expand Down