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

input different coordinate systems in initial temperature function #1628

Merged
merged 2 commits into from May 14, 2017

Conversation

mbweller
Copy link
Contributor

Follow up to boundary condition changes

@bangerth
Copy link
Contributor

Follow-up to #1563.

@bangerth
Copy link
Contributor

/run-tests

* The coordinate representation to evaluate the function. Possible
* choices are depth, cartesian and spherical.
*/
::aspect::Utilities::Coordinates::CoordinateSystem coordinate_system;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you actually need the ::aspect:: at the front. Same everywhere else.

Copy link
Member

Choose a reason for hiding this comment

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

It might be needed to differentiate it from dealii::Utilities?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should find aspect::Utilities first when you just say Utilities. Can you try, @mbweller ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried, and it didn't work. It didn't give a compilation error, it lost functionality. Specifically it didn't recognize set Coordinate system.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this. If it compiles, it must work. Can you post what error message or fault you get?

Copy link
Contributor

Choose a reason for hiding this comment

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

See #1648.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't explain it. I just recompiled, and it works. Earlier it did not, and the only solution was to add ::aspect:: to Utilities:: ...

Point<dim> point;

for (unsigned int i = 0; i<dim; ++i)
point[i] = spherical_coordinates[i];
Copy link
Contributor

Choose a reason for hiding this comment

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

see also #1632.

return function.value(point);
}
else if (coordinate_system == ::aspect::Utilities::Coordinates::CoordinateSystem::depth)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong indentation here.

@@ -64,6 +111,10 @@ namespace aspect
prm.enter_subsection ("Initial temperature model");
{
prm.enter_subsection("Function");
{
coordinate_system = ::aspect::Utilities::Coordinates::string_to_coordinate_system(prm.get("Coordinate system"));
Copy link
Contributor

Choose a reason for hiding this comment

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

no need for ::aspect::

@mbweller
Copy link
Contributor Author

Addressed small issues. Will address functionality in #1632 following this.

@Shangxin-Liu
Copy link
Contributor

I'd like to use r, theta, phi to input single degree order temperature field in my geoid benchmark prm file when this get merged.

@bangerth
Copy link
Contributor

This looks good to me. Do you think it is practical to add tests for each of these places?

@Shangxin-Liu
Copy link
Contributor

Do you mean adding the same test prm file with single degree order perturbation for both geoid and this spherical coordinate initial temperature function?

@bangerth
Copy link
Contributor

Ideally, we'd like to have tests that run through every new code path that is added to ASPECT. In this case, that would mean adding tests for each coordinate system for each plugin that you are modifying. That may be a lot of new tests, and I don't know whether that's practical, but it would be nice to have.

@mbweller
Copy link
Contributor Author

Had to make a small change to function.h (broken functionality). It works with test cases.

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.

Great, @mbweller , and many thanks for the tests! I marked up the use of ::aspect::Utilities, but let me rather go ahead and merge -- this can be fixed at a later time, and maybe that's appropriate anyway because there are other places already.

* The coordinate representation to evaluate the function. Possible
* choices are depth, cartesian and spherical.
*/
::aspect::Utilities::Coordinates::CoordinateSystem coordinate_system;
Copy link
Contributor

Choose a reason for hiding this comment

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

It should find aspect::Utilities first when you just say Utilities. Can you try, @mbweller ?

@bangerth bangerth merged commit c8576eb into geodynamics:master May 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants