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";
109 cgal_params.enable_use_eulerian_coordinates_during_setup();
115 std::ostringstream error_message;
116 error_message <<
"Non-CGAL-based target size transfer not implemented.\n";
127 unsigned nelem = this->nelement();
128 for (
unsigned e = 0;
e <
nelem;
e++)
136 ->min_and_max_coordinates();
140 (min_and_max_coordinates[0].second - min_and_max_coordinates[0].first);
142 (min_and_max_coordinates[1].second - min_and_max_coordinates[1].first);
144 (min_and_max_coordinates[2].second - min_and_max_coordinates[2].first);
147 this->Gmsh_parameters_pt->dx_for_target_size_transfer();
157 std::string target_size_file_name =
158 this->Gmsh_parameters_pt->target_size_file_name();
163 << min_and_max_coordinates[1].first <<
" "
164 << min_and_max_coordinates[2].first <<
" " << std::endl;
170 this->Gmsh_parameters_pt->counter_for_filename_gmsh_size_transfer();
172 this->Gmsh_parameters_pt->stem_for_filename_gmsh_size_transfer();
182 <<
", K=" << nz + 1 << std::endl;
183 this->Gmsh_parameters_pt->counter_for_filename_gmsh_size_transfer()++;
187 for (
unsigned i = 0;
i <= nx;
i++)
189 x[0] = min_and_max_coordinates[0].first +
double(
i) *
dx;
190 for (
unsigned j = 0;
j <= ny;
j++)
192 x[1] = min_and_max_coordinates[1].first +
double(
j) *
dy;
193 for (
unsigned k = 0;
k <= nz;
k++)
195 x[2] = min_and_max_coordinates[2].first +
double(
k) *
dz;
202 this->Gmsh_parameters_pt
203 ->max_sample_points_for_limited_locate_zeta_during_target_size_transfer();
213 std::ostringstream error_message;
215 <<
"Non-CGAL-based target size transfer not implemented.\n";
227 std::stringstream error_message;
228 error_message <<
"Limited locate zeta failed for zeta = [ "
229 << x[0] <<
" " << x[1] <<
" " << x[2]
230 <<
" ]. Makes no sense!\n";
244 std::stringstream error_message;
246 <<
"Cast to FE for GeomObject returned by limited "
247 <<
"locate zeta failed for zeta = [ " << x[0] <<
" " << x[1]
248 <<
" " << x[2] <<
" ]. Makes no sense!\n";
290 this->Time_stepper_pt);
306 if (!this->Gmsh_parameters_pt->projection_is_disabled())
315 <<
"adapt: Time for project soln onto new mesh : "
324 for (
unsigned j =
nnod;
j > 0;
j--)
329 unsigned nel = nelement();
330 for (
unsigned e =
nel;
e > 0;
e--)
332 delete Element_pt[
e - 1];
333 Element_pt[
e - 1] = 0;
341 Element_pt.resize(
nel);
342 for (
unsigned j = 0;
j <
nnod;
j++)
346 for (
unsigned e = 0;
e <
nel;
e++)
353 Boundary_element_pt.resize(
nbound);
354 Face_index_at_boundary.resize(
nbound);
355 Boundary_node_pt.resize(
nbound);
356 for (
unsigned b = 0; b <
nbound; b++)
359 Boundary_element_pt[b].resize(
nel);
360 Face_index_at_boundary[b].resize(
nel);
361 for (
unsigned e = 0;
e <
nel;
e++)
363 Boundary_element_pt[b][
e] =
new_mesh_pt->boundary_element_pt(b,
e);
364 Face_index_at_boundary[b][
e] =
368 Boundary_node_pt[b].resize(
nnod);
369 for (
unsigned j = 0;
j <
nnod;
j++)
371 Boundary_node_pt[b][
j] =
new_mesh_pt->boundary_node_pt(b,
j);
382 this->Region_element_pt.resize(
n_region);
383 this->Region_attribute.resize(
n_region);
387 this->Region_attribute[
i] =
new_mesh_pt->region_attribute(
i);
390 unsigned r = this->Region_attribute[
i];
395 this->Region_element_pt[
i][
e] =
401 this->Boundary_region_element_pt.resize(
nbound);
402 this->Face_index_region_at_boundary.resize(
nbound);
405 for (
unsigned b = 0; b <
nbound; ++b)
410 unsigned r = this->Region_attribute[
i];
417 this->Boundary_region_element_pt[b][
r].resize(
419 this->Face_index_region_at_boundary[b][
r].resize(
425 this->Boundary_region_element_pt[b][
r][
e] =
427 this->Face_index_region_at_boundary[b][
r][
e] =
445 <<
"adapt: Time for moving nodes etc. to actual mesh : "
453 std::stringstream error_message;
455 <<
"Lagrangian coordinates are currently not projected but are\n"
456 <<
"are re-set during adaptation. This is not appropriate for\n"
457 <<
"real solid mechanics problems!\n";
463 dynamic_cast<SolidMesh*
>(
this)->set_lagrangian_nodal_coordinates();
474 oomph_info <<
"Not enough benefit in adaptation.\n";