25 if (
auto fe_method_ptr =
fePtr.lock()) {
29 const auto problem_name = fe_method_ptr->problemPtr->getName();
31 for (
auto bc : bc_mng->getBcMapByBlockName()) {
32 if (
auto disp_bc = bc.second->dispBcPtr) {
34 auto &bc_id = bc.first;
36 auto regex_str = (boost::format(
"%s_(.*)") % problem_name).str();
37 if (std::regex_match(bc_id, std::regex(regex_str))) {
46 const auto nb_field_coeffs = get_field_coeffs(
field_name);
49 <<
"Apply EssentialPreProc<DisplacementCubitBcData>: "
50 << problem_name <<
"_" <<
field_name <<
"_" << block_name;
56 if (
auto ext_disp_bc =
57 dynamic_cast<DisplacementCubitBcDataWithRotation
const *
>(
59 for (
int a = 0;
a != 3; ++
a)
60 t_off(
a) = ext_disp_bc->rotOffset[
a];
63 auto scale_value = [&](
const double &
c) {
66 val *= s->getScale(fe_method_ptr->ts_t);
71 if (disp_bc->data.flag1 == 1)
72 t_vals(0) = scale_value(-disp_bc->data.value1);
73 if (disp_bc->data.flag2 == 1)
74 t_vals(1) = scale_value(-disp_bc->data.value2);
75 if (disp_bc->data.flag3 == 1)
76 t_vals(2) = scale_value(-disp_bc->data.value3);
77 if (disp_bc->data.flag4 == 1)
78 t_angles(0) = scale_value(-disp_bc->data.value4);
79 if (disp_bc->data.flag5 == 1)
80 t_angles(1) = scale_value(-disp_bc->data.value5);
81 if (disp_bc->data.flag6 == 1)
82 t_angles(2) = scale_value(-disp_bc->data.value6);
85 std::array<std::vector<double>, 3> coords;
88 const bool is_rotation =
89 disp_bc->data.flag4 || disp_bc->data.flag5 || disp_bc->data.flag6;
91 auto lambda = [&](boost::shared_ptr<FieldEntity> field_entity_ptr) {
94 auto v = t_vals(coeff);
97 coords[0][idx], coords[1][idx], coords[2][idx]);
99 t_angles, t_coords, t_off)(coeff);
102 v += coords[coeff][idx];
105 field_entity_ptr->getEntFieldData()[coeff] =
v;
112 [&](boost::shared_ptr<FieldEntity> field_entity_ptr) {
114 auto size = field_entity_ptr->getEntFieldData().size();
115 for (
int i = coeff;
i < size;
i += nb_field_coeffs)
116 field_entity_ptr->getEntFieldData()[
i] = 0;
120 auto verts = bc.second->bcEnts.subset_by_type(MBVERTEX);
121 auto not_verts = subtract(bc.second->bcEnts, verts);
124 for (
auto d : {0, 1, 2})
125 coords[
d].resize(verts.size());
128 &*coords[2].begin());
131 if (disp_bc->data.flag1 || disp_bc->data.flag5 ||
132 disp_bc->data.flag6) {
139 if (disp_bc->data.flag2 || disp_bc->data.flag4 ||
140 disp_bc->data.flag6) {
143 if (nb_field_coeffs > 1) {
149 if (disp_bc->data.flag3 || disp_bc->data.flag4 ||
150 disp_bc->data.flag5 || is_rotation) {
153 if (nb_field_coeffs > 2) {
165 "Can not lock shared pointer");