Skip to content

Commit

Permalink
Merge pull request #5954 from gassmoeller/poison_default_melt_outputs
Browse files Browse the repository at this point in the history
Poison the default constructed values of MeltOutputs
  • Loading branch information
bangerth authored Jul 1, 2024
2 parents fd54f30 + aef6758 commit 9ff4d3e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
19 changes: 10 additions & 9 deletions include/aspect/melt.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace aspect
public:
/**
* Constructor. When the MeltInputs are created,
* all properties are initialized with signalingNaNs.
* all properties are initialized with signaling NaNs.
* This means that individual heating or material models
* can all attach the plugins they need, and in a later
* step they will all be filled together (using the fill
Expand Down Expand Up @@ -76,15 +76,16 @@ namespace aspect
class MeltOutputs : public AdditionalMaterialOutputs<dim>
{
public:
/**
* Constructor. When the MeltOutputs are created,
* all properties are initialized with signaling NaNs.
* This means that after the call to the material model
* it can be checked if the material model actually
* computed the values, by checking if the individual
* values are finite (using std::isfinite).
*/
MeltOutputs (const unsigned int n_points,
const unsigned int /*n_comp*/)
{
compaction_viscosities.resize(n_points);
fluid_viscosities.resize(n_points);
permeabilities.resize(n_points);
fluid_densities.resize(n_points);
fluid_density_gradients.resize(n_points, Tensor<1,dim>());
}
const unsigned int n_comp);

/**
* Compaction viscosity values $\xi$ at the given positions.
Expand Down
13 changes: 13 additions & 0 deletions source/simulator/melt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ namespace aspect



template <int dim>
MeltOutputs<dim>::MeltOutputs (const unsigned int n_points,
const unsigned int /*n_comp*/)
:
compaction_viscosities(n_points, numbers::signaling_nan<double>()),
fluid_viscosities(n_points, numbers::signaling_nan<double>()),
permeabilities(n_points, numbers::signaling_nan<double>()),
fluid_densities(n_points, numbers::signaling_nan<double>()),
fluid_density_gradients(n_points, numbers::signaling_nan<Tensor<1,dim>>())
{}



template <int dim>
void MeltOutputs<dim>::average (const MaterialAveraging::AveragingOperation operation,
const FullMatrix<double> &projection_matrix,
Expand Down

0 comments on commit 9ff4d3e

Please sign in to comment.