-
Notifications
You must be signed in to change notification settings - Fork 276
Boundary composition plugin based on mesh deformation output #7225
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
Open
anne-glerum
wants to merge
15
commits into
geodynamics:main
Choose a base branch
from
anne-glerum:mesh_def_boundary_composition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
312bee4
Add functions to all mesh def plugins
anne-glerum f02d1e9
Loop over mesh def plugins
anne-glerum c113e4c
Add boundary composition plugin
anne-glerum c4a8b9e
Fix Assert and rm unused functions
anne-glerum b9a91ff
Add test
anne-glerum d7ce919
Implement default function instead of pure virtual function
anne-glerum 50d0bdf
Clean up boundary plugin
anne-glerum 3526d3d
Update documentation
anne-glerum fb0bd5c
Improve fastscape implementation
anne-glerum 54b425f
Indent and add todo
anne-glerum 732d28f
Update comments and newline
anne-glerum 3d8e2c9
Return zero for other boundaries
anne-glerum d15f5d3
Update doc
anne-glerum 42a03a7
Update test
anne-glerum fd2ab27
Fix deposition depth with box height
anne-glerum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,65 @@ | ||
| /* | ||
| Copyright (C) 2013 - 2023 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/>. | ||
| */ | ||
|
|
||
|
|
||
| #ifndef _aspect_boundary_composition_mesh_deformation_h | ||
| #define _aspect_boundary_composition_mesh_deformation_h | ||
|
|
||
| #include <aspect/mesh_deformation/interface.h> | ||
| #include <aspect/boundary_composition/interface.h> | ||
| #include <aspect/simulator_access.h> | ||
|
|
||
|
|
||
| namespace aspect | ||
| { | ||
| namespace BoundaryComposition | ||
| { | ||
| /** | ||
| * A class that implements a composition boundary condition that | ||
| * is set by the active mesh deformation plugins. Their returned | ||
| * values at a given point on a boundary are summed. | ||
| * | ||
| * @ingroup BoundaryCompositions | ||
| */ | ||
| template <int dim> | ||
| class MeshDeformation : public Interface<dim>, public SimulatorAccess<dim> | ||
| { | ||
| public: | ||
| /** | ||
| * Initialization function. This function is called once at the | ||
| * beginning of the program after parse_parameters is run. | ||
| */ | ||
| void | ||
| initialize () override; | ||
|
|
||
| /** | ||
| * This function returns the composition value returned by the | ||
| * mesh deformation interface, which is the sum of the boundary compositions | ||
| * provided by the active mesh deformation objects. | ||
| */ | ||
| double boundary_composition (const types::boundary_id boundary_indicator, | ||
| const Point<dim> &position, | ||
| const unsigned int compositional_field) const override; | ||
| }; | ||
| } | ||
| } | ||
|
|
||
|
|
||
| #endif |
This file contains hidden or 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 hidden or 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 hidden or 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,73 @@ | ||
| /* | ||
| Copyright (C) 2011 - 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/boundary_composition/mesh_deformation.h> | ||
| #include <aspect/initial_composition/interface.h> | ||
|
|
||
|
|
||
| namespace aspect | ||
| { | ||
| namespace BoundaryComposition | ||
| { | ||
| // ------------------------------ MeshDeformation ------------------- | ||
|
|
||
| template <int dim> | ||
| void | ||
| MeshDeformation<dim>::initialize() | ||
| { | ||
| // Check that mesh deformation is actually active. The mesh deformation plugins | ||
| // are not initialized yet, so we can only check the input parameters. | ||
| AssertThrow(this->get_parameters().mesh_deformation_enabled == true, | ||
| ExcMessage ("The boundary composition plugin ``mesh deformation'' can only be used when a mesh deformation plugin is active.")); | ||
| } | ||
|
|
||
|
|
||
|
|
||
| template <int dim> | ||
| double | ||
| MeshDeformation<dim>:: | ||
| boundary_composition (const types::boundary_id boundary_indicator, | ||
| const Point<dim> &position, | ||
| const unsigned int compositional_field) const | ||
| { | ||
| return this->get_mesh_deformation_handler().boundary_composition(boundary_indicator, position, compositional_field); | ||
| } | ||
|
|
||
| } | ||
| } | ||
|
|
||
| // explicit instantiations | ||
| namespace aspect | ||
| { | ||
| namespace BoundaryComposition | ||
| { | ||
| ASPECT_REGISTER_BOUNDARY_COMPOSITION_MODEL(MeshDeformation, | ||
| "mesh deformation", | ||
| "A model in which the composition at the boundary " | ||
| "is retrieved from the active mesh deformation plugins." | ||
| "\n\n" | ||
| "The active mesh deformation plugins can each return " | ||
| "a value for the compositional fields that are prescribed on " | ||
| "a boundary; their values are summed per field. If a mesh " | ||
| "deformation plugin does not implement the boundary composition " | ||
| "function, a default value of zero is returned.") | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the default be zero or an exception? I think in the documentation you claim 0.0.