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

[IN REVIEW] Add basic functionality for dynamic analysis #339

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

henrij22
Copy link
Collaborator

@henrij22 henrij22 commented Nov 20, 2024

This will at least partially address #92

  • Add mass matrix computation for every element
  • Modal analysis class
  • Mass matrix lumped or not lumped

@henrij22 henrij22 added the feature New feature label Nov 20, 2024
@henrij22 henrij22 self-assigned this Nov 20, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 85.64356% with 29 lines in your changes missing coverage. Please review.

Project coverage is 81.13%. Comparing base (f1928da) to head (94d8fa3).

Files with missing lines Patch % Lines
...karus/finiteelements/mechanics/nonlinearelastic.hh 27.77% 13 Missing ⚠️
.../solver/eigenvaluesolver/generalizedeigensolver.hh 86.04% 6 Missing ⚠️
...us/assembler/assemblermanipulatorbuildingblocks.hh 33.33% 4 Missing ⚠️
ikarus/utils/modalanalysis/modalanalysis.hh 90.90% 3 Missing ⚠️
ikarus/assembler/simpleassemblers.inl 33.33% 2 Missing ⚠️
ikarus/finiteelements/mechanics/truss.hh 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #339      +/-   ##
==========================================
+ Coverage   80.86%   81.13%   +0.27%     
==========================================
  Files          68       72       +4     
  Lines        2299     2465     +166     
==========================================
+ Hits         1859     2000     +141     
- Misses        440      465      +25     
Flag Coverage Δ
tests 81.13% <85.64%> (+0.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@henrij22 henrij22 added this to the v0.5 ~ v1.0 milestone Nov 28, 2024
@henrij22 henrij22 changed the title [WIP] Add basic functionality for dynamic analysis [IN RIVIEW] Add basic functionality for dynamic analysis Nov 28, 2024
@henrij22 henrij22 changed the title [IN RIVIEW] Add basic functionality for dynamic analysis [IN REVIEW] Add basic functionality for dynamic analysis Nov 28, 2024
Copy link
Collaborator

@tarun-mitruka tarun-mitruka left a comment

Choose a reason for hiding this comment

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

Thank you Henri for this very nice PR. It adds a lot of functionalities, which even though is used here for modal analysis, can be scaled later for different applications. Please see my comments for the requested changes. I would also propose the following:

  • May be for some comments (for example, where we decide to do it in a different PR) can be marked as unresolved such that Alex doesn't repeat the comments
  • Change the PR name to "Add a generalized eigen solver and functionalities to perform modal analysis" (or similar), because "dynamic analysis" is a broad terminology

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -132,8 +132,8 @@ typename SparseFlatAssembler<B, FEC>::MatrixType& SparseFlatAssembler<B, FEC>::g

template <typename B, typename FEC>
typename SparseFlatAssembler<B, FEC>::MatrixType& SparseFlatAssembler<B, FEC>::getMatrixImpl(
const FERequirement& feRequirements, MatrixAffordance affordance) {
if (not sparsePreProcessor_) {
const FERequirement& feRequirements, MatrixAffordance affordance, bool resetOccupationPattern) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I recall our discussion correctly, we said that here instead of the bool, perhaps we can pass the pruning functor instead of it happening in the lumping function here. Did you face any problems with this? I am not sure but perhaps passing a functor and defaulting it to existing functions can avoid the if constexpr here? May be the pruning functor can also be something that the user can bind to the assembler and overwrite a default?

ikarus/finiteelements/fehelper.hh Outdated Show resolved Hide resolved
@@ -203,7 +203,10 @@ auto scalarAffordance(VectorAffordance affordanceV) {
namespace AffordanceCollections {
inline constexpr AffordanceCollection elastoStatics(ScalarAffordance::mechanicalPotentialEnergy,
VectorAffordance::forces, MatrixAffordance::stiffness);
}
constexpr Ikarus::AffordanceCollection dynamics(Ikarus::ScalarAffordance::noAffordance,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should decide a better name for this affordance I think because it is specific to modal analysis. In theory, for instance dynamics can also include a ScalarAffordance

tests/src/testmodalanalysis.cpp Show resolved Hide resolved
Ikarus::init(argc, argv);
TestSuite t;

t.subTest(modalAnalysisTest());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think for modal analysis also there can be a test with some resultcollection to check specific entries for all/some of the element

tests/src/testeigenvaluesolver.cpp Outdated Show resolved Hide resolved
tests/src/testeigenvaluesolver.cpp Outdated Show resolved Hide resolved
tests/src/testeigenvaluesolver.cpp Outdated Show resolved Hide resolved
@tarun-mitruka tarun-mitruka linked an issue Nov 29, 2024 that may be closed by this pull request
3 tasks
@tarun-mitruka
Copy link
Collaborator

I didn't notice that the action Test Python Package fails. Can you also look into it? I think a CMakeLists.txt file has to be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include Linear Dynamics
2 participants