-
Notifications
You must be signed in to change notification settings - Fork 67
[beaminteraction]Dual Hermite shapefunctions for Lagrange Multipliers #2009
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
dharinib98
wants to merge
17
commits into
4C-multiphysics:main
Choose a base branch
from
dharinib98:dual_hermite_shapefunctions
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
17 commits
Select commit
Hold shift + click to select a range
7741025
Intermediate working version
dharinib98 dd4ac73
Add tests for the shapefunctions
dharinib98 b135342
Correct shape functions
dharinib98 9cb3062
Move shapefunction implementation to header
dharinib98 cbb0931
Move shape function definition to FEM core
dharinib98 e59a1b0
Refactor shapefunction evaluation function
dharinib98 269a2af
Split template factory
dharinib98 a69b386
Minor corrections
dharinib98 a80a00c
Remove additional factory
dharinib98 ac15f37
Move unit tests
dharinib98 60330f2
Add input and output tests
dharinib98 a6f59fe
Correct vtu tests
dharinib98 77fd6eb
Check one element per row of D is nonzero
dharinib98 ac03310
Refactor vtu test timesteps
dharinib98 6e20c63
Revert unwanted change to shapefunctions test file
dharinib98 87c7221
Refactor tolerance for nonzero check
dharinib98 28fa89e
Move diagonal check to utils
dharinib98 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
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
93 changes: 93 additions & 0 deletions
93
...to_solid/4C_beaminteraction_contact_beam_to_solid_mortar_shape_functions_dual_hermite.hpp
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,93 @@ | ||
| // This file is part of 4C multiphysics licensed under the | ||
| // GNU Lesser General Public License v3.0 or later. | ||
| // | ||
| // See the LICENSE.md file in the top-level for license information. | ||
| // | ||
| // SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
|
||
| #ifndef FOUR_C_BEAMINTERACTION_CONTACT_BEAM_TO_SOLID_MORTAR_SHAPE_FUNCTIONS_DUAL_HERMITE_HPP | ||
| #define FOUR_C_BEAMINTERACTION_CONTACT_BEAM_TO_SOLID_MORTAR_SHAPE_FUNCTIONS_DUAL_HERMITE_HPP | ||
|
|
||
| #include "4C_config.hpp" | ||
|
|
||
| #include "4C_beam3_base.hpp" | ||
| #include "4C_fem_general_utils_fem_shapefunctions.hpp" | ||
| #include "4C_geometry_pair_element.hpp" | ||
| #include "4C_geometry_pair_element_shape_functions.hpp" | ||
|
|
||
| FOUR_C_NAMESPACE_OPEN | ||
|
|
||
| namespace BeamInteraction | ||
| { | ||
| struct HermiteDual : public GeometryPair::ElementDiscretizationBase<Core::FE::CellType::line2, 2> | ||
| { | ||
| }; | ||
| } // namespace BeamInteraction | ||
|
|
||
| namespace GeometryPair | ||
| { | ||
| template <> | ||
| struct ShapeFunctionData<BeamInteraction::HermiteDual> | ||
| { | ||
| double ref_length_; | ||
| }; | ||
|
|
||
| template <> | ||
| struct SetShapeFunctionData<BeamInteraction::HermiteDual> | ||
| { | ||
| static void set(ShapeFunctionData<BeamInteraction::HermiteDual>& shape_function_data, | ||
| const Core::Elements::Element* element) | ||
| { | ||
| const auto* beam_element = dynamic_cast<const Discret::Elements::Beam3Base*>(element); | ||
| if (beam_element == nullptr) | ||
| FOUR_C_THROW( | ||
| "The element pointer has to point to a valid beam element when evaluating the shape " | ||
| "function data of a dual Hermite mortar shape function, as we need to get " | ||
| "RefLength()!"); | ||
|
|
||
| shape_function_data.ref_length_ = beam_element->ref_length(); | ||
| } | ||
| }; | ||
|
|
||
|
|
||
| template <> | ||
| struct EvaluateShapeFunction<BeamInteraction::HermiteDual> | ||
| { | ||
| template <typename V, typename T> | ||
| static void evaluate(V& N, const T& xi, | ||
| const ShapeFunctionData<BeamInteraction::HermiteDual>& shape_function_data) | ||
| { | ||
| const T xi2 = xi * xi; | ||
| const T xi3 = xi2 * xi; | ||
|
|
||
| N(0) = -35.0 / 4.0 * xi3 + 15.0 / 4.0 * xi2 + 15.0 / 4.0 * xi - 3.0 / 4.0; | ||
|
|
||
| N(1) = (105.0 * xi3 - 45.0 / 2.0 * xi2 - 60.0 * xi + 15.0 / 2.0) / | ||
| shape_function_data.ref_length_; | ||
|
|
||
| N(2) = 35.0 / 4.0 * xi3 + 15.0 / 4.0 * xi2 - 15.0 / 4.0 * xi - 3.0 / 4.0; | ||
|
|
||
| N(3) = (105.0 * xi3 + 45.0 / 2.0 * xi2 - 60.0 * xi - 15.0 / 2.0) / | ||
| shape_function_data.ref_length_; | ||
| } | ||
| }; | ||
|
|
||
| template <> | ||
| struct PrintElementData<BeamInteraction::HermiteDual> | ||
|
dharinib98 marked this conversation as resolved.
|
||
| { | ||
| template <typename ScalarType> | ||
| static void print(const ElementData<BeamInteraction::HermiteDual, ScalarType>& element_data, | ||
| std::ostream& out) | ||
| { | ||
| constexpr auto max_precision{std::numeric_limits<double>::digits10 + 1}; | ||
| out << std::setprecision(max_precision); | ||
| out << "\nElement reference length: " << element_data.shape_function_data_.ref_length_; | ||
| out << "\nElement state vector: "; | ||
| element_data.element_position_.print(out); | ||
| } | ||
| }; | ||
| } // namespace GeometryPair | ||
|
|
||
| FOUR_C_NAMESPACE_CLOSE | ||
|
dharinib98 marked this conversation as resolved.
|
||
|
|
||
| #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
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.
@isteinbrecher Is this what we want here? Of course using a
structforces us to a specific naming scheme, which looks a bit off in the template initialization later on. I don't have a strong opinion on this, just want to know if this would make sense for the other template parameters too in the future.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.
I agree @maxfirmbach. I am not sure what the best way is, we could use an alias to define a name like
t_hermite_dualafter creating the struct.