45 std::vector<FractureProperty*>
const& frac_props,
46 std::vector<JunctionProperty*>
const& junction_props,
47 std::unordered_map<int, int>
const& fracID_to_local,
48 Eigen::Vector3d
const& x)
51 std::vector<bool> levelsets(frac_props.size());
52 for (std::size_t i = 0; i < frac_props.size(); i++)
57 std::vector<double> enrichments(frac_props.size() + junction_props.size());
59 for (std::size_t i = 0; i < frac_props.size(); i++)
61 auto const* frac = frac_props[i];
62 enrichments[i] = Heaviside(
63 std::accumulate(cbegin(frac->branches_slave),
64 cend(frac->branches_slave), levelsets[i],
65 [&](
bool const enrich,
auto const& branch)
66 { return enrich && levelsetBranch(branch, x); }));
70 for (std::size_t i = 0; i < junction_props.size(); i++)
72 auto const* junction = junction_props[i];
73 auto fid1 = fracID_to_local.at(junction->fracture_ids[0]);
74 auto fid2 = fracID_to_local.at(junction->fracture_ids[1]);
75 bool const enrich = levelsets[fid1] && levelsets[fid2];
76 enrichments[i + frac_props.size()] = Heaviside(enrich);
83 std::size_t this_frac_id,
84 std::vector<FractureProperty*>
const& frac_props,
85 std::vector<JunctionProperty*>
const& junction_props,
86 std::unordered_map<int, int>
const& fracID_to_local,
87 Eigen::Vector3d
const& x)
89 auto this_frac_local_index = fracID_to_local.at(this_frac_id);
90 auto const& this_frac = *frac_props[this_frac_local_index];
92 std::vector<bool> levelsets(frac_props.size());
93 for (std::size_t i = 0; i < frac_props.size(); i++)
98 std::vector<double> enrichments(frac_props.size() + junction_props.size());
99 enrichments[this_frac_local_index] = 1.0;
102 if (frac_props.size() > 1)
104 for (
auto const& branch : this_frac.branches_master)
106 if (branch.master_fracture_id != this_frac.fracture_id)
111 if (fracID_to_local.find(branch.slave_fracture_id) ==
112 fracID_to_local.end())
117 double sign = boost::math::sign(
118 this_frac.normal_vector.dot(branch.normal_vector_branch));
119 auto slave_fid = fracID_to_local.at(branch.slave_fracture_id);
120 double const enrich = levelsets[slave_fid] ? 1. : 0.;
121 enrichments[slave_fid] = sign * enrich;
126 for (
unsigned i = 0; i < junction_props.size(); i++)
128 auto const* junction = junction_props[i];
129 if (!ranges::contains(junction->fracture_ids, this_frac.fracture_id))
134 auto another_frac_id =
135 (junction->fracture_ids[0] == this_frac.fracture_id)
136 ? junction->fracture_ids[1]
137 : junction->fracture_ids[0];
138 auto fid = fracID_to_local.at(another_frac_id);
139 double const enrich = levelsets[fid] ? 1. : 0.;
140 enrichments[i + frac_props.size()] = enrich;
std::vector< double > duGlobalEnrichments(std::size_t this_frac_id, std::vector< FractureProperty * > const &frac_props, std::vector< JunctionProperty * > const &junction_props, std::unordered_map< int, int > const &fracID_to_local, Eigen::Vector3d const &x)
std::vector< double > uGlobalEnrichments(std::vector< FractureProperty * > const &frac_props, std::vector< JunctionProperty * > const &junction_props, std::unordered_map< int, int > const &fracID_to_local, Eigen::Vector3d const &x)