Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmyhill committed May 16, 2017
1 parent a3b9488 commit 2433487
Show file tree
Hide file tree
Showing 13 changed files with 3,739 additions and 24 deletions.
1 change: 0 additions & 1 deletion include/aspect/boundary_composition/spherical_constant.h
Expand Up @@ -89,7 +89,6 @@ namespace aspect
/**
* Compositions at the inner and outer boundaries.
*/
double surface_composition;
double inner_composition;
double outer_composition;
};
Expand Down
24 changes: 11 additions & 13 deletions source/boundary_composition/spherical_constant.cc
Expand Up @@ -50,13 +50,13 @@ namespace aspect

if (dynamic_cast<const GeometryModel::Sphere<dim>*>(geometry_model) != 0)
{
if (boundary_name == "surface")
return surface_composition;
if (boundary_name == "outer")
return outer_composition;
else
{
Assert (false, ExcMessage ("Unknown boundary indicator for geometry model. "
"The given boundary should be ``surface''."));
return std::numeric_limits<double>::quiet_NaN();
"The given boundary should be ``outer''."));
return numbers::signaling_nan<double>();
}
}
else if (dynamic_cast<const GeometryModel::SphericalShell<dim>*>(geometry_model) != 0
Expand All @@ -71,14 +71,14 @@ namespace aspect
{
Assert (false, ExcMessage ("Unknown boundary indicator for geometry model. "
"The given boundary should be ``inner'' or ``outer''."));
return std::numeric_limits<double>::quiet_NaN();
return numbers::signaling_nan<double>();
}
}
else
{
Assert (false, ExcMessage ("This boundary model is only implemented if the geometry "
"is a sphere, spherical shell, chunk or ellipsoidal chunk."));
return std::numeric_limits<double>::quiet_NaN();
return numbers::signaling_nan<double>();
}
}

Expand All @@ -91,7 +91,7 @@ namespace aspect
{
const GeometryModel::Interface<dim> *geometry_model = &this->get_geometry_model();
if (dynamic_cast<const GeometryModel::Sphere<dim>*>(geometry_model) != 0)
return surface_composition;
return outer_composition;
else
return std::min (inner_composition, outer_composition);
}
Expand All @@ -105,7 +105,7 @@ namespace aspect
{
const GeometryModel::Interface<dim> *geometry_model = &this->get_geometry_model();
if (dynamic_cast<const GeometryModel::Sphere<dim>*>(geometry_model) != 0)
return surface_composition;
return outer_composition;
else
return std::max (inner_composition, outer_composition);
}
Expand All @@ -120,12 +120,11 @@ namespace aspect
{
prm.enter_subsection("Spherical constant");
{
prm.declare_entry ("Surface composition", "0",
Patterns::Double (),
"Composition at the surface (lithosphere water/air). Units: none.");
prm.declare_entry ("Outer composition", "0",
Patterns::Double (),
"Composition at the outer boundary (lithosphere water/air). Units: none.");
"Composition at the outer boundary (lithosphere water/air). "
"For a spherical geometry model, this is the only boundary. "
"Units: none.");
prm.declare_entry ("Inner composition", "1",
Patterns::Double (),
"Composition at the inner boundary (core mantle boundary). Units: none.");
Expand All @@ -144,7 +143,6 @@ namespace aspect
{
prm.enter_subsection("Spherical constant");
{
surface_composition = prm.get_double ("Surface composition");
inner_composition = prm.get_double ("Inner composition");
outer_composition = prm.get_double ("Outer composition");
}
Expand Down
2 changes: 1 addition & 1 deletion source/boundary_temperature/two_merged_boxes.cc
Expand Up @@ -37,7 +37,7 @@ namespace aspect
boundary_temperature (const types::boundary_id boundary_indicator,
const Point<dim> &) const
{
// verify that the geometry is in fact a box since only for this geometry
// verify that the geometry is a box since only for this geometry
// do we know for sure what boundary indicators it uses and what they mean
Assert (dynamic_cast<const GeometryModel::TwoMergedBoxes<dim>*>(&this->get_geometry_model()) != 0,
ExcMessage ("This boundary model is only useful if the geometry is "
Expand Down
16 changes: 9 additions & 7 deletions source/initial_temperature/spherical_shell.cc
Expand Up @@ -76,15 +76,16 @@ namespace aspect
// because the domain can be non-coordinate parallel.

AssertThrow(gm->get_eccentricity() == 0.0,
ExcMessage("This plugin cannot be used with a non-zero eccentricity. "));
ExcNotImplemented("This plugin cannot be used with a non-zero eccentricity. "));

R1 = gm->get_semi_major_axis_a();
}
else
{
Assert (false, ExcMessage ("This initial condition can only be used if the geometry "
"is a sphere, a spherical shell or a chunk."));
R1 = std::numeric_limits<double>::quiet_NaN();
"is a sphere, a spherical shell, a chunk or an "
"ellipsoidal chunk."));
R1 = numbers::signaling_nan<double>();
}

// s = fraction of the way from the inner to the outer boundary; 0<=s<=1
Expand Down Expand Up @@ -232,18 +233,19 @@ namespace aspect
// because the domain can be non-coordinate parallel.

AssertThrow(gm->get_eccentricity() == 0.0,
ExcMessage("This plugin cannot be used with a non-zero eccentricity. "));
ExcNotImplemented("This plugin cannot be used with a non-zero eccentricity. "));

R0 = gm->get_semi_major_axis_a() - gm->maximal_depth();
R1 = gm->get_semi_major_axis_a();
}
else
{
Assert (false, ExcMessage ("This initial condition can only be used if the geometry "
"is a sphere, a spherical shell or a chunk."));
"is a sphere, a spherical shell, a chunk or an "
"ellipsoidal chunk."));

R0 = std::numeric_limits<double>::quiet_NaN();
R1 = std::numeric_limits<double>::quiet_NaN();
R0 = numbers::signaling_nan<double>();
R1 = numbers::signaling_nan<double>();
}

const double dT = this->get_boundary_temperature().maximal_temperature()
Expand Down
2 changes: 1 addition & 1 deletion tests/compressibility.cc
Expand Up @@ -104,7 +104,7 @@ namespace aspect
{
// create a quadrature formula based on the temperature element alone.
// be defensive about determining that what we think is the temperature
// element, is it in fact
// element is indeed the temperature element
Assert (this->get_fe().n_base_elements() == 3+(this->n_compositional_fields()>0 ? 1 : 0),
ExcNotImplemented());
const QGauss<dim-1> quadrature_formula (this->get_fe().base_element(2).degree+1);
Expand Down
@@ -0,0 +1,20 @@

Number of active cells: 64 (on 3 levels)
Number of degrees of freedom: 3,041 (2,187+125+729)

*** Timestep 0: t=0 seconds
Solving temperature system... 0 iterations.
Rebuilding Stokes preconditioner...
Solving Stokes system... 97+0 iterations.

Postprocessing:
Writing graphical output: output-octagonal_initial_temperature_ellipsoidal_chunk/solution/solution-00000
Temperature min/avg/max: 0 K, 0.7635 K, 2 K

Termination requested by criterion: end time


+---------------------------------------------+------------+------------+
+---------------------------------+-----------+------------+------------+
+---------------------------------+-----------+------------+------------+

0 comments on commit 2433487

Please sign in to comment.