56 for (
unsigned e = 0;
e <
n;
e++)
64 oomph_info <<
"Number of elements to be refined " << this->Nrefined
66 oomph_info <<
"Number of elements to be unrefined " << this->Nunrefined
77 <<
"adapt: Time for getting volume targets : "
82 if ((Nrefined > 0) || (Nunrefined > this->max_keep_unrefined()) ||
85 if (!((Nrefined > 0) || (Nunrefined > max_keep_unrefined())))
87 oomph_info <<
"Mesh regeneration triggered by edge ratio criterion\n";
111 cgal_params.enable_use_eulerian_coordinates_during_setup();
117 std::ostringstream error_message;
118 error_message <<
"Non-CGAL-based target size transfer not implemented.\n";
129 unsigned nelem = this->nelement();
130 for (
unsigned e = 0;
e <
nelem;
e++)
138 ->min_and_max_coordinates();
142 (min_and_max_coordinates[0].second - min_and_max_coordinates[0].first);
144 (min_and_max_coordinates[1].second - min_and_max_coordinates[1].first);
146 (min_and_max_coordinates[2].second - min_and_max_coordinates[2].first);
149 this->Gmsh_parameters_pt->dx_for_target_size_transfer();
160 std::string target_size_file_name =
161 this->Gmsh_parameters_pt->target_size_file_name();
166 << min_and_max_coordinates[1].first <<
" "
167 << min_and_max_coordinates[2].first <<
" " << std::endl;
174 this->Gmsh_parameters_pt->counter_for_filename_gmsh_size_transfer();
176 this->Gmsh_parameters_pt->stem_for_filename_gmsh_size_transfer();
186 <<
", K=" << nz + 1 << std::endl;
187 this->Gmsh_parameters_pt->counter_for_filename_gmsh_size_transfer()++;
192 for (
unsigned i = 0;
i <= nx;
i++)
194 x[0] = min_and_max_coordinates[0].first +
double(
i) *
dx;
195 for (
unsigned j = 0;
j <= ny;
j++)
197 x[1] = min_and_max_coordinates[1].first +
double(
j) *
dy;
198 for (
unsigned k = 0;
k <= nz;
k++)
200 x[2] = min_and_max_coordinates[2].first +
double(
k) *
dz;
207 this->Gmsh_parameters_pt
208 ->max_sample_points_for_limited_locate_zeta_during_target_size_transfer();
218 std::ostringstream error_message;
220 <<
"Non-CGAL-based target size transfer not implemented.\n";
233 std::stringstream error_message;
234 error_message <<
"Limited locate zeta failed for zeta = [ "
235 << x[0] <<
" " << x[1] <<
" " << x[2]
236 <<
" ]. Makes no sense!\n";
250 std::stringstream error_message;
252 <<
"Cast to FE for GeomObject returned by limited "
253 <<
"locate zeta failed for zeta = [ " << x[0] <<
" " << x[1]
254 <<
" " << x[2] <<
" ]. Makes no sense!\n";
296 this->Time_stepper_pt);
312 if (!this->Gmsh_parameters_pt->projection_is_disabled())
321 <<
"adapt: Time for project soln onto new mesh : "
330 for (
unsigned j =
nnod;
j > 0;
j--)
335 unsigned nel = nelement();
336 for (
unsigned e =
nel;
e > 0;
e--)
338 delete Element_pt[
e - 1];
339 Element_pt[
e - 1] = 0;
347 Element_pt.resize(
nel);
348 for (
unsigned j = 0;
j <
nnod;
j++)
352 for (
unsigned e = 0;
e <
nel;
e++)
359 Boundary_element_pt.resize(
nbound);
360 Face_index_at_boundary.resize(
nbound);
361 Boundary_node_pt.resize(
nbound);
362 for (
unsigned b = 0; b <
nbound; b++)
365 Boundary_element_pt[b].resize(
nel);
366 Face_index_at_boundary[b].resize(
nel);
367 for (
unsigned e = 0;
e <
nel;
e++)
369 Boundary_element_pt[b][
e] =
new_mesh_pt->boundary_element_pt(b,
e);
370 Face_index_at_boundary[b][
e] =
374 Boundary_node_pt[b].resize(
nnod);
375 for (
unsigned j = 0;
j <
nnod;
j++)
377 Boundary_node_pt[b][
j] =
new_mesh_pt->boundary_node_pt(b,
j);
388 this->Region_element_pt.resize(
n_region);
389 this->Region_attribute.resize(
n_region);
393 this->Region_attribute[
i] =
new_mesh_pt->region_attribute(
i);
396 unsigned r = this->Region_attribute[
i];
401 this->Region_element_pt[
i][
e] =
407 this->Boundary_region_element_pt.resize(
nbound);
408 this->Face_index_region_at_boundary.resize(
nbound);
411 for (
unsigned b = 0; b <
nbound; ++b)
416 unsigned r = this->Region_attribute[
i];
423 this->Boundary_region_element_pt[b][
r].resize(
425 this->Face_index_region_at_boundary[b][
r].resize(
431 this->Boundary_region_element_pt[b][
r][
e] =
433 this->Face_index_region_at_boundary[b][
r][
e] =
452 <<
"adapt: Time for moving nodes etc. to actual mesh : "
461 std::stringstream error_message;
463 <<
"Lagrangian coordinates are currently not projected but are\n"
464 <<
"are re-set during adaptation. This is not appropriate for\n"
465 <<
"real solid mechanics problems!\n";
471 dynamic_cast<SolidMesh*
>(
this)->set_lagrangian_nodal_coordinates();
482 oomph_info <<
"Not enough benefit in adaptation.\n";