Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometry checking and including spherical models #1698

Merged
merged 8 commits into from May 17, 2017

Conversation

bobmyhill
Copy link
Member

This is a continuation of PR #1685. Additionally, the included GeometryModels in several files were inconsistent; this PR adds Sphere to boundary_composition/spherical_constant.cc and EllipsoidalChunk to initial_temperature/spherical_shell.cc. Tests are created for both of these new cases.

@bangerth
Copy link
Contributor

/run-tests

Copy link
Contributor

@bangerth bangerth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one (cluster of) comment of substance.

@@ -87,6 +89,7 @@ namespace aspect
/**
* Compositions at the inner and outer boundaries.
*/
double surface_composition;
double inner_composition;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the new variable do? the class already has inner/outer boundary values, and the comment doesn't help either :-)

if (dynamic_cast<const GeometryModel::Sphere<dim>*>(geometry_model) != 0)
{
if (boundary_name == "surface")
return surface_composition;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer if this returned "outer_composition", and that we document this in the definition of the input parameters

@@ -99,6 +120,9 @@ namespace aspect
{
prm.enter_subsection("Spherical constant");
{
prm.declare_entry ("Surface composition", "0",
Patterns::Double (),
"Composition at the surface (lithosphere water/air). Units: none.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my proposal would remove this parameter, and add a sentence to the definition of "Outer composition" to say that that is used for the surface when the geometry is a sphere.

// 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. "));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds more like you want to use ExcNotImplemented() given the TODO above

else
{
Assert (false, ExcMessage ("This initial condition can only be used if the geometry "
"is a sphere, a spherical shell or a chunk."));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...or ellipsoidal chunk

// 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. "));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

"is a sphere, a spherical shell or a chunk."));

R0 = std::numeric_limits<double>::quiet_NaN();
R1 = std::numeric_limits<double>::quiet_NaN();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's one way. You shouldn't get here, so it doesn't matter, but we've started using numbers::signaling_nan<double>() in such cases -- that really makes sure that nobody uses these values!

// for this geometry do we know for sure what boundary indicators it
// uses and what they mean
Assert (dynamic_cast<const GeometryModel::Box<dim>*>(&this->get_geometry_model())
!= 0,
ExcMessage ("This boundary model is only implemented if the geometry is "
"in fact a time_dep_box."));
"a time_dep_box."));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really didn't like the "in fact" in all of these places, did you? ;-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:D

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a personal bugbear, in fact!

@bobmyhill bobmyhill force-pushed the geometry_checking branch 2 times, most recently from ad40ab6 to f3b5d90 Compare May 16, 2017 14:59
@bangerth
Copy link
Contributor

One of the tests also fails. Do you know why?

@bobmyhill
Copy link
Member Author

Yes, this will be because I didn't have the test output until amending the "updated tests" commit.

@bangerth
Copy link
Contributor

OK to merge.

@bobmyhill bobmyhill force-pushed the geometry_checking branch 3 times, most recently from d218410 to c8dfbe8 Compare May 16, 2017 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants