Skip to content

Commit

Permalink
Also adding flag
Browse files Browse the repository at this point in the history
  • Loading branch information
loumalouomega committed Apr 19, 2024
1 parent a7d0604 commit f28cf74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kratos/processes/calculate_nodal_distance_to_skin_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ CalculateNodalDistanceToSkinProcess::CalculateNodalDistanceToSkinProcess(
// Assign distance variable
mpDistanceVariable = &KratosComponents<Variable<double>>::Get(ThisParameters["distance_variable"].GetString());
mpSkinDistanceVariable = &KratosComponents<Variable<double>>::Get(ThisParameters["skin_distance_variable"].GetString());
mIdVisitedFlag = KratosComponents<Flags>::Get(ThisParameters["visited_skin_flag"].GetString());

// Check it is serial
KRATOS_ERROR_IF(mrVolumeModelPart.IsDistributed()) << "Distributed computation still not supported. Please update implementation as soon as MPI search is merged. See https://github.com/KratosMultiphysics/Kratos/pull/11719" << std::endl;
Expand Down Expand Up @@ -116,7 +117,7 @@ void CalculateNodalDistanceToSkinProcess::Execute()
auto p_result = result.Get().get();
if (p_result->GetValue(r_skin_variable) < value) {
p_result->SetValue(r_skin_variable, value);
p_result->Set(VISITED);
p_result->Set(mIdVisitedFlag);
}
p_variable_retriever->GetValue(rNode, r_variable) = value;
}
Expand Down Expand Up @@ -163,7 +164,8 @@ const Parameters CalculateNodalDistanceToSkinProcess::GetDefaultParameters() con
"distance_database" : "nodal_historical",
"save_max_distance_in_skin" : false,
"distance_variable" : "DISTANCE",
"skin_distance_variable" : "DISTANCE"
"skin_distance_variable" : "DISTANCE",
"visited_skin_flag" : "VISITED"
})");
return default_parameters;
}
Expand Down
3 changes: 3 additions & 0 deletions kratos/processes/calculate_nodal_distance_to_skin_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ class KRATOS_API(KRATOS_CORE) CalculateNodalDistanceToSkinProcess
/// Pointer to the skin saved distance variable.
const Variable<double>* mpSkinDistanceVariable = &DISTANCE;

/// The flag to check if the distance is saved in the skin
Flags mIdVisitedFlag = VISITED;

/// This flag is used in order to check if the values are historical
bool mHistoricalValue = true;

Expand Down

0 comments on commit f28cf74

Please sign in to comment.