diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 8be81165ab6..47a19fd7ef0 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -16,7 +16,7 @@ jobs: gcc13_assertions_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-latest if: github.ref != 'refs/heads/main' container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 strategy: fail-fast: false @@ -104,7 +104,7 @@ jobs: clang18_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -158,7 +158,7 @@ jobs: needs: clang18_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -184,7 +184,7 @@ jobs: needs: clang18_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -243,7 +243,7 @@ jobs: gcc13_no_optional_dependencies_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -269,7 +269,7 @@ jobs: needs: gcc13_no_optional_dependencies_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: diff --git a/.github/workflows/checkcode.yml b/.github/workflows/checkcode.yml index d574e61596a..e1b7e33f4df 100644 --- a/.github/workflows/checkcode.yml +++ b/.github/workflows/checkcode.yml @@ -4,9 +4,9 @@ name: checkcode on: pull_request: branches: - - 'main' + - "main" schedule: - - cron: '0 22 * * *' + - cron: "0 22 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -29,7 +29,7 @@ jobs: clang-tidy: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -55,7 +55,7 @@ jobs: verify-headers: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2d2a74fa942..124af913605 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,13 +2,13 @@ name: coverage on: schedule: - - cron: '0 1 * * *' + - cron: "0 1 * * *" jobs: clang18_coverage_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -45,7 +45,7 @@ jobs: needs: clang18_coverage_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 strategy: matrix: @@ -111,7 +111,7 @@ jobs: needs: [clang18_coverage_test, clang18_coverage_build] runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index dda15e9a9e8..e9a7407f4ed 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -18,7 +18,7 @@ jobs: doxygen: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -44,7 +44,7 @@ jobs: documentation: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index 13f2c46b155..a0b24496c47 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -2,13 +2,13 @@ name: nightly_tests on: schedule: - - cron: '0 22 * * *' + - cron: "0 22 * * *" jobs: gcc13_assertions_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -43,7 +43,7 @@ jobs: needs: gcc13_assertions_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 strategy: fail-fast: false @@ -95,7 +95,7 @@ jobs: clang18_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -193,7 +193,7 @@ jobs: needs: clang18_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 strategy: fail-fast: false @@ -245,7 +245,7 @@ jobs: clang18_build_oldest_supported_dependencies: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04-oldest-supported:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04-oldest-supported:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -280,7 +280,7 @@ jobs: needs: clang18_build_oldest_supported_dependencies runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04-oldest-supported:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04-oldest-supported:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 strategy: fail-fast: false @@ -319,7 +319,7 @@ jobs: gcc13_no_optional_dependencies_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -354,7 +354,7 @@ jobs: needs: gcc13_no_optional_dependencies_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 strategy: fail-fast: false @@ -406,7 +406,7 @@ jobs: gcc13_asan_build: runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 defaults: run: @@ -441,7 +441,7 @@ jobs: needs: gcc13_asan_build runs-on: ubuntu-latest container: - image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:4d0c2ab2 + image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:7821acef options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 strategy: fail-fast: false diff --git a/dependencies/current/trilinos/install.sh b/dependencies/current/trilinos/install.sh index 76ba6b27d9f..bc609590c1c 100755 --- a/dependencies/current/trilinos/install.sh +++ b/dependencies/current/trilinos/install.sh @@ -42,6 +42,7 @@ $CMAKE_COMMAND \ -D CMAKE_INSTALL_PREFIX:STRING=$INSTALL_DIR \ -D BUILD_SHARED_LIBS:BOOL=ON \ \ + -D Trilinos_ENABLE_DEBUG:BOOL=ON \ -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \ -D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON \ -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ diff --git a/dependencies/oldest_supported/trilinos/install.sh b/dependencies/oldest_supported/trilinos/install.sh index 76ba6b27d9f..bc609590c1c 100755 --- a/dependencies/oldest_supported/trilinos/install.sh +++ b/dependencies/oldest_supported/trilinos/install.sh @@ -42,6 +42,7 @@ $CMAKE_COMMAND \ -D CMAKE_INSTALL_PREFIX:STRING=$INSTALL_DIR \ -D BUILD_SHARED_LIBS:BOOL=ON \ \ + -D Trilinos_ENABLE_DEBUG:BOOL=ON \ -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \ -D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON \ -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ diff --git a/dependencies/trilinos_develop/trilinos/install.sh b/dependencies/trilinos_develop/trilinos/install.sh index 1bf7c641196..d5f0cc08829 100755 --- a/dependencies/trilinos_develop/trilinos/install.sh +++ b/dependencies/trilinos_develop/trilinos/install.sh @@ -42,6 +42,7 @@ $CMAKE_COMMAND \ -D CMAKE_INSTALL_PREFIX:STRING=$INSTALL_DIR \ -D BUILD_SHARED_LIBS:BOOL=ON \ \ + -D Trilinos_ENABLE_DEBUG:BOOL=ON \ -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \ -D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON \ -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ diff --git a/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_pinjointed.cpp b/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_pinjointed.cpp index 397a0106b7d..e69836d0a31 100644 --- a/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_pinjointed.cpp +++ b/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_pinjointed.cpp @@ -43,7 +43,7 @@ BeamInteraction::BeamLinkBeam3rLine2PinJointed::BeamLinkBeam3rLine2PinJointed() : BeamLinkPinJointed(), triad_(Core::LinAlg::Initialization::zero), linkele_(nullptr), - bspotforces_(2, Core::LinAlg::SerialDenseVector(true)) + bspotforces_(2, Core::LinAlg::SerialDenseVector(3, true)) { } @@ -53,7 +53,7 @@ BeamInteraction::BeamLinkBeam3rLine2PinJointed::BeamLinkBeam3rLine2PinJointed( const BeamInteraction::BeamLinkBeam3rLine2PinJointed& old) : BeamInteraction::BeamLinkPinJointed(old), triad_(old.triad_), - bspotforces_(2, Core::LinAlg::SerialDenseVector(true)) + bspotforces_(2, Core::LinAlg::SerialDenseVector(3, true)) { if (linkele_ != nullptr) linkele_ = std::dynamic_pointer_cast( diff --git a/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_rigidjointed.cpp b/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_rigidjointed.cpp index 7d5f8721b53..67eac577bfa 100644 --- a/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_rigidjointed.cpp +++ b/src/beaminteraction/src/4C_beaminteraction_link_beam3_reissner_line2_rigidjointed.cpp @@ -43,7 +43,7 @@ Core::Communication::ParObject* BeamInteraction::BeamLinkBeam3rLine2RigidJointed BeamInteraction::BeamLinkBeam3rLine2RigidJointed::BeamLinkBeam3rLine2RigidJointed() : BeamLinkRigidJointed(), linkele_(nullptr), - bspotforces_(2, Core::LinAlg::SerialDenseVector(true)) + bspotforces_(2, Core::LinAlg::SerialDenseVector(3, true)) { } @@ -52,7 +52,7 @@ BeamInteraction::BeamLinkBeam3rLine2RigidJointed::BeamLinkBeam3rLine2RigidJointe BeamInteraction::BeamLinkBeam3rLine2RigidJointed::BeamLinkBeam3rLine2RigidJointed( const BeamInteraction::BeamLinkBeam3rLine2RigidJointed& old) : BeamInteraction::BeamLinkRigidJointed(old), - bspotforces_(2, Core::LinAlg::SerialDenseVector(true)) + bspotforces_(2, Core::LinAlg::SerialDenseVector(3, true)) { if (linkele_ != nullptr) linkele_ = std::dynamic_pointer_cast( diff --git a/src/beaminteraction/src/4C_beaminteraction_link_truss.cpp b/src/beaminteraction/src/4C_beaminteraction_link_truss.cpp index 83d8807eaf4..329d155764d 100644 --- a/src/beaminteraction/src/4C_beaminteraction_link_truss.cpp +++ b/src/beaminteraction/src/4C_beaminteraction_link_truss.cpp @@ -40,7 +40,7 @@ Core::Communication::ParObject* BeamInteraction::BeamLinkTrussType::create( BeamInteraction::BeamLinkTruss::BeamLinkTruss() : BeamLinkPinJointed(), linkele_(nullptr), - bspotforces_(2, Core::LinAlg::SerialDenseVector(true)) + bspotforces_(2, Core::LinAlg::SerialDenseVector(3, true)) { } @@ -48,7 +48,7 @@ BeamInteraction::BeamLinkTruss::BeamLinkTruss() *----------------------------------------------------------------------*/ BeamInteraction::BeamLinkTruss::BeamLinkTruss(const BeamInteraction::BeamLinkTruss& old) : BeamInteraction::BeamLinkPinJointed(old), - bspotforces_(2, Core::LinAlg::SerialDenseVector(true)) + bspotforces_(2, Core::LinAlg::SerialDenseVector(3, true)) { if (linkele_ != nullptr) linkele_ = std::dynamic_pointer_cast( diff --git a/src/core/fem/src/discretization/4C_fem_discretization.cpp b/src/core/fem/src/discretization/4C_fem_discretization.cpp index c936109255c..b746cdee5b6 100644 --- a/src/core/fem/src/discretization/4C_fem_discretization.cpp +++ b/src/core/fem/src/discretization/4C_fem_discretization.cpp @@ -563,12 +563,13 @@ void Core::FE::Discretization::replace_dof_set( /*----------------------------------------------------------------------* *----------------------------------------------------------------------*/ -std::map>* Core::FE::Discretization::get_all_pbc_coupled_col_nodes() +const std::map>* Core::FE::Discretization::get_all_pbc_coupled_col_nodes() + const { // check for pbcs for (int nds = 0; nds < num_dof_sets(); nds++) { - std::shared_ptr pbcdofset = + std::shared_ptr pbcdofset = std::dynamic_pointer_cast(dofsets_[nds]); if (pbcdofset != nullptr) @@ -584,8 +585,8 @@ std::map>* Core::FE::Discretization::get_all_pbc_coupled_c /*----------------------------------------------------------------------* *----------------------------------------------------------------------*/ -std::shared_ptr> -Core::FE::Discretization::get_pbc_slave_to_master_node_connectivity() +std::shared_ptr> +Core::FE::Discretization::get_pbc_slave_to_master_node_connectivity() const { // check for pbcs for (int nds = 0; nds < num_dof_sets(); nds++) diff --git a/src/core/fem/src/discretization/4C_fem_discretization.hpp b/src/core/fem/src/discretization/4C_fem_discretization.hpp index b8f8c15e360..89ae51abcdf 100644 --- a/src/core/fem/src/discretization/4C_fem_discretization.hpp +++ b/src/core/fem/src/discretization/4C_fem_discretization.hpp @@ -622,12 +622,12 @@ namespace Core::FE /*! \brief Get master to slave coupling in case of periodic boundary conditions */ - std::map>* get_all_pbc_coupled_col_nodes(); + const std::map>* get_all_pbc_coupled_col_nodes() const; /*! \brief Get slave to master connectivity in case of periodic boundary conditions */ - std::shared_ptr> get_pbc_slave_to_master_node_connectivity(); + std::shared_ptr> get_pbc_slave_to_master_node_connectivity() const; //@} diff --git a/src/core/fem/src/discretization/4C_fem_discretization_faces.cpp b/src/core/fem/src/discretization/4C_fem_discretization_faces.cpp index 44b73af8ea2..ef2edcd2910 100644 --- a/src/core/fem/src/discretization/4C_fem_discretization_faces.cpp +++ b/src/core/fem/src/discretization/4C_fem_discretization_faces.cpp @@ -239,7 +239,7 @@ void Core::FE::DiscretizationFaces::build_faces(const bool verbose) std::map, std::shared_ptr> faces; // get pbcs - std::map>* col_pbcmapmastertoslave = get_all_pbc_coupled_col_nodes(); + const std::map>* col_pbcmapmastertoslave = get_all_pbc_coupled_col_nodes(); std::map, InternalFacesData>::iterator face_it; for (face_it = surfmapdata.begin(); face_it != surfmapdata.end(); ++face_it) @@ -383,11 +383,11 @@ void Core::FE::DiscretizationFaces::build_faces(const bool verbose) for (std::size_t rr = 0; rr < mymasternodeids.size(); rr++) { // this master node has one slave node - if (((*col_pbcmapmastertoslave)[mymasternodeids[rr]]).size() == 1) + if (((*col_pbcmapmastertoslave).at(mymasternodeids[rr])).size() == 1) { - myslavenodeids.push_back(((*col_pbcmapmastertoslave)[mymasternodeids[rr]])[0]); + myslavenodeids.push_back(((*col_pbcmapmastertoslave).at(mymasternodeids[rr]))[0]); local_pbcmapmastertoslave[mymasternodeids[rr]] = - ((*col_pbcmapmastertoslave)[mymasternodeids[rr]])[0]; + ((*col_pbcmapmastertoslave).at(mymasternodeids[rr]))[0]; } // this master node has several slave nodes // it is a corner or edge node of two or three pbc sets @@ -443,7 +443,7 @@ void Core::FE::DiscretizationFaces::build_faces(const bool verbose) // this special case is marked by flag bool three_sets_edge_node = false; if (numpbcpairs == 3 and - ((*col_pbcmapmastertoslave)[mymasternodeids[rr]]).size() == 3) + ((*col_pbcmapmastertoslave).at(mymasternodeids[rr])).size() == 3) three_sets_edge_node = true; // pbc id of master face also for the slave @@ -459,10 +459,10 @@ void Core::FE::DiscretizationFaces::build_faces(const bool verbose) // check which node fulfills above conditions int actslaveid = -999; for (std::size_t islave = 0; - islave < ((*col_pbcmapmastertoslave)[mymasternodeids[rr]]).size(); islave++) + islave < ((*col_pbcmapmastertoslave).at(mymasternodeids[rr])).size(); islave++) { // get id - actslaveid = ((*col_pbcmapmastertoslave)[mymasternodeids[rr]])[islave]; + actslaveid = ((*col_pbcmapmastertoslave).at(mymasternodeids[rr]))[islave]; // check first criterion -> (i) if ((slavetopbcset[slavepbcid]).find(actslaveid) != @@ -547,7 +547,7 @@ void Core::FE::DiscretizationFaces::build_faces(const bool verbose) // first, look for masters with more than one slave // then, check whether node id (i.e. actnodeid) is contained in slave list - std::map>::iterator master_it; + std::map>::const_iterator master_it; for (master_it = col_pbcmapmastertoslave->begin(); master_it != col_pbcmapmastertoslave->end(); master_it++) { diff --git a/src/core/fem/src/discretization/4C_fem_discretization_partition.cpp b/src/core/fem/src/discretization/4C_fem_discretization_partition.cpp index 2e7930ab5a8..851c3c543de 100644 --- a/src/core/fem/src/discretization/4C_fem_discretization_partition.cpp +++ b/src/core/fem/src/discretization/4C_fem_discretization_partition.cpp @@ -569,7 +569,7 @@ void Core::FE::Discretization::extended_ghosting(const Core::LinAlg::Map& elecol { have_pbc = true; // fill content of pbcmap int std::map > in preparation for gather_all - std::map>* tmp = pbcdofset->get_coupled_nodes(); + const std::map>* tmp = pbcdofset->get_coupled_nodes(); for (auto& [gid, nodes] : *tmp) pbcmap[gid].insert(nodes.begin(), nodes.end()); // it is assumed that, if one pbc set is available, all other potential dofsets hold the same diff --git a/src/core/fem/src/discretization/4C_fem_discretization_utils.cpp b/src/core/fem/src/discretization/4C_fem_discretization_utils.cpp index ebe9d8a975e..41563a6ce05 100644 --- a/src/core/fem/src/discretization/4C_fem_discretization_utils.cpp +++ b/src/core/fem/src/discretization/4C_fem_discretization_utils.cpp @@ -7,6 +7,7 @@ #include "4C_fem_discretization_utils.hpp" +#include "4C_comm_mpi_utils.hpp" #include "4C_fem_discretization.hpp" #include "4C_fem_general_element.hpp" #include "4C_fem_general_node.hpp" @@ -48,6 +49,57 @@ std::shared_ptr> Core::FE::extract_node_coordi return coordinates; } +std::unique_ptr> Core::FE::extract_retained_node_coordinates( + const Discretization& discretization, const Core::LinAlg::Map& node_row_map) +{ + std::set skipped_nodes = {}; + if (discretization.get_pbc_slave_to_master_node_connectivity()) + { + const auto& pbcconnectivity = *(discretization.get_pbc_slave_to_master_node_connectivity()); + for (const auto& [slave, _] : pbcconnectivity) + { + skipped_nodes.insert(slave); + } + } + std::set fully_redundant_skipped_nodes = + Core::Communication::all_reduce(skipped_nodes, node_row_map.get_comm()); + + std::vector my_filtered_global_node_ids{}; + my_filtered_global_node_ids.reserve(node_row_map.num_my_elements()); + for (int lid = 0; lid < node_row_map.num_my_elements(); ++lid) + { + const int gid = node_row_map.gid(lid); + + // filter pbc slave nodes + if (fully_redundant_skipped_nodes.contains(gid)) continue; + my_filtered_global_node_ids.emplace_back(gid); + } + Core::LinAlg::Map filtered_row_map( + node_row_map.num_global_elements() - static_cast(fully_redundant_skipped_nodes.size()), + static_cast(my_filtered_global_node_ids.size()), my_filtered_global_node_ids.data(), 0, + node_row_map.get_comm()); + + std::unique_ptr> coordinates = + std::make_unique>(filtered_row_map, 3, true); + + for (int lid = 0; lid < filtered_row_map.num_my_elements(); ++lid) + { + const int gid = filtered_row_map.gid(lid); + if (!discretization.have_global_node(gid)) continue; + + auto x = discretization.g_node(gid)->x(); + for (size_t dim = 0; dim < 3; ++dim) + { + if (dim >= discretization.n_dim()) + coordinates->replace_local_value(lid, dim, 0.0); + else + coordinates->replace_local_value(lid, dim, x[dim]); + } + } + + return coordinates; +} + /*----------------------------------------------------------------------------* *----------------------------------------------------------------------------*/ diff --git a/src/core/fem/src/discretization/4C_fem_discretization_utils.hpp b/src/core/fem/src/discretization/4C_fem_discretization_utils.hpp index 14805793910..c3d101eb48f 100644 --- a/src/core/fem/src/discretization/4C_fem_discretization_utils.hpp +++ b/src/core/fem/src/discretization/4C_fem_discretization_utils.hpp @@ -60,6 +60,17 @@ namespace Core::FE std::shared_ptr> extract_node_coordinates( const Core::FE::Discretization& discretization, const Core::LinAlg::Map& node_row_map); + /** + * Similar to the other extract_node_coordinates function, but allows to specify a node row map + * and filters all eliminated nodes (e.g., in periodic boundary conditions). + * + * @note Eliminated nodes (e.g., when using periodic boundary conditions) are skipped. + * + * The map has to be a submap of the overall full node rowmap of this discretization. + */ + std::unique_ptr> extract_retained_node_coordinates( + const Core::FE::Discretization& discretization, const Core::LinAlg::Map& node_row_map); + /** \brief Evaluate the elements of the given discretization and fill the * system matrix and vector diff --git a/src/core/fem/src/dofset/4C_fem_dofset_pbc.hpp b/src/core/fem/src/dofset/4C_fem_dofset_pbc.hpp index 09ab3398f4c..fdd77fdab6e 100644 --- a/src/core/fem/src/dofset/4C_fem_dofset_pbc.hpp +++ b/src/core/fem/src/dofset/4C_fem_dofset_pbc.hpp @@ -70,10 +70,14 @@ namespace Core::DOFSets virtual void set_coupled_nodes(std::shared_ptr>> couplednodes); /// Get coupled nodes map (corresponding col format) - std::map>* get_coupled_nodes() { return perbndcouples_.get(); } + [[nodiscard]] const std::map>* get_coupled_nodes() const + { + return perbndcouples_.get(); + } /// Get connectivity map between slave node and its master node - virtual std::shared_ptr> get_slave_to_master_node_connectivity() + [[nodiscard]] virtual std::shared_ptr> + get_slave_to_master_node_connectivity() const { return perbnd_slavetomaster_; }; diff --git a/src/core/fem/src/general/utils/4C_fem_general_l2_projection.cpp b/src/core/fem/src/general/utils/4C_fem_general_l2_projection.cpp index 769d2fedf70..f0a7fc8c6ce 100644 --- a/src/core/fem/src/general/utils/4C_fem_general_l2_projection.cpp +++ b/src/core/fem/src/general/utils/4C_fem_general_l2_projection.cpp @@ -135,7 +135,7 @@ std::shared_ptr> Core::FE::compute_nodal_l2_pr // build inverse map from slave to master nodes std::map slavetomastercolnodesmap; - std::map>* allcoupledcolnodes = dis.get_all_pbc_coupled_col_nodes(); + const std::map>* allcoupledcolnodes = dis.get_all_pbc_coupled_col_nodes(); if (allcoupledcolnodes) { for (auto [master_gid, slave_gids] : *allcoupledcolnodes) diff --git a/src/core/fem/src/general/utils/4C_fem_general_utils_superconvergent_patch_recovery.cpp b/src/core/fem/src/general/utils/4C_fem_general_utils_superconvergent_patch_recovery.cpp index b2978ab730d..d3bd8376578 100644 --- a/src/core/fem/src/general/utils/4C_fem_general_utils_superconvergent_patch_recovery.cpp +++ b/src/core/fem/src/general/utils/4C_fem_general_utils_superconvergent_patch_recovery.cpp @@ -41,7 +41,7 @@ std::shared_ptr> Core::FE::compute_superconver // handle pbcs if existing // build inverse map from slave to master nodes std::map slavetomastercolnodesmap; - std::map>* allcoupledcolnodes = dis.get_all_pbc_coupled_col_nodes(); + const std::map>* allcoupledcolnodes = dis.get_all_pbc_coupled_col_nodes(); if (allcoupledcolnodes) { @@ -432,8 +432,7 @@ std::shared_ptr> Core::FE::compute_superconver // this will result in off processor assembling (boundary node as ghost node) if (closestnode->owner() != myrank) continue; - std::map>::iterator masternode = - allcoupledcolnodes->find(closestnodeid); + auto masternode = allcoupledcolnodes->find(closestnodeid); int numslavenodes = -1; if (masternode != allcoupledcolnodes->end()) diff --git a/src/core/linear_solver/src/method/4C_linear_solver_method_parameters.cpp b/src/core/linear_solver/src/method/4C_linear_solver_method_parameters.cpp index e852ae8aef9..318f76c9889 100644 --- a/src/core/linear_solver/src/method/4C_linear_solver_method_parameters.cpp +++ b/src/core/linear_solver/src/method/4C_linear_solver_method_parameters.cpp @@ -86,9 +86,9 @@ void Core::LinearSolver::Parameters::compute_solver_parameters( { std::shared_ptr> coordinates; if (nullspace_node_map == nullptr) - coordinates = extract_node_coordinates(dis); + coordinates = extract_retained_node_coordinates(dis, *dis.node_row_map()); else - coordinates = extract_node_coordinates(dis, *nullspace_node_map); + coordinates = extract_retained_node_coordinates(dis, *nullspace_node_map); solverlist.set>>("Coordinates", coordinates); } diff --git a/src/fluid_ele/4C_fluid_ele.hpp b/src/fluid_ele/4C_fluid_ele.hpp index 3fe13a2a892..7d20cc8ea95 100644 --- a/src/fluid_ele/4C_fluid_ele.hpp +++ b/src/fluid_ele/4C_fluid_ele.hpp @@ -868,7 +868,7 @@ namespace Discret lm_masterNodeToPatch, ///< local map between master nodes and nodes in patch std::vector& lm_slaveNodeToPatch, ///< local map between slave nodes and nodes in patch - std::shared_ptr> + std::shared_ptr> pbcconnectivity ///< connectivity between slave and PBC's master nodes ); @@ -892,7 +892,7 @@ namespace Discret lm_masterNodeToPatch, ///< local map between master nodes and nodes in patch std::vector& lm_slaveNodeToPatch, ///< local map between slave nodes and nodes in patch - std::shared_ptr> + std::shared_ptr> pbcconnectivity ///< connectivity between slave and PBC's master nodes ); diff --git a/src/fluid_ele/4C_fluid_ele_intfaces.cpp b/src/fluid_ele/4C_fluid_ele_intfaces.cpp index 4cd27f989d1..a96df0bc36a 100644 --- a/src/fluid_ele/4C_fluid_ele_intfaces.cpp +++ b/src/fluid_ele/4C_fluid_ele_intfaces.cpp @@ -122,7 +122,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( std::vector& lm_faceToPatch, ///< local map between lm_face and lm_patch std::vector& lm_masterNodeToPatch, ///< local map between master nodes and nodes in patch std::vector& lm_slaveNodeToPatch, ///< local map between slave nodes and nodes in patch - std::shared_ptr> + std::shared_ptr> pbcconnectivity ///< connectivity between slave and PBC's master nodes ) { @@ -185,7 +185,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( if (has_PBC) // set the id of the master node if the node is a PBC node { - std::map::iterator slave_it = pbcconnectivity->find( + const auto slave_it = pbcconnectivity->find( nid); // find the slave node id, is there a corresponding pbc master node? if (slave_it != pbcconnectivity->end()) nid = slave_it->second; @@ -222,7 +222,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( if (has_PBC) // set the id of the master node if the node is a PBC node { - std::map::iterator slave_it = pbcconnectivity->find( + const auto slave_it = pbcconnectivity->find( nid); // find the slave node id, is there a corresponding pbc master node? if (slave_it != pbcconnectivity->end()) nid = slave_it->second; @@ -287,7 +287,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( if (has_PBC) // set the id of the master node if the node is a PBC node { - std::map::iterator slave_it = pbcconnectivity->find( + const auto slave_it = pbcconnectivity->find( nid); // find the slave node id, is there a corresponding pbc master node? if (slave_it != pbcconnectivity->end()) nid = slave_it->second; @@ -334,7 +334,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( std::vector& lm_faceToPatch, ///< local map between lm_face and lm_patch std::vector& lm_masterNodeToPatch, ///< local map between master nodes and nodes in patch std::vector& lm_slaveNodeToPatch, ///< local map between slave nodes and nodes in patch - std::shared_ptr> + std::shared_ptr> pbcconnectivity ///< connectivity between slave and PBC's master nodes ) { @@ -411,7 +411,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( if (has_PBC) // set the id of the master node if the node is a PBC node { - std::map::iterator slave_it = pbcconnectivity->find( + const auto slave_it = pbcconnectivity->find( nid); // find the slave node id, is there a corresponding pbc master node? if (slave_it != pbcconnectivity->end()) nid = slave_it->second; @@ -453,7 +453,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( if (has_PBC) // set the id of the master node if the node is a PBC node { - std::map::iterator slave_it = pbcconnectivity->find( + const auto slave_it = pbcconnectivity->find( nid); // find the slave node id, is there a corresponding pbc master node? if (slave_it != pbcconnectivity->end()) nid = slave_it->second; @@ -523,7 +523,7 @@ void Discret::Elements::FluidIntFace::patch_location_vector( if (has_PBC) // set the id of the master node if the node is a PBC node { - std::map::iterator slave_it = pbcconnectivity->find( + const auto slave_it = pbcconnectivity->find( nid); // find the slave node id, is there a corresponding pbc master node? if (slave_it != pbcconnectivity->end()) nid = slave_it->second; diff --git a/src/fluid_ele/4C_fluid_ele_intfaces_calc.cpp b/src/fluid_ele/4C_fluid_ele_intfaces_calc.cpp index bd9cfd47f76..15e7ae7e03b 100644 --- a/src/fluid_ele/4C_fluid_ele_intfaces_calc.cpp +++ b/src/fluid_ele/4C_fluid_ele_intfaces_calc.cpp @@ -134,7 +134,7 @@ void Discret::Elements::FluidIntFaceImpl::assemble_internal_faces_using //---------------------- check for PBCS ------------------ - std::shared_ptr> pbcconnectivity = + std::shared_ptr> pbcconnectivity = discretization.get_pbc_slave_to_master_node_connectivity(); //----------------------- create patchlm ----------------- diff --git a/src/fluid_turbulence/4C_fluid_turbulence_boxfilter.cpp b/src/fluid_turbulence/4C_fluid_turbulence_boxfilter.cpp index e0890cab937..8b5516ddb3b 100644 --- a/src/fluid_turbulence/4C_fluid_turbulence_boxfilter.cpp +++ b/src/fluid_turbulence/4C_fluid_turbulence_boxfilter.cpp @@ -433,7 +433,7 @@ void FLD::Boxfilter::apply_box_filter( double expression_val; double alpha2_val; - std::map>* pbcmapmastertoslave = + const std::map>* pbcmapmastertoslave = discret_->get_all_pbc_coupled_col_nodes(); // loop all master nodes on this proc if (pbcmapmastertoslave) @@ -1170,7 +1170,7 @@ void FLD::Boxfilter::apply_box_filter_scatra( double phiexpression_val = 0.0; // loop all master nodes on this proc - std::map>* pbcmapmastertoslave = + const std::map>* pbcmapmastertoslave = scatradiscret_->get_all_pbc_coupled_col_nodes(); // loop all master nodes on this proc if (pbcmapmastertoslave) diff --git a/src/scatra/4C_scatra_timint_implicit_service.cpp b/src/scatra/4C_scatra_timint_implicit_service.cpp index ea756e5fbcf..ab89c561731 100644 --- a/src/scatra/4C_scatra_timint_implicit_service.cpp +++ b/src/scatra/4C_scatra_timint_implicit_service.cpp @@ -964,7 +964,7 @@ void ScaTra::ScaTraTimIntImpl::compute_null_space_if_necessary() const mllist.set>>("nullspace", nullspace); std::shared_ptr> coordinates = - extract_node_coordinates(*discret_); + extract_retained_node_coordinates(*discret_, *discret_->node_row_map()); mllist.set>>("Coordinates", coordinates); } diff --git a/src/scatra/4C_scatra_timint_meshtying_strategy_s2i.cpp b/src/scatra/4C_scatra_timint_meshtying_strategy_s2i.cpp index c18718a323e..2b400d48597 100644 --- a/src/scatra/4C_scatra_timint_meshtying_strategy_s2i.cpp +++ b/src/scatra/4C_scatra_timint_meshtying_strategy_s2i.cpp @@ -3661,8 +3661,9 @@ void ScaTra::MeshtyingStrategyS2I::equip_extended_solver_with_null_space_info() // build the coordinate object related to the growth dofs const auto growth_cond_node_row_map = Core::Conditions::condition_node_row_map( *scatratimint_->discretization(), "S2IKineticsGrowth"); - const auto coordinates = - extract_node_coordinates(*scatratimint_->discretization(), *growth_cond_node_row_map); + const std::shared_ptr> coordinates = + extract_retained_node_coordinates( + *scatratimint_->discretization(), *growth_cond_node_row_map); mllist.set>>("Coordinates", coordinates); mllist.set>>("nullspace", nullspace); diff --git a/src/sti/4C_sti_monolithic.cpp b/src/sti/4C_sti_monolithic.cpp index 9d800f18de9..77f5e83ca92 100644 --- a/src/sti/4C_sti_monolithic.cpp +++ b/src/sti/4C_sti_monolithic.cpp @@ -1240,7 +1240,8 @@ void STI::Monolithic::compute_null_space_if_necessary(Teuchos::ParameterList& so mllist.set>>("nullspace", nullspace); std::shared_ptr> coordinates = - extract_node_coordinates(*scatra_field()->discretization()); + extract_retained_node_coordinates( + *scatra_field()->discretization(), *scatra_field()->discretization()->node_row_map()); mllist.set>>("Coordinates", coordinates); }