-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5787 from anne-glerum/data_out_signal
Add a signal before building patches for visualization output
- Loading branch information
Showing
6 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
Copyright (C) 2022 by the authors of the ASPECT code. | ||
This file is part of ASPECT. | ||
ASPECT is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2, or (at your option) | ||
any later version. | ||
ASPECT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with ASPECT; see the file LICENSE. If not see | ||
<http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#include <aspect/simulator_signals.h> | ||
#include <aspect/simulator_access.h> | ||
|
||
#include <iostream> | ||
|
||
namespace aspect | ||
{ | ||
template <int dim> | ||
void pre_data_out_build_patches (DataOut<dim> &) | ||
{ | ||
std::cout << "\npre_data_out_build_patches:\n"; | ||
} | ||
|
||
|
||
template <int dim> | ||
void signal_connector (SimulatorSignals<dim> &signals) | ||
{ | ||
std::cout << "Connecting signals" << std::endl; | ||
signals.pre_data_out_build_patches.connect (&pre_data_out_build_patches<dim>); | ||
} | ||
|
||
|
||
ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>, | ||
signal_connector<3>) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# A copy of stokes_solver.prm | ||
# to test the pre_data_out_build_patches signal | ||
# in visualization.cc. | ||
|
||
set Dimension = 2 | ||
set CFL number = 1.0 | ||
set End time = 0.1 | ||
set Start time = 0 | ||
set Adiabatic surface temperature = 0 | ||
set Surface pressure = 0 | ||
set Use years in output instead of seconds = false | ||
set Nonlinear solver scheme = single Advection, single Stokes | ||
|
||
subsection Boundary temperature model | ||
set List of model names = box | ||
set Fixed temperature boundary indicators = 0, 1 | ||
end | ||
|
||
subsection Gravity model | ||
set Model name = vertical | ||
end | ||
|
||
subsection Geometry model | ||
set Model name = box | ||
|
||
subsection Box | ||
set X extent = 1.2 | ||
set Y extent = 1 | ||
set Z extent = 1 | ||
end | ||
end | ||
|
||
subsection Initial temperature model | ||
set Model name = perturbed box | ||
end | ||
|
||
subsection Material model | ||
set Model name = simpler | ||
|
||
subsection Simpler model | ||
set Reference density = 1 | ||
set Reference specific heat = 1250 | ||
set Reference temperature = 1 | ||
set Thermal conductivity = 1e-6 | ||
set Thermal expansion coefficient = 2e-5 | ||
set Viscosity = 1 | ||
end | ||
end | ||
|
||
subsection Mesh refinement | ||
set Initial adaptive refinement = 0 | ||
set Initial global refinement = 5 | ||
end | ||
|
||
subsection Boundary velocity model | ||
set Tangential velocity boundary indicators = 1 | ||
set Zero velocity boundary indicators = 0, 2, 3 | ||
end | ||
|
||
subsection Postprocess | ||
set List of postprocessors = visualization, velocity statistics | ||
|
||
subsection Visualization | ||
set List of output variables = density, viscosity | ||
end | ||
end | ||
|
||
subsection Solver parameters | ||
subsection Stokes solver parameters | ||
set Number of cheap Stokes solver steps = 30 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
Loading shared library <./libpre_data_out_build_patches.debug.so> | ||
|
||
Connecting signals | ||
Number of active cells: 1,024 (on 6 levels) | ||
Number of degrees of freedom: 13,764 (8,450+1,089+4,225) | ||
|
||
*** Timestep 0: t=0 seconds, dt=0 seconds | ||
Solving temperature system... 0 iterations. | ||
Rebuilding Stokes preconditioner... | ||
Solving Stokes system... 30+7 iterations. | ||
|
||
Postprocessing: | ||
|
||
pre_data_out_build_patches: | ||
Writing graphical output: output-pre_data_out_build_patches/solution/solution-00000 | ||
RMS, max velocity: 9e-09 m/s, 3.23e-08 m/s | ||
|
||
*** Timestep 1: t=0.1 seconds, dt=0.1 seconds | ||
Solving temperature system... 4 iterations. | ||
Solving Stokes system... 8+0 iterations. | ||
|
||
Postprocessing: | ||
RMS, max velocity: 9e-09 m/s, 3.23e-08 m/s | ||
|
||
Termination requested by criterion: end time | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 1: Time step number | ||
# 2: Time (seconds) | ||
# 3: Time step size (seconds) | ||
# 4: Number of mesh cells | ||
# 5: Number of Stokes degrees of freedom | ||
# 6: Number of temperature degrees of freedom | ||
# 7: Iterations for temperature solver | ||
# 8: Iterations for Stokes solver | ||
# 9: Velocity iterations in Stokes preconditioner | ||
# 10: Schur complement iterations in Stokes preconditioner | ||
# 11: Visualization file name | ||
# 12: RMS velocity (m/s) | ||
# 13: Max. velocity (m/s) | ||
0 0.000000000000e+00 0.000000000000e+00 1024 9539 4225 0 37 85 38 output-pre_data_out_build_patches/solution/solution-00000 9.00076484e-09 3.23376827e-08 | ||
1 1.000000000000e-01 1.000000000000e-01 1024 9539 4225 4 7 9 9 "" 9.00076831e-09 3.23376980e-08 |