Skip to content
Snippets Groups Projects
Commit 976efb0e authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[PL] LIE/HM: Fix global idx for nodal_w and b.

b being the aperture.
Also simplify finding the process variable id for "displacement_jump1"
variable.
parent 1876ffd1
No related branches found
No related tags found
No related merge requests found
...@@ -421,30 +421,20 @@ void HydroMechanicsProcess<GlobalDim>::computeSecondaryVariableConcrete( ...@@ -421,30 +421,20 @@ void HydroMechanicsProcess<GlobalDim>::computeSecondaryVariableConcrete(
// variables are set during output and are not ready yet when this function // variables are set during output and are not ready yet when this function
// is called. // is called.
int g_variable_id = 0; int g_variable_id = 0;
int g_global_component_offset = 0;
{ {
int global_component_offset_next = 0;
int global_component_offset = 0;
const int monolithic_process_id = 0; const int monolithic_process_id = 0;
for (int variable_id = 0; auto const& pvs = getProcessVariables(monolithic_process_id);
variable_id < auto const it =
static_cast<int>(this->getProcessVariables( std::find_if(pvs.begin(), pvs.end(), [](ProcessVariable const& pv) {
monolithic_process_id).size()); return pv.getName() == "displacement_jump1";
++variable_id) });
if (it == pvs.end())
{ {
ProcessVariable& pv = OGS_FATAL(
this->getProcessVariables(monolithic_process_id)[variable_id]; "Didn't find expected \"displacement_jump1\" process "
int const n_components = pv.getNumberOfComponents(); "variable.");
global_component_offset = global_component_offset_next;
global_component_offset_next += n_components;
if (pv.getName() != "displacement_jump1")
continue;
g_variable_id = variable_id;
g_global_component_offset = global_component_offset;
break;
} }
g_variable_id = std::distance(pvs.begin(), it);
} }
MathLib::LinAlg::setLocalAccessibleVector(x); MathLib::LinAlg::setLocalAccessibleVector(x);
...@@ -466,10 +456,11 @@ void HydroMechanicsProcess<GlobalDim>::computeSecondaryVariableConcrete( ...@@ -466,10 +456,11 @@ void HydroMechanicsProcess<GlobalDim>::computeSecondaryVariableConcrete(
MeshLib::Location const l(mesh_id, MeshLib::MeshItemType::Node, MeshLib::Location const l(mesh_id, MeshLib::MeshItemType::Node,
node->getID()); node->getID());
auto const global_component_id = auto const global_index =
g_global_component_offset + component_id; _local_to_global_index_map->getGlobalIndex(l, g_variable_id,
component_id);
mesh_prop_g[node->getID() * num_comp + component_id] = mesh_prop_g[node->getID() * num_comp + component_id] =
x[global_component_id]; x[global_index];
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment