From fe40b0b73fd449f9fc1000bd9070ef32b04197e0 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Fri, 15 Mar 2024 16:42:59 -0400 Subject: [PATCH 1/5] Improve heat flux map postprocessor --- doc/modules/changes/20240315_gassmoeller2 | 8 +++ .../aspect/postprocess/dynamic_topography.h | 3 +- include/aspect/postprocess/heat_flux_map.h | 7 +++ source/postprocess/dynamic_topography.cc | 17 ++--- source/postprocess/heat_flux_map.cc | 63 ++++++++++--------- tests/heat_flux_map/heat_flux.00000 | 33 ---------- tests/heat_flux_map/heat_flux.00001 | 33 ---------- tests/heat_flux_map/heat_flux_bottom.00000 | 17 +++++ tests/heat_flux_map/heat_flux_bottom.00001 | 17 +++++ tests/heat_flux_map/heat_flux_top.00000 | 17 +++++ tests/heat_flux_map/heat_flux_top.00001 | 17 +++++ 11 files changed, 127 insertions(+), 105 deletions(-) create mode 100644 doc/modules/changes/20240315_gassmoeller2 delete mode 100644 tests/heat_flux_map/heat_flux.00000 delete mode 100644 tests/heat_flux_map/heat_flux.00001 create mode 100644 tests/heat_flux_map/heat_flux_bottom.00000 create mode 100644 tests/heat_flux_map/heat_flux_bottom.00001 create mode 100644 tests/heat_flux_map/heat_flux_top.00000 create mode 100644 tests/heat_flux_map/heat_flux_top.00001 diff --git a/doc/modules/changes/20240315_gassmoeller2 b/doc/modules/changes/20240315_gassmoeller2 new file mode 100644 index 00000000000..f0e4ff86d8b --- /dev/null +++ b/doc/modules/changes/20240315_gassmoeller2 @@ -0,0 +1,8 @@ +Changed: The postprocessor 'heat flux map' now outputs the heat flux values in +the same format as the 'dynamic topography' postprocessor does for dynamic +topography. This in particular means instead of writing all values into a +single file 'heat flux map' now writes one file per boundary. Both +postprocessors now take care to not include spaces in the data file +headers so that separating the header columns by spaces works correctly. +
+ (Rene Gassmoeller, 2024/03/15) diff --git a/include/aspect/postprocess/dynamic_topography.h b/include/aspect/postprocess/dynamic_topography.h index 26c371c8456..985e1c1eec9 100644 --- a/include/aspect/postprocess/dynamic_topography.h +++ b/include/aspect/postprocess/dynamic_topography.h @@ -88,7 +88,8 @@ namespace aspect * Output the dynamic topography solution to * a file. */ - void output_to_file(bool upper, std::vector, double>> &values); + void output_to_file(const types::boundary_id boundary_id, + const std::vector, double>> &values); /** * A vector which stores the surface stress values calculated diff --git a/include/aspect/postprocess/heat_flux_map.h b/include/aspect/postprocess/heat_flux_map.h index 3f30a81be34..a41a9841c22 100644 --- a/include/aspect/postprocess/heat_flux_map.h +++ b/include/aspect/postprocess/heat_flux_map.h @@ -88,6 +88,13 @@ namespace aspect */ std::pair execute (TableHandler &statistics) override; + + private: + /** + * Output the heat flux density to a file. + */ + void output_to_file(const types::boundary_id boundary_id, + const std::vector>> &heat_flux_and_area); }; } } diff --git a/source/postprocess/dynamic_topography.cc b/source/postprocess/dynamic_topography.cc index f7f3f852cf0..d6d0a1b2258 100644 --- a/source/postprocess/dynamic_topography.cc +++ b/source/postprocess/dynamic_topography.cc @@ -365,9 +365,9 @@ namespace aspect // Possibly output the result to file. if (output_surface) - output_to_file(true, stored_values_surface); + output_to_file(top_boundary_id, stored_values_surface); if (output_bottom) - output_to_file(false, stored_values_bottom); + output_to_file(bottom_boundary_id, stored_values_bottom); return std::pair("Computing dynamic topography", ""); } @@ -411,10 +411,13 @@ namespace aspect */ template void - DynamicTopography::output_to_file(const bool upper, - std::vector, - double>> &stored_values) + DynamicTopography::output_to_file(const types::boundary_id boundary_id, + const std::vector,double>> &stored_values) { + // get boundary name and avoid spaces for file output + std::string boundary_name = this->get_geometry_model().translate_id_to_symbol_name(boundary_id); + std::replace(boundary_name.begin(), boundary_name.end(), ' ', '_'); + std::ostringstream output; // On processor 0, write header lines @@ -422,7 +425,7 @@ namespace aspect { output << "# " << ((dim==2)? "x y " : "x y z ") - << (upper ? "surface topography" : "bottom topography") << std::endl; + << " heat_flux_" << boundary_name << std::endl; } for (unsigned int i=0; iget_output_directory() + - (upper ? "dynamic_topography_surface." : "dynamic_topography_bottom.") + + "dynamic_topography_" + boundary_name + "." + Utilities::int_to_string(this->get_timestep_number(), 5); if (this->get_parameters().run_postprocessors_on_nonlinear_iterations) filename.append("." + Utilities::int_to_string (this->get_nonlinear_iteration(), 4)); diff --git a/source/postprocess/heat_flux_map.cc b/source/postprocess/heat_flux_map.cc index d37b9d0a5a2..89cb6338163 100644 --- a/source/postprocess/heat_flux_map.cc +++ b/source/postprocess/heat_flux_map.cc @@ -460,8 +460,28 @@ namespace aspect std::vector>> heat_flux_and_area = internal::compute_heat_flux_through_boundary_faces (*this); - // have a stream into which we write the data. the text stream is then - // later sent to processor 0 + const auto boundary_ids = this->get_geometry_model().get_used_boundary_indicators(); + for (const auto &boundary_id: boundary_ids) + if (this->get_geometry_model().translate_id_to_symbol_name(boundary_id) == "top" || + this->get_geometry_model().translate_id_to_symbol_name(boundary_id) == "bottom") + output_to_file(boundary_id, heat_flux_and_area); + + const std::string placeholder_name = this->get_output_directory() + "heat_flux." + Utilities::int_to_string(this->get_timestep_number(), 5); + return std::pair("Writing heat flux map", + placeholder_name); + } + + + + template + void + HeatFluxMap::output_to_file(const types::boundary_id boundary_id, + const std::vector>> &heat_flux_and_area) + { + // get boundary name and avoid spaces for file output + std::string boundary_name = this->get_geometry_model().translate_id_to_symbol_name(boundary_id); + std::replace(boundary_name.begin(), boundary_name.end(), ' ', '_'); + std::ostringstream output; // write the file header. note that we only do so on processor 0 @@ -469,21 +489,14 @@ namespace aspect { output << "# " << ((dim==2)? "x y" : "x y z") - << " heat flux" << std::endl; + << " heat_flux_" << boundary_name << std::endl; } - std::vector,double>> stored_values; - - // loop over all of the surface cells and evaluate the heat flux - const types::boundary_id top_boundary_id = this->get_geometry_model().translate_symbolic_boundary_name_to_id("top"); - const types::boundary_id bottom_boundary_id = this->get_geometry_model().translate_symbolic_boundary_name_to_id("bottom"); - for (const auto &cell : this->get_dof_handler().active_cell_iterators()) if (cell->is_locally_owned()) - for (const unsigned int f : cell->face_indices()) + for (const unsigned int f: cell->face_indices()) if (cell->at_boundary(f) && - (cell->face(f)->boundary_id() == top_boundary_id || - cell->face(f)->boundary_id() == bottom_boundary_id)) + (cell->face(f)->boundary_id() == boundary_id)) { // evaluate position of heat flow to write into output file const bool respect_manifold = true; @@ -492,33 +505,21 @@ namespace aspect const double flux_density = heat_flux_and_area[cell->active_cell_index()][f].first / heat_flux_and_area[cell->active_cell_index()][f].second; - // store final position and heat flow - stored_values.emplace_back (midpoint_at_surface, flux_density); + output << std::setprecision(10) + << midpoint_at_surface + << ' ' + << std::setprecision(10) + << flux_density + << std::endl; } - - // Write the solution to an output stream - for (unsigned int i=0; iget_output_directory() + - "heat_flux." + + "heat_flux_" + boundary_name + "." + Utilities::int_to_string(this->get_timestep_number(), 5); if (this->get_parameters().run_postprocessors_on_nonlinear_iterations) filename.append("." + Utilities::int_to_string (this->get_nonlinear_iteration(), 4)); - Utilities::collect_and_write_file_content(filename, output.str(), this->get_mpi_communicator()); - - return std::pair("Writing heat flux map:", - filename); } } } diff --git a/tests/heat_flux_map/heat_flux.00000 b/tests/heat_flux_map/heat_flux.00000 deleted file mode 100644 index d2c844951a7..00000000000 --- a/tests/heat_flux_map/heat_flux.00000 +++ /dev/null @@ -1,33 +0,0 @@ -# x y heat flux -0.03125 0 -1.03122 -0.09375 0 -1.03002 -0.15625 0 -1.02767 -0.21875 0 -1.02425 -0.28125 0 -1.0199 -0.34375 0 -1.01479 -0.40625 0 -1.00911 -0.46875 0 -1.00308 -0.53125 0 -0.996926 -0.59375 0 -0.990894 -0.65625 0 -0.985213 -0.71875 0 -0.9801 -0.78125 0 -0.975751 -0.84375 0 -0.972335 -0.90625 0 -0.969981 -0.96875 0 -0.968782 -0.03125 1 0.968782 -0.09375 1 0.969981 -0.15625 1 0.972335 -0.21875 1 0.975751 -0.28125 1 0.9801 -0.34375 1 0.985213 -0.40625 1 0.990894 -0.46875 1 0.996926 -0.53125 1 1.00308 -0.59375 1 1.00911 -0.65625 1 1.01479 -0.71875 1 1.0199 -0.78125 1 1.02425 -0.84375 1 1.02767 -0.90625 1 1.03002 -0.96875 1 1.03122 diff --git a/tests/heat_flux_map/heat_flux.00001 b/tests/heat_flux_map/heat_flux.00001 deleted file mode 100644 index ba675c7d5eb..00000000000 --- a/tests/heat_flux_map/heat_flux.00001 +++ /dev/null @@ -1,33 +0,0 @@ -# x y heat flux -0.03125 0 -1.09756 -0.09375 0 -1.09401 -0.15625 0 -1.08705 -0.21875 0 -1.07695 -0.28125 0 -1.0641 -0.34375 0 -1.04899 -0.40625 0 -1.0322 -0.46875 0 -1.01438 -0.53125 0 -0.996205 -0.59375 0 -0.97838 -0.65625 0 -0.961589 -0.71875 0 -0.946476 -0.78125 0 -0.933624 -0.84375 0 -0.923525 -0.90625 0 -0.916568 -0.96875 0 -0.913021 -0.03125 1 0.913019 -0.09375 1 0.916566 -0.15625 1 0.923523 -0.21875 1 0.933623 -0.28125 1 0.946476 -0.34375 1 0.961589 -0.40625 1 0.978382 -0.46875 1 0.996207 -0.53125 1 1.01438 -0.59375 1 1.03221 -0.65625 1 1.04899 -0.71875 1 1.0641 -0.78125 1 1.07696 -0.84375 1 1.08705 -0.90625 1 1.09401 -0.96875 1 1.09755 diff --git a/tests/heat_flux_map/heat_flux_bottom.00000 b/tests/heat_flux_map/heat_flux_bottom.00000 new file mode 100644 index 00000000000..aa2a0ada265 --- /dev/null +++ b/tests/heat_flux_map/heat_flux_bottom.00000 @@ -0,0 +1,17 @@ +# x y heat_flux_bottom +0.03125 0 -1.031219413 +0.09375 0 -1.030019657 +0.15625 0 -1.027666329 +0.21875 0 -1.02424981 +0.28125 0 -1.019901382 +0.34375 0 -1.014788196 +0.40625 0 -1.009106697 +0.46875 0 -1.003075282 +0.53125 0 -0.9969256834 +0.59375 0 -0.9908942621 +0.65625 0 -0.9852127746 +0.71875 0 -0.980099588 +0.78125 0 -0.9757511684 +0.84375 0 -0.9723346365 +0.90625 0 -0.969981294 +0.96875 0 -0.9687815895 diff --git a/tests/heat_flux_map/heat_flux_bottom.00001 b/tests/heat_flux_map/heat_flux_bottom.00001 new file mode 100644 index 00000000000..db5fbd4cd96 --- /dev/null +++ b/tests/heat_flux_map/heat_flux_bottom.00001 @@ -0,0 +1,17 @@ +# x y heat_flux_bottom +0.03125 0 -1.097556072 +0.09375 0 -1.094008828 +0.15625 0 -1.087052674 +0.21875 0 -1.076954801 +0.28125 0 -1.06410359 +0.34375 0 -1.0489928 +0.40625 0 -1.032203083 +0.46875 0 -1.014378599 +0.53125 0 -0.9962046174 +0.59375 0 -0.9783795828 +0.65625 0 -0.9615885179 +0.71875 0 -0.9464761349 +0.78125 0 -0.9336236681 +0.84375 0 -0.9235247144 +0.90625 0 -0.9165683251 +0.96875 0 -0.9130213683 diff --git a/tests/heat_flux_map/heat_flux_top.00000 b/tests/heat_flux_map/heat_flux_top.00000 new file mode 100644 index 00000000000..7d2613648cd --- /dev/null +++ b/tests/heat_flux_map/heat_flux_top.00000 @@ -0,0 +1,17 @@ +# x y heat_flux_top +0.03125 1 0.9687815666 +0.09375 1 0.9699812823 +0.15625 1 0.972334631 +0.21875 1 0.9757511565 +0.28125 1 0.9800995796 +0.34375 1 0.9852127739 +0.40625 1 0.9908942605 +0.46875 1 0.9969256895 +0.53125 1 1.003075274 +0.59375 1 1.0091067 +0.65625 1 1.01478819 +0.71875 1 1.019901388 +0.78125 1 1.024249804 +0.84375 1 1.027666334 +0.90625 1 1.03001968 +0.96875 1 1.031219399 diff --git a/tests/heat_flux_map/heat_flux_top.00001 b/tests/heat_flux_map/heat_flux_top.00001 new file mode 100644 index 00000000000..aa790953e9f --- /dev/null +++ b/tests/heat_flux_map/heat_flux_top.00001 @@ -0,0 +1,17 @@ +# x y heat_flux_top +0.03125 1 0.9130193913 +0.09375 1 0.9165662341 +0.15625 1 0.9235233186 +0.21875 1 0.9336228139 +0.28125 1 0.9464761816 +0.34375 1 0.9615893582 +0.40625 1 0.9783815702 +0.46875 1 0.9962071402 +0.53125 1 1.014381062 +0.59375 1 1.032205352 +0.65625 1 1.048994986 +0.71875 1 1.064104934 +0.78125 1 1.076955069 +0.84375 1 1.087051735 +0.90625 1 1.094006571 +0.96875 1 1.097552107 From c3ed0e5ce8338ce4424e9bd1aeeffd14c1c30124 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Mon, 18 Mar 2024 09:36:57 -0400 Subject: [PATCH 2/5] Fix field name and output filename --- source/postprocess/dynamic_topography.cc | 2 +- source/postprocess/heat_flux_map.cc | 5 ++++- .../dynamic_topography_bottom.00000 | 18 ++++++++--------- .../dynamic_topography_bottom.00000 | 2 +- .../dynamic_topography_bottom.00000 | 4 ++-- .../dynamic_topography_bottom.00000 | 18 ++++++++--------- .../dynamic_topography_bottom.00000 | 18 ++++++++--------- tests/geoid/dynamic_topography_bottom.00000 | 20 +++++++++---------- .../dynamic_topography_bottom.00000 | 2 +- .../dynamic_topography_bottom.00001 | 2 +- 10 files changed, 47 insertions(+), 44 deletions(-) diff --git a/source/postprocess/dynamic_topography.cc b/source/postprocess/dynamic_topography.cc index d6d0a1b2258..1dd1bb9ee9b 100644 --- a/source/postprocess/dynamic_topography.cc +++ b/source/postprocess/dynamic_topography.cc @@ -425,7 +425,7 @@ namespace aspect { output << "# " << ((dim==2)? "x y " : "x y z ") - << " heat_flux_" << boundary_name << std::endl; + << "dynamic_topography_" << boundary_name << std::endl; } for (unsigned int i=0; iget_geometry_model().translate_id_to_symbol_name(boundary_id) == "bottom") output_to_file(boundary_id, heat_flux_and_area); - const std::string placeholder_name = this->get_output_directory() + "heat_flux." + Utilities::int_to_string(this->get_timestep_number(), 5); + std::string placeholder_name = this->get_output_directory() + "heat_flux." + Utilities::int_to_string(this->get_timestep_number(), 5); + if (this->get_parameters().run_postprocessors_on_nonlinear_iterations) + placeholder_name.append("." + Utilities::int_to_string (this->get_nonlinear_iteration(), 4)); + return std::pair("Writing heat flux map", placeholder_name); } diff --git a/tests/dynamic_topography/dynamic_topography_bottom.00000 b/tests/dynamic_topography/dynamic_topography_bottom.00000 index 863eeac5bdc..ce4a39a5578 100644 --- a/tests/dynamic_topography/dynamic_topography_bottom.00000 +++ b/tests/dynamic_topography/dynamic_topography_bottom.00000 @@ -1,9 +1,9 @@ -# x y bottom topography -112500 0 -20.35932195 -337500 0 -22.5880606 -562500 0 -13.12252722 -787500 0 55.68976695 -1012500 0 55.68976696 -1237500 0 -13.12252721 -1462500 0 -22.58806058 -1687500 0 -20.35932193 +# x y dynamic_topography_bottom +112500 0 -20.35932198 +337500 0 -22.58806059 +562500 0 -13.12252715 +787500 0 55.68976686 +1012500 0 55.68976686 +1237500 0 -13.12252713 +1462500 0 -22.58806056 +1687500 0 -20.35932195 diff --git a/tests/dynamic_topography2/dynamic_topography_bottom.00000 b/tests/dynamic_topography2/dynamic_topography_bottom.00000 index 7ef3efad971..b8ceb565978 100644 --- a/tests/dynamic_topography2/dynamic_topography_bottom.00000 +++ b/tests/dynamic_topography2/dynamic_topography_bottom.00000 @@ -1,4 +1,4 @@ -# x y bottom topography +# x y dynamic_topography_bottom 112500 0 -0.691340274 337500 0 -0.4081226042 562500 0 0.2240167169 diff --git a/tests/dynamic_topography3/dynamic_topography_bottom.00000 b/tests/dynamic_topography3/dynamic_topography_bottom.00000 index 5e6e0915c31..673bb365967 100644 --- a/tests/dynamic_topography3/dynamic_topography_bottom.00000 +++ b/tests/dynamic_topography3/dynamic_topography_bottom.00000 @@ -1,4 +1,4 @@ -# x y z bottom topography +# x y z dynamic_topography_bottom -1265819.559 -3241620.096 2.084595482e-11 -109.9679245 -2324756.457 -2324756.457 1140795.701 -1130.427916 -2324756.457 -2324756.457 -1140795.701 -1130.428354 @@ -28,7 +28,7 @@ 2324756.457 2324756.457 1140795.701 -1130.428763 1265819.559 3241620.096 -1.518641958e-11 -109.9683258 2324756.457 -1140795.701 -2324756.457 -922.8374217 -1265819.559 2.261096449e-11 -3241620.096 12.95300895 +1265819.559 2.261096449e-11 -3241620.096 12.95300896 3241620.096 -2.335326054e-10 -1265819.559 172.706491 2324756.457 1140795.701 -2324756.457 -922.8423924 -1.131907049e-11 1265819.559 -3241620.096 -232.9154335 diff --git a/tests/dynamic_topography_back/dynamic_topography_bottom.00000 b/tests/dynamic_topography_back/dynamic_topography_bottom.00000 index 863eeac5bdc..ce4a39a5578 100644 --- a/tests/dynamic_topography_back/dynamic_topography_bottom.00000 +++ b/tests/dynamic_topography_back/dynamic_topography_bottom.00000 @@ -1,9 +1,9 @@ -# x y bottom topography -112500 0 -20.35932195 -337500 0 -22.5880606 -562500 0 -13.12252722 -787500 0 55.68976695 -1012500 0 55.68976696 -1237500 0 -13.12252721 -1462500 0 -22.58806058 -1687500 0 -20.35932193 +# x y dynamic_topography_bottom +112500 0 -20.35932198 +337500 0 -22.58806059 +562500 0 -13.12252715 +787500 0 55.68976686 +1012500 0 55.68976686 +1237500 0 -13.12252713 +1462500 0 -22.58806056 +1687500 0 -20.35932195 diff --git a/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_bottom.00000 b/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_bottom.00000 index 863eeac5bdc..ce4a39a5578 100644 --- a/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_bottom.00000 +++ b/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_bottom.00000 @@ -1,9 +1,9 @@ -# x y bottom topography -112500 0 -20.35932195 -337500 0 -22.5880606 -562500 0 -13.12252722 -787500 0 55.68976695 -1012500 0 55.68976696 -1237500 0 -13.12252721 -1462500 0 -22.58806058 -1687500 0 -20.35932193 +# x y dynamic_topography_bottom +112500 0 -20.35932198 +337500 0 -22.58806059 +562500 0 -13.12252715 +787500 0 55.68976686 +1012500 0 55.68976686 +1237500 0 -13.12252713 +1462500 0 -22.58806056 +1687500 0 -20.35932195 diff --git a/tests/geoid/dynamic_topography_bottom.00000 b/tests/geoid/dynamic_topography_bottom.00000 index 67cf7917ec7..a16025b1171 100644 --- a/tests/geoid/dynamic_topography_bottom.00000 +++ b/tests/geoid/dynamic_topography_bottom.00000 @@ -1,4 +1,4 @@ -# x y z bottom topography +# x y z dynamic_topography_bottom -35498.28088 -196824.4702 -2.76471554e-13 -64957.61326 -70785.07178 -184010.7447 33608.32387 -57553.88554 -70785.07178 -184010.7447 -33608.32387 -57553.88558 @@ -21,10 +21,10 @@ -139384.3779 -33822.9268 139384.3779 17280.58779 -70785.07178 -33608.32387 184010.7447 46185.62438 -35498.28088 2.394570686e-12 196824.4702 53281.72759 --109044.9905 8.994181261e-12 167657.9555 36339.18081 --70785.07178 33608.32387 184010.7447 46185.62439 +-109044.9905 1.06639181e-11 167657.9555 36339.18081 +-70785.07178 33608.32387 184010.7447 46185.62438 -184010.7447 -33608.32387 70785.07178 -34581.30002 --167657.9555 2.303524681e-11 109044.9905 -5575.059541 +-167657.9555 2.422576705e-11 109044.9905 -5575.059541 -196824.4702 -6.462091252e-12 35498.28088 -55980.07258 -184010.7447 33608.32387 70785.07178 -34581.30001 -139384.3779 33822.9268 139384.3779 17280.58779 @@ -34,7 +34,7 @@ 1.139428721e-12 -196824.4702 35498.28088 -55980.07254 33608.32387 -184010.7447 70785.07178 -34581.30002 -33608.32387 -184010.7447 70785.07178 -34581.29998 -1.755052267e-13 -167657.9555 109044.9905 -5575.05953 +-1.124859754e-13 -167657.9555 109044.9905 -5575.05953 65351.59161 -159554.7203 101348.2151 -11312.54113 93118.40502 -125157.8257 125157.8257 7074.749569 33822.9268 -139384.3779 139384.3779 17280.58781 @@ -66,7 +66,7 @@ 196824.4702 1.139428721e-12 35498.28088 -55980.07262 184010.7447 33608.32387 70785.07178 -34581.30005 184010.7447 -33608.32387 70785.07178 -34581.30004 -167657.9555 1.755052267e-13 109044.9905 -5575.059573 +167657.9555 -1.124859754e-13 109044.9905 -5575.059573 159554.7203 65351.59161 101348.2151 -11312.54113 125157.8257 93118.40502 125157.8257 7074.749563 139384.3779 33822.9268 139384.3779 17280.58778 @@ -117,10 +117,10 @@ 139384.3779 -33822.9268 -139384.3779 17280.58779 70785.07178 -33608.32387 -184010.7447 46185.62438 35498.28088 -5.604965797e-12 -196824.4702 53281.72758 -109044.9905 -2.700687402e-13 -167657.9555 36339.18079 +109044.9905 -2.096944977e-13 -167657.9555 36339.18079 70785.07178 33608.32387 -184010.7447 46185.62438 184010.7447 -33608.32387 -70785.07178 -34581.30002 -167657.9555 3.016508524e-11 -109044.9905 -5575.059554 +167657.9555 3.006269439e-11 -109044.9905 -5575.059554 196824.4702 5.258792963e-14 -35498.28088 -55980.07261 184010.7447 33608.32387 -70785.07178 -34581.30003 139384.3779 33822.9268 -139384.3779 17280.58778 @@ -130,7 +130,7 @@ -2.253997394e-13 35498.28088 -196824.4702 53281.72758 -33608.32387 70785.07178 -184010.7447 46185.62437 33608.32387 70785.07178 -184010.7447 46185.62438 --2.264523378e-12 109044.9905 -167657.9555 36339.1808 +-2.6687275e-12 109044.9905 -167657.9555 36339.1808 -65351.59161 101348.2151 -159554.7203 31212.29529 -93118.40502 125157.8257 -125157.8257 7074.749542 -33822.9268 139384.3779 -139384.3779 17280.58778 @@ -162,7 +162,7 @@ -35498.28088 1.269621957e-12 -196824.4702 53281.72758 -70785.07178 -33608.32387 -184010.7447 46185.62437 -70785.07178 33608.32387 -184010.7447 46185.62438 --109044.9905 1.048488242e-12 -167657.9555 36339.1808 +-109044.9905 5.609360777e-13 -167657.9555 36339.1808 -101348.2151 -65351.59161 -159554.7203 31212.29529 -125157.8257 -93118.40502 -125157.8257 7074.749548 -139384.3779 -33822.9268 -139384.3779 17280.58776 diff --git a/tests/geoid_freesurface/dynamic_topography_bottom.00000 b/tests/geoid_freesurface/dynamic_topography_bottom.00000 index d91acd0c23e..c0a6fc67733 100644 --- a/tests/geoid_freesurface/dynamic_topography_bottom.00000 +++ b/tests/geoid_freesurface/dynamic_topography_bottom.00000 @@ -1,4 +1,4 @@ -# x y z bottom topography +# x y z dynamic_topography_bottom -72748.2505 -186300.0055 -6.071532065e-13 -125368.9384 -133606.6929 -133606.6929 65562.97133 -78544.77983 -133606.6929 -133606.6929 -65562.97133 -78544.7797 diff --git a/tests/geoid_freesurface/dynamic_topography_bottom.00001 b/tests/geoid_freesurface/dynamic_topography_bottom.00001 index d74957b60b8..046910599a2 100644 --- a/tests/geoid_freesurface/dynamic_topography_bottom.00001 +++ b/tests/geoid_freesurface/dynamic_topography_bottom.00001 @@ -1,4 +1,4 @@ -# x y z bottom topography +# x y z dynamic_topography_bottom -72748.2505 -186300.0055 -6.071532065e-13 -27844.41685 -133606.6929 -133606.6929 65562.97133 -18750.10657 -133606.6929 -133606.6929 -65562.97133 -18750.10629 From e8d149dde94eff87e583852ee361684146d212e3 Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Mon, 18 Mar 2024 13:32:21 -0400 Subject: [PATCH 3/5] Update test results --- ...ace.00000 => dynamic_topography_top.00000} | 2 +- ...ace.00000 => dynamic_topography_top.00000} | 2 +- ...ace.00000 => dynamic_topography_top.00000} | 4 ++-- .../dynamic_topography_top.00000} | 2 +- .../dynamic_topography_top.00000} | 2 +- ...ace.00000 => dynamic_topography_top.00000} | 20 +++++++++---------- ...ace.00000 => dynamic_topography_top.00000} | 10 +++++----- ...ace.00001 => dynamic_topography_top.00001} | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) rename tests/dynamic_topography/{dynamic_topography_surface.00000 => dynamic_topography_top.00000} (88%) rename tests/dynamic_topography2/{dynamic_topography_surface.00000 => dynamic_topography_top.00000} (88%) rename tests/dynamic_topography3/{dynamic_topography_surface.00000 => dynamic_topography_top.00000} (96%) rename tests/{dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_surface.00000 => dynamic_topography_back/dynamic_topography_top.00000} (88%) rename tests/{dynamic_topography_back/dynamic_topography_surface.00000 => dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_top.00000} (88%) rename tests/geoid/{dynamic_topography_surface.00000 => dynamic_topography_top.00000} (94%) rename tests/geoid_freesurface/{dynamic_topography_surface.00000 => dynamic_topography_top.00000} (90%) rename tests/geoid_freesurface/{dynamic_topography_surface.00001 => dynamic_topography_top.00001} (94%) diff --git a/tests/dynamic_topography/dynamic_topography_surface.00000 b/tests/dynamic_topography/dynamic_topography_top.00000 similarity index 88% rename from tests/dynamic_topography/dynamic_topography_surface.00000 rename to tests/dynamic_topography/dynamic_topography_top.00000 index 095a1226983..f5fbabe48bd 100644 --- a/tests/dynamic_topography/dynamic_topography_surface.00000 +++ b/tests/dynamic_topography/dynamic_topography_top.00000 @@ -1,4 +1,4 @@ -# x y surface topography +# x y dynamic_topography_top 112500 700000 -37.56967558 337500 700000 -37.24917518 562500 700000 0.09274690416 diff --git a/tests/dynamic_topography2/dynamic_topography_surface.00000 b/tests/dynamic_topography2/dynamic_topography_top.00000 similarity index 88% rename from tests/dynamic_topography2/dynamic_topography_surface.00000 rename to tests/dynamic_topography2/dynamic_topography_top.00000 index 441f8b21822..4390a6c4d2f 100644 --- a/tests/dynamic_topography2/dynamic_topography_surface.00000 +++ b/tests/dynamic_topography2/dynamic_topography_top.00000 @@ -1,4 +1,4 @@ -# x y surface topography +# x y dynamic_topography_top 112500 700000 -219.5206365 337500 700000 -214.9051988 562500 700000 -294.199505 diff --git a/tests/dynamic_topography3/dynamic_topography_surface.00000 b/tests/dynamic_topography3/dynamic_topography_top.00000 similarity index 96% rename from tests/dynamic_topography3/dynamic_topography_surface.00000 rename to tests/dynamic_topography3/dynamic_topography_top.00000 index d243ebdfd25..7ec6435e87d 100644 --- a/tests/dynamic_topography3/dynamic_topography_surface.00000 +++ b/tests/dynamic_topography3/dynamic_topography_top.00000 @@ -1,4 +1,4 @@ -# x y z surface topography +# x y z dynamic_topography_top -2304664.576 -5901984.174 -1.717376213e-13 81.6990232 -4232660.032 -4232660.032 2077034.932 -64.39460075 -4232660.032 -4232660.032 -2077034.932 -64.39308593 @@ -38,7 +38,7 @@ -4232660.032 4232660.032 -2077034.932 -64.39260648 -5901984.174 2304664.576 -1.984763256e-10 81.69886784 -2304664.576 5901984.174 -1.976176375e-10 81.69907751 --4232660.032 4232660.032 2077034.932 -64.3942961 +-4232660.032 4232660.032 2077034.932 -64.39429609 -2304664.576 3.743880144e-11 -5901984.174 -158.7562861 -4232660.032 -2077034.932 -4232660.032 -469.4021192 -4232660.032 2077034.932 -4232660.032 -469.4152887 diff --git a/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_surface.00000 b/tests/dynamic_topography_back/dynamic_topography_top.00000 similarity index 88% rename from tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_surface.00000 rename to tests/dynamic_topography_back/dynamic_topography_top.00000 index 095a1226983..f5fbabe48bd 100644 --- a/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_surface.00000 +++ b/tests/dynamic_topography_back/dynamic_topography_top.00000 @@ -1,4 +1,4 @@ -# x y surface topography +# x y dynamic_topography_top 112500 700000 -37.56967558 337500 700000 -37.24917518 562500 700000 0.09274690416 diff --git a/tests/dynamic_topography_back/dynamic_topography_surface.00000 b/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_top.00000 similarity index 88% rename from tests/dynamic_topography_back/dynamic_topography_surface.00000 rename to tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_top.00000 index 095a1226983..f5fbabe48bd 100644 --- a/tests/dynamic_topography_back/dynamic_topography_surface.00000 +++ b/tests/dynamic_topography_vs_surface_dynamic_topography/dynamic_topography_top.00000 @@ -1,4 +1,4 @@ -# x y surface topography +# x y dynamic_topography_top 112500 700000 -37.56967558 337500 700000 -37.24917518 562500 700000 0.09274690416 diff --git a/tests/geoid/dynamic_topography_surface.00000 b/tests/geoid/dynamic_topography_top.00000 similarity index 94% rename from tests/geoid/dynamic_topography_surface.00000 rename to tests/geoid/dynamic_topography_top.00000 index b0554e1e1f7..5d170415a2f 100644 --- a/tests/geoid/dynamic_topography_surface.00000 +++ b/tests/geoid/dynamic_topography_top.00000 @@ -1,4 +1,4 @@ -# x y z surface topography +# x y z dynamic_topography_top -70996.56175 -393648.9403 -5.529431079e-13 -20863.6356 -141570.1436 -368021.4895 67216.64773 -19513.60496 -141570.1436 -368021.4895 -67216.64773 -19513.60497 @@ -21,10 +21,10 @@ -278768.7559 -67645.8536 278768.7559 15469.40935 -141570.1436 -67216.64773 368021.4895 81761.76496 -70996.56175 4.789141372e-12 393648.9403 127666.7038 --218089.981 1.798836252e-11 335315.911 47516.11947 +-218089.981 2.132783621e-11 335315.911 47516.11947 -141570.1436 67216.64773 368021.4895 81761.76495 -368021.4895 -67216.64773 141570.1436 -13939.58994 --335315.911 4.607049362e-11 218089.981 -2314.15282 +-335315.911 4.845153409e-11 218089.981 -2314.15282 -393648.9403 -1.29241825e-11 70996.56175 -19147.26497 -368021.4895 67216.64773 141570.1436 -13939.58996 -278768.7559 67645.8536 278768.7559 15469.40934 @@ -34,7 +34,7 @@ 2.278857441e-12 -393648.9403 70996.56175 -19147.26496 67216.64773 -368021.4895 141570.1436 -13939.58995 -67216.64773 -368021.4895 141570.1436 -13939.58996 -3.510104533e-13 -335315.911 218089.981 -2314.152841 +-2.249719508e-13 -335315.911 218089.981 -2314.152841 130703.1832 -319109.4406 202696.4302 -5254.709702 186236.81 -250315.6513 250315.6513 5895.102703 67645.8536 -278768.7559 278768.7559 15469.40934 @@ -66,7 +66,7 @@ 393648.9403 2.278857441e-12 70996.56175 -19147.26496 368021.4895 67216.64773 141570.1436 -13939.58994 368021.4895 -67216.64773 141570.1436 -13939.58995 -335315.911 3.510104533e-13 218089.981 -2314.152817 +335315.911 -2.249719508e-13 218089.981 -2314.152817 319109.4406 130703.1832 202696.4302 -5254.709685 250315.6513 186236.81 250315.6513 5895.102734 278768.7559 67645.8536 278768.7559 15469.40935 @@ -117,10 +117,10 @@ 278768.7559 -67645.8536 -278768.7559 15469.40935 141570.1436 -67216.64773 -368021.4895 81761.765 70996.56175 -1.120993159e-11 -393648.9403 127666.7039 -218089.981 -5.401374804e-13 -335315.911 47516.11947 +218089.981 -4.193889954e-13 -335315.911 47516.11947 141570.1436 67216.64773 -368021.4895 81761.76495 368021.4895 -67216.64773 -141570.1436 -13939.58996 -335315.911 6.033017049e-11 -218089.981 -2314.152825 +335315.911 6.012538878e-11 -218089.981 -2314.152825 393648.9403 1.051758593e-13 -70996.56175 -19147.26497 368021.4895 67216.64773 -141570.1436 -13939.58995 278768.7559 67645.8536 -278768.7559 15469.40934 @@ -130,7 +130,7 @@ -4.507994787e-13 70996.56175 -393648.9403 127666.7039 -67216.64773 141570.1436 -368021.4895 81761.76498 67216.64773 141570.1436 -368021.4895 81761.76497 --4.529046756e-12 218089.981 -335315.911 47516.11948 +-5.337455001e-12 218089.981 -335315.911 47516.11948 -130703.1832 202696.4302 -319109.4406 35791.57397 -186236.81 250315.6513 -250315.6513 5895.102728 -67645.8536 278768.7559 -278768.7559 15469.40937 @@ -158,11 +158,11 @@ -278768.7559 278768.7559 67645.8536 -19438.8313 -319109.4406 202696.4302 130703.1832 -15438.72092 -202696.4302 319109.4406 130703.1832 -15438.7209 --250315.6513 250315.6513 186236.81 -8903.661739 +-250315.6513 250315.6513 186236.81 -8903.661738 -70996.56175 2.539243913e-12 -393648.9403 127666.7039 -141570.1436 -67216.64773 -368021.4895 81761.76499 -141570.1436 67216.64773 -368021.4895 81761.76499 --218089.981 2.096976484e-12 -335315.911 47516.11948 +-218089.981 1.121872155e-12 -335315.911 47516.11948 -202696.4302 -130703.1832 -319109.4406 35791.57396 -250315.6513 -186236.81 -250315.6513 5895.102714 -278768.7559 -67645.8536 -278768.7559 15469.40936 diff --git a/tests/geoid_freesurface/dynamic_topography_surface.00000 b/tests/geoid_freesurface/dynamic_topography_top.00000 similarity index 90% rename from tests/geoid_freesurface/dynamic_topography_surface.00000 rename to tests/geoid_freesurface/dynamic_topography_top.00000 index f17b98d9847..a81d2c78d15 100644 --- a/tests/geoid_freesurface/dynamic_topography_surface.00000 +++ b/tests/geoid_freesurface/dynamic_topography_top.00000 @@ -1,10 +1,10 @@ -# x y z surface topography +# x y z dynamic_topography_top -145496.501 -372600.011 -1.214306413e-12 -209.8668184 -267213.3859 -267213.3859 131125.9427 -226.0174 -267213.3859 -267213.3859 -131125.9427 -226.0174215 -372600.011 -145496.501 1.268516521e-12 -209.8668091 --267213.3859 -131125.9427 267213.3859 -312.6998569 --145496.501 8.15908346e-12 372600.011 -531.3713648 +-267213.3859 -131125.9427 267213.3859 -312.6998568 +-145496.501 8.15908346e-12 372600.011 -531.3713649 -372600.011 2.185715122e-11 145496.501 -234.5431654 -267213.3859 131125.9427 267213.3859 -312.6998377 1.214306413e-12 -372600.011 145496.501 -234.5431902 @@ -17,7 +17,7 @@ 267213.3859 -267213.3859 131125.9427 -226.0174031 372600.011 1.214306413e-12 145496.501 -234.5431694 267213.3859 131125.9427 267213.3859 -312.6998944 -267213.3859 -131125.9427 267213.3859 -312.6998854 +267213.3859 -131125.9427 267213.3859 -312.6998853 145496.501 3.014081989e-12 372600.011 -531.3713932 131125.9427 267213.3859 267213.3859 -312.6998964 -1.696905243e-11 372600.011 145496.501 -234.5431931 @@ -32,7 +32,7 @@ 372600.011 2.27028289e-11 -145496.501 -234.5431826 267213.3859 131125.9427 -267213.3859 -312.6998981 -1.344410672e-12 145496.501 -372600.011 -531.3712981 --131125.9427 267213.3859 -267213.3859 -312.6998552 +-131125.9427 267213.3859 -267213.3859 -312.6998551 131125.9427 267213.3859 -267213.3859 -312.699922 3.111660183e-12 372600.011 -145496.501 -234.5431792 -267213.3859 267213.3859 -131125.9427 -226.0174014 diff --git a/tests/geoid_freesurface/dynamic_topography_surface.00001 b/tests/geoid_freesurface/dynamic_topography_top.00001 similarity index 94% rename from tests/geoid_freesurface/dynamic_topography_surface.00001 rename to tests/geoid_freesurface/dynamic_topography_top.00001 index 80534fed419..43ce752aa88 100644 --- a/tests/geoid_freesurface/dynamic_topography_surface.00001 +++ b/tests/geoid_freesurface/dynamic_topography_top.00001 @@ -1,14 +1,14 @@ -# x y z surface topography +# x y z dynamic_topography_top -145496.501 -372600.011 -1.214306413e-12 615.8899541 -267213.3859 -267213.3859 131125.9427 175.3384268 --267213.3859 -267213.3859 -131125.9427 175.3382883 +-267213.3859 -267213.3859 -131125.9427 175.3382882 -372600.011 -145496.501 1.268516521e-12 615.8899861 -267213.3859 -131125.9427 267213.3859 -316.3562072 -145496.501 8.15908346e-12 372600.011 2308.671566 -372600.011 2.185715122e-11 145496.501 -154.5519365 -267213.3859 131125.9427 267213.3859 -316.3561961 1.214306413e-12 -372600.011 145496.501 -154.5520786 -131125.9427 -267213.3859 267213.3859 -316.3564405 +131125.9427 -267213.3859 267213.3859 -316.3564406 -131125.9427 -267213.3859 267213.3859 -316.3563186 -9.107298098e-13 -145496.501 372600.011 2308.671377 267213.3859 -267213.3859 -131125.9427 175.3383876 From d290eb723596c9a9256b28f0fd33e5482c9979ac Mon Sep 17 00:00:00 2001 From: Rene Gassmoeller Date: Fri, 29 Mar 2024 09:07:24 -0400 Subject: [PATCH 4/5] Address comments --- doc/modules/changes/20240315_gassmoeller2 | 2 +- include/aspect/postprocess/dynamic_topography.h | 6 ++++-- include/aspect/postprocess/heat_flux_map.h | 8 +++++++- source/postprocess/dynamic_topography.cc | 8 ++++---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/modules/changes/20240315_gassmoeller2 b/doc/modules/changes/20240315_gassmoeller2 index f0e4ff86d8b..916f0bbfd06 100644 --- a/doc/modules/changes/20240315_gassmoeller2 +++ b/doc/modules/changes/20240315_gassmoeller2 @@ -5,4 +5,4 @@ single file 'heat flux map' now writes one file per boundary. Both postprocessors now take care to not include spaces in the data file headers so that separating the header columns by spaces works correctly.
- (Rene Gassmoeller, 2024/03/15) +(Rene Gassmoeller, 2024/03/15) diff --git a/include/aspect/postprocess/dynamic_topography.h b/include/aspect/postprocess/dynamic_topography.h index 985e1c1eec9..7338ea1d588 100644 --- a/include/aspect/postprocess/dynamic_topography.h +++ b/include/aspect/postprocess/dynamic_topography.h @@ -86,10 +86,12 @@ namespace aspect private: /** * Output the dynamic topography solution to - * a file. + * a file for a given boundary id. All the values + * in @p position_and_topography are written to a file + * with a file name determined by @p boundary_id. */ void output_to_file(const types::boundary_id boundary_id, - const std::vector, double>> &values); + const std::vector, double>> &position_and_topography); /** * A vector which stores the surface stress values calculated diff --git a/include/aspect/postprocess/heat_flux_map.h b/include/aspect/postprocess/heat_flux_map.h index a41a9841c22..548f33a495a 100644 --- a/include/aspect/postprocess/heat_flux_map.h +++ b/include/aspect/postprocess/heat_flux_map.h @@ -91,7 +91,13 @@ namespace aspect private: /** - * Output the heat flux density to a file. + * Output the heat flux density for the boundary determined + * by @p boundary_id to a file. The heat flux density is + * handed over in the vector @ heat_flux_and_area. This vector + * is expected to be of the structure described for the return value + * of the function compute_heat_flux_through_boundary_faces() and + * only the values at the faces of the given @p boundary_id are + * written to the file. */ void output_to_file(const types::boundary_id boundary_id, const std::vector>> &heat_flux_and_area); diff --git a/source/postprocess/dynamic_topography.cc b/source/postprocess/dynamic_topography.cc index 1dd1bb9ee9b..21920851a81 100644 --- a/source/postprocess/dynamic_topography.cc +++ b/source/postprocess/dynamic_topography.cc @@ -412,7 +412,7 @@ namespace aspect template void DynamicTopography::output_to_file(const types::boundary_id boundary_id, - const std::vector,double>> &stored_values) + const std::vector,double>> &position_and_topography) { // get boundary name and avoid spaces for file output std::string boundary_name = this->get_geometry_model().translate_id_to_symbol_name(boundary_id); @@ -428,13 +428,13 @@ namespace aspect << "dynamic_topography_" << boundary_name << std::endl; } - for (unsigned int i=0; i Date: Sat, 30 Mar 2024 18:10:42 -0400 Subject: [PATCH 5/5] Update include/aspect/postprocess/heat_flux_map.h Co-authored-by: Juliane Dannberg --- include/aspect/postprocess/heat_flux_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/aspect/postprocess/heat_flux_map.h b/include/aspect/postprocess/heat_flux_map.h index 548f33a495a..84477eddbbb 100644 --- a/include/aspect/postprocess/heat_flux_map.h +++ b/include/aspect/postprocess/heat_flux_map.h @@ -93,7 +93,7 @@ namespace aspect /** * Output the heat flux density for the boundary determined * by @p boundary_id to a file. The heat flux density is - * handed over in the vector @ heat_flux_and_area. This vector + * handed over in the vector @p heat_flux_and_area. This vector * is expected to be of the structure described for the return value * of the function compute_heat_flux_through_boundary_faces() and * only the values at the faces of the given @p boundary_id are