Skip to content

Commit cec7887

Browse files
authored
v2.7 (#98)
1 parent 3c5365c commit cec7887

File tree

597 files changed

+12013
-11598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

597 files changed

+12013
-11598
lines changed

.github/workflows/dev-mkl-vtk.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
./suanPan-linux-mkl-vtk/bin/suanPan -v
3333
- uses: actions/upload-artifact@v3
3434
with:
35-
name: suanPan-2.6.1-1.x86_64.deb
36-
path: suanPan-2.6.1-1.x86_64.deb
35+
name: suanPan-2.7.0-1.x86_64.deb
36+
path: suanPan-2.7.0-1.x86_64.deb
3737
fedora-mkl-vtk-dev:
3838
runs-on: ubuntu-22.04
3939
container: fedora:35
@@ -66,10 +66,10 @@ jobs:
6666
make package -j"$(nproc)"
6767
- name: Test
6868
run: |
69-
dnf install ./suanPan-2.6.1-1.x86_64.rpm -y
69+
dnf install ./suanPan-2.7.0-1.x86_64.rpm -y
7070
suanPan -v
7171
- name: Upload
7272
uses: actions/upload-artifact@v3
7373
with:
74-
name: suanPan-2.6.1-1.x86_64.rpm
75-
path: suanPan-2.6.1-1.x86_64.rpm
74+
name: suanPan-2.7.0-1.x86_64.rpm
75+
path: suanPan-2.7.0-1.x86_64.rpm

.github/workflows/dev-vtk.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
./suanPan-linux-openblas-vtk/bin/suanPan -v
3030
- uses: actions/upload-artifact@v3
3131
with:
32-
name: suanPan-2.6.1-1.x86_64.deb
33-
path: suanPan-2.6.1-1.x86_64.deb
32+
name: suanPan-2.7.0-1.x86_64.deb
33+
path: suanPan-2.7.0-1.x86_64.deb
3434
macos-openblas-vtk-dev:
3535
runs-on: macos-11
3636
steps:
@@ -53,3 +53,29 @@ jobs:
5353
run: |
5454
export DYLD_LIBRARY_PATH=/Users/runner/work/suanPan/suanPan/suanPan-macos-openblas-vtk/lib/
5555
./suanPan-macos-openblas-vtk/bin/suanPan -v
56+
windows-openblas-vtk-dev:
57+
runs-on: windows-2022
58+
steps:
59+
- name: Clone
60+
uses: actions/checkout@v3
61+
- name: Install VTK
62+
run: |
63+
C:/msys64/usr/bin/wget.exe https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.2-win.7z
64+
7z x VTK-9.2.2-win.7z
65+
- name: Golang
66+
uses: actions/setup-go@v3
67+
- name: Compile
68+
run: |
69+
go build Checker/updater.go
70+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MULTITHREAD=ON -DUSE_HDF5=ON -DUSE_EXTERNAL_VTK=ON -DVTK_DIR=D:/a/suanPan/suanPan/lib/cmake/vtk-9.2/ -DCMAKE_INSTALL_PREFIX=suanPan-win-openblas-vtk .
71+
cmake --build . --target INSTALL --config Release
72+
- name: Pack
73+
run: |
74+
cp updater.exe suanPan-win-openblas-vtk/bin
75+
cd suanPan-win-openblas-vtk/bin
76+
7z a ../../suanPan-win-openblas-vtk.7z ./*
77+
./suanPan.exe -v
78+
- uses: actions/upload-artifact@v3
79+
with:
80+
name: suanPan-win-openblas-vtk.7z
81+
path: suanPan-win-openblas-vtk.7z

.github/workflows/master-mkl-vtk.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
tar czf suanPan-linux-mkl-vtk.tar.gz suanPan-linux-mkl-vtk
3333
- name: Test
3434
run: |
35-
sudo apt-get install ./suanPan-2.6.1-1.x86_64.deb -y
35+
sudo apt-get install ./suanPan-2.7.0-1.x86_64.deb -y
3636
suanPan -v
3737
export LD_LIBRARY_PATH=/home/runner/work/suanPan/suanPan/suanPan-linux-mkl-vtk/lib
3838
cd suanPan-linux-mkl-vtk/bin
@@ -50,8 +50,8 @@ jobs:
5050
uses: svenstaro/upload-release-action@v2
5151
with:
5252
repo_token: ${{ secrets.GITHUB_TOKEN }}
53-
file: suanPan-2.6.1-1.x86_64.deb
54-
asset_name: suanPan-2.6.1-1.x86_64.deb
53+
file: suanPan-2.7.0-1.x86_64.deb
54+
asset_name: suanPan-2.7.0-1.x86_64.deb
5555
tag: ${{ env.SP_TIME }}
5656
prerelease: true
5757
overwrite: true
@@ -87,14 +87,14 @@ jobs:
8787
make package -j"$(nproc)"
8888
- name: Test
8989
run: |
90-
dnf install ./suanPan-2.6.1-1.x86_64.rpm -y
90+
dnf install ./suanPan-2.7.0-1.x86_64.rpm -y
9191
suanPan -v
9292
- name: RPM
9393
uses: svenstaro/upload-release-action@v2
9494
with:
9595
repo_token: ${{ secrets.GITHUB_TOKEN }}
96-
file: suanPan-2.6.1-1.x86_64.rpm
97-
asset_name: suanPan-2.6.1-1.x86_64.rpm
96+
file: suanPan-2.7.0-1.x86_64.rpm
97+
asset_name: suanPan-2.7.0-1.x86_64.rpm
9898
tag: ${{ env.SP_TIME }}
9999
prerelease: true
100100
overwrite: true

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
1. `MKL` includes outdated `FEAST`, the external names in `FEAST` library are modified to avoid linking error.
66
2. `OpenBLAS` causes SEGFAULT with version 0.3.15+ when compiled with `DYNAMIC_ARCH` enabled.
77

8+
## version 2.7
9+
10+
1. optimise assembling of symmetric global matrices [#79](https://github.com/TLCFEM/suanPan/pull/79)
11+
2. extend `BatheTwoStep` to allow customisation of spectral radius [#81](https://github.com/TLCFEM/suanPan/pull/81) and sub-step size [#82](https://github.com/TLCFEM/suanPan/pull/82)
12+
3. update `Catch2` to version `2.13.10`
13+
4. update `Armadillo` to version `11.4`
14+
5. update modern `Arpack` [#94](https://github.com/TLCFEM/suanPan/pull/94)
15+
6. add `Tchamwa` [#88](https://github.com/TLCFEM/suanPan/pull/88), `BatheExplicit` [#90](https://github.com/TLCFEM/suanPan/pull/90) and `GeneralisedAlphaExplicit` [#93](https://github.com/TLCFEM/suanPan/pull/93) explicit time integration methods
16+
7. add `OALTS` two-step implicit time integration method [#92](https://github.com/TLCFEM/suanPan/pull/92)
17+
8. add `Sinh1D` and `Tanh1D` nonlinear elastic 1D material
18+
9. add `linear_system` flag to speed up linear system analysis
19+
820
## version 2.6.1
921

1022
1. add `-nu` (`--noupdate`) flag to skip check of new version on startup

CITATION.cff

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ keywords:
2828
- IGA
2929
- Solid Mechanics
3030
license: GPL-3.0
31-
version: '2.5'
32-
date-released: '2022-08-13'
31+
version: '2.6.1'
32+
date-released: '2022-11-09'

CMakeLists.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,13 @@ if (FORTRAN_STATUS)
7979
add_subdirectory(Toolbox/amd-src)
8080
add_subdirectory(Toolbox/arpack-src)
8181
add_subdirectory(Toolbox/feast-src)
82-
add_subdirectory(Toolbox/lapack-ext)
8382
add_subdirectory(Toolbox/mumps-src)
8483
add_subdirectory(Toolbox/fext)
85-
target_link_libraries(${PROJECT_NAME} amd arpack spmm mumps feast)
86-
message("Linking additional amd arpack spmm mumps feast")
84+
target_link_libraries(${PROJECT_NAME} amd arpack mumps feast)
85+
message("Linking additional amd arpack mumps feast")
8786
elseif (COMPILER_IDENTIFIER MATCHES "vs")
8887
target_link_libraries(${PROJECT_NAME} libfext)
89-
message("Linking precompiled fext (packed with amd arpack spmm mumps feast)")
88+
message("Linking precompiled fext (packed with amd arpack mumps feast)")
9089
else ()
9190
message(FATAL_ERROR "Please install a valid FORTRAN compiler.")
9291
endif ()
@@ -346,7 +345,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
346345
set(CPACK_PACKAGE_ICON ${ROOT}/Resource/suanPan-ua.svg)
347346
set(CPACK_PACKAGE_RELEASE 1)
348347
set(CPACK_PACKAGE_VENDOR "tlcfem")
349-
set(CPACK_PACKAGE_VERSION "2.6.1")
348+
set(CPACK_PACKAGE_VERSION "2.7.0")
350349
set(CPACK_PACKAGE_DESCRIPTION "An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework")
351350
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/TLCFEM/suanPan")
352351

Constraint/BC/MultiplierBC.cpp

+24-14
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "MultiplierBC.h"
1919
#include <Domain/DomainBase.h>
2020
#include <Domain/Factory.hpp>
21+
#include <Step/Step.h>
22+
#include <Solver/Integrator/Integrator.h>
2123

2224
/**
2325
* \brief method to apply the BC to the system.
@@ -31,21 +33,29 @@ int MultiplierBC::process(const shared_ptr<DomainBase>& D) {
3133
// the container used is concurrently safe
3234
D->insert_restrained_dof(dof_encoding = get_nodal_active_dof(D));
3335

34-
if(auto& t_stiff = W->get_stiffness(); nullptr != t_stiff) {
35-
std::scoped_lock lock(W->get_stiffness_mutex());
36-
for(const auto I : dof_encoding) t_stiff->unify(I);
36+
if(IntegratorType::Explicit == D->get_current_step()->get_integrator()->type()) {
37+
if(auto& t_mass = W->get_mass(); nullptr != t_mass) {
38+
std::scoped_lock lock(W->get_mass_mutex());
39+
for(const auto I : dof_encoding) t_mass->unify(I);
40+
}
3741
}
38-
if(auto& t_mass = W->get_mass(); nullptr != t_mass) {
39-
std::scoped_lock lock(W->get_mass_mutex());
40-
for(const auto I : dof_encoding) t_mass->nullify(I);
41-
}
42-
if(auto& t_damping = W->get_damping(); nullptr != t_damping) {
43-
std::scoped_lock lock(W->get_damping_mutex());
44-
for(const auto I : dof_encoding) t_damping->nullify(I);
45-
}
46-
if(auto& t_geometry = W->get_geometry(); nullptr != t_geometry) {
47-
std::scoped_lock lock(W->get_geometry_mutex());
48-
for(const auto I : dof_encoding) t_geometry->nullify(I);
42+
else {
43+
if(auto& t_stiff = W->get_stiffness(); nullptr != t_stiff) {
44+
std::scoped_lock lock(W->get_stiffness_mutex());
45+
for(const auto I : dof_encoding) t_stiff->unify(I);
46+
}
47+
if(auto& t_mass = W->get_mass(); nullptr != t_mass) {
48+
std::scoped_lock lock(W->get_mass_mutex());
49+
for(const auto I : dof_encoding) t_mass->nullify(I);
50+
}
51+
if(auto& t_damping = W->get_damping(); nullptr != t_damping) {
52+
std::scoped_lock lock(W->get_damping_mutex());
53+
for(const auto I : dof_encoding) t_damping->nullify(I);
54+
}
55+
if(auto& t_geometry = W->get_geometry(); nullptr != t_geometry) {
56+
std::scoped_lock lock(W->get_geometry_mutex());
57+
for(const auto I : dof_encoding) t_geometry->nullify(I);
58+
}
4959
}
5060

5161
return SUANPAN_SUCCESS;

Constraint/LJPotential2D.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
class LJPotential2D final : public ParticleCollision2D {
3535
[[nodiscard]] double compute_f(double) const override;
3636
[[nodiscard]] double compute_df(double) const override;
37+
3738
public:
3839
using ParticleCollision2D::ParticleCollision2D;
3940
};

Constraint/LinearSpring2D.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
class LinearSpring2D final : public ParticleCollision2D {
3535
[[nodiscard]] double compute_f(double) const override;
3636
[[nodiscard]] double compute_df(double) const override;
37+
3738
public:
3839
using ParticleCollision2D::ParticleCollision2D;
3940
};

Constraint/RestitutionWallPenalty.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ int RestitutionWallPenalty::process(const shared_ptr<DomainBase>& D) {
6464
resistance.zeros(W->get_size());
6565
auto counter = 0llu;
6666
for(const auto& I : node_pool) {
67-
if(dot(current_velocity_handler(I), outer_norm) > 0.) continue;
6867
const auto c_vel = current_velocity_handler(I);
6968
if(dot(c_vel, outer_norm) > 0.) continue;
7069
auto& t_dof = I->get_reordered_dof();
@@ -85,7 +84,7 @@ int RestitutionWallPenalty::process(const shared_ptr<DomainBase>& D) {
8584
return SUANPAN_SUCCESS;
8685
}
8786

88-
int RestitutionWallPenalty::stage(const shared_ptr<DomainBase>& D) {
87+
void RestitutionWallPenalty::stage(const shared_ptr<DomainBase>& D) {
8988
auto& W = D->get_factory();
9089

9190
auto trial_acceleration = get_trial_acceleration(W);
@@ -97,8 +96,6 @@ int RestitutionWallPenalty::stage(const shared_ptr<DomainBase>& D) {
9796
}
9897

9998
W->update_trial_acceleration(trial_acceleration);
100-
101-
return SUANPAN_SUCCESS;
10299
}
103100

104101
void RestitutionWallPenalty::commit_status() { node_pool.clear(); }

Constraint/RestitutionWallPenalty.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class RestitutionWallPenalty : public RigidWallPenalty {
3838
suanpan::set<shared_ptr<Node>> node_pool;
3939

4040
const double restitution_coefficient;
41+
4142
public:
4243
RestitutionWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, double, double, unsigned);
4344
RestitutionWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, vec&&, double, double, unsigned);
@@ -46,7 +47,7 @@ class RestitutionWallPenalty : public RigidWallPenalty {
4647

4748
int process(const shared_ptr<DomainBase>&) override;
4849

49-
int stage(const shared_ptr<DomainBase>&) override;
50+
void stage(const shared_ptr<DomainBase>&) override;
5051

5152
void commit_status() override;
5253
void clear_status() override;

Constraint/RigidWallPenalty.h

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class RigidWallPenalty : public Constraint {
5151
Col<double> (*trial_displacement_handler)(const shared_ptr<Node>&) = nullptr;
5252
Col<double> (*trial_velocity_handler)(const shared_ptr<Node>&) = nullptr;
5353
Col<double> (*trial_acceleration_handler)(const shared_ptr<Node>&) = nullptr;
54+
5455
public:
5556
RigidWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, double, unsigned);
5657
RigidWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, vec&&, double, unsigned);

Converger/AbsDisp.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <Domain/Factory.hpp>
2121

2222
/**
23-
* \brief the complete constructor.
23+
* \brief The complete constructor.
2424
* \param T `unique_tag`
2525
* \param E `tolerance`
2626
* \param M `max_iteration`
@@ -31,8 +31,10 @@ AbsDisp::AbsDisp(const unsigned T, const double E, const unsigned M, const bool
3131

3232
unique_ptr<Converger> AbsDisp::get_copy() { return make_unique<AbsDisp>(*this); }
3333

34-
bool AbsDisp::is_converged() {
35-
set_error(norm(get_domain().lock()->get_factory()->get_incre_displacement()));
34+
bool AbsDisp::is_converged(unsigned) {
35+
auto& W = get_domain().lock()->get_factory();
36+
37+
set_error(norm(W->get_incre_displacement() + W->get_ninja()) / static_cast<double>(W->get_size()));
3638
set_conv_flag(get_tolerance() > get_error());
3739

3840
if(is_print()) suanpan_info("absolute displacement error: %.5E.\n", get_error());

Converger/AbsDisp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AbsDisp final : public Converger {
4444

4545
unique_ptr<Converger> get_copy() override;
4646

47-
bool is_converged() override;
47+
bool is_converged(unsigned) override;
4848
};
4949

5050
#endif

Converger/AbsError.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ unique_ptr<Converger> AbsError::get_copy() { return make_unique<AbsError>(*this)
3535
* \brief Method to return `conv_flag`.
3636
* \return `conv_flag`
3737
*/
38-
bool AbsError::is_converged() {
39-
set_error(get_domain().lock()->get_factory()->get_error());
38+
bool AbsError::is_converged(unsigned) {
39+
auto& W = get_domain().lock()->get_factory();
40+
41+
set_error(fabs(W->get_error()) / static_cast<double>(W->get_size()));
4042
set_conv_flag(get_tolerance() > get_error());
4143

4244
if(is_print()) suanpan_info("absolute error: %.5E.\n", get_error());

Converger/AbsError.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AbsError final : public Converger {
4545

4646
unique_ptr<Converger> get_copy() override;
4747

48-
bool is_converged() override;
48+
bool is_converged(unsigned) override;
4949
};
5050

5151
#endif

Converger/AbsIncreAcc.cpp

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*******************************************************************************
2+
* Copyright (C) 2017-2022 Theodore Chang
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
******************************************************************************/
17+
18+
#include "AbsIncreAcc.h"
19+
#include <Domain/DomainBase.h>
20+
#include <Domain/Factory.hpp>
21+
22+
/**
23+
* \brief The default constructor.
24+
* \param T `unique_tag`
25+
* \param E `tolerance`
26+
* \param M `max_iteration`
27+
* \param P `print_flag`
28+
*/
29+
AbsIncreAcc::AbsIncreAcc(const unsigned T, const double E, const unsigned M, const bool P)
30+
: Converger(T, E, M, P) {}
31+
32+
unique_ptr<Converger> AbsIncreAcc::get_copy() { return make_unique<AbsIncreAcc>(*this); }
33+
34+
/**
35+
* \brief Method to return `conv_flag`.
36+
* \return `conv_flag`
37+
*/
38+
bool AbsIncreAcc::is_converged(unsigned) {
39+
auto& W = get_domain().lock()->get_factory();
40+
41+
set_error(norm(W->get_ninja()) / static_cast<double>(W->get_size()));
42+
set_conv_flag(get_tolerance() > get_error());
43+
44+
if(is_print()) suanpan_info("absolute incremental acceleration error: %.5E.\n", get_error());
45+
46+
return get_conv_flag();
47+
}

0 commit comments

Comments
 (0)