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

LIE intersect (continued). #2293

Merged
merged 13 commits into from
Dec 11, 2018
Prev Previous commit
Next Next commit
[PL] LIE/post; Rename function to reflect purpose.
  • Loading branch information
endJunction committed Dec 10, 2018
commit 5207e0f1005fc557c9eb501b48ff952822f56c85
12 changes: 7 additions & 5 deletions ProcessLib/LIE/Common/PostUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ std::vector<int> const& getMaterialIdsForNode(
return itr->second;
};

int getfrac2matid(std::vector<int> const& fracmatids, int frac1matid)
int findFirstNotEqualElement(std::vector<int> const& fracmatids, int frac1matid)
{
auto itr_mat2 =
std::find_if(fracmatids.begin(), fracmatids.end(),
[&](int matid) { return matid != frac1matid; });
std::find_if_not(fracmatids.begin(), fracmatids.end(),
[&](int matid) { return matid == frac1matid; });
assert(itr_mat2 != fracmatids.end());
return *itr_mat2;
};
Expand Down Expand Up @@ -162,7 +162,8 @@ PostProcessTool::PostProcessTool(
// branch nodes
const auto& br_matids = getMaterialIdsForNode(
vec_branch_nodeID_matIDs, node_id);
auto frac2_matid = getfrac2matid(br_matids, frac_matid);
auto frac2_matid =
findFirstNotEqualElement(br_matids, frac_matid);
auto const frac2_id =
matid2fracid(vec_fracture_mat_IDs, frac2_matid);
auto prop_levelset2 =
Expand All @@ -186,7 +187,8 @@ PostProcessTool::PostProcessTool(
// junction nodes
const auto& jct_matids = getMaterialIdsForNode(
vec_junction_nodeID_matIDs, node_id);
auto frac2_matid = getfrac2matid(jct_matids, frac_matid);
auto frac2_matid =
findFirstNotEqualElement(jct_matids, frac_matid);
auto const frac2_id =
matid2fracid(vec_fracture_mat_IDs, frac2_matid);
auto prop_levelset2 =
Expand Down