Skip to content

Commit

Permalink
v2.7 (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM authored Dec 20, 2022
1 parent 3c5365c commit cec7887
Show file tree
Hide file tree
Showing 597 changed files with 12,013 additions and 11,598 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/dev-mkl-vtk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
./suanPan-linux-mkl-vtk/bin/suanPan -v
- uses: actions/upload-artifact@v3
with:
name: suanPan-2.6.1-1.x86_64.deb
path: suanPan-2.6.1-1.x86_64.deb
name: suanPan-2.7.0-1.x86_64.deb
path: suanPan-2.7.0-1.x86_64.deb
fedora-mkl-vtk-dev:
runs-on: ubuntu-22.04
container: fedora:35
Expand Down Expand Up @@ -66,10 +66,10 @@ jobs:
make package -j"$(nproc)"
- name: Test
run: |
dnf install ./suanPan-2.6.1-1.x86_64.rpm -y
dnf install ./suanPan-2.7.0-1.x86_64.rpm -y
suanPan -v
- name: Upload
uses: actions/upload-artifact@v3
with:
name: suanPan-2.6.1-1.x86_64.rpm
path: suanPan-2.6.1-1.x86_64.rpm
name: suanPan-2.7.0-1.x86_64.rpm
path: suanPan-2.7.0-1.x86_64.rpm
30 changes: 28 additions & 2 deletions .github/workflows/dev-vtk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
./suanPan-linux-openblas-vtk/bin/suanPan -v
- uses: actions/upload-artifact@v3
with:
name: suanPan-2.6.1-1.x86_64.deb
path: suanPan-2.6.1-1.x86_64.deb
name: suanPan-2.7.0-1.x86_64.deb
path: suanPan-2.7.0-1.x86_64.deb
macos-openblas-vtk-dev:
runs-on: macos-11
steps:
Expand All @@ -53,3 +53,29 @@ jobs:
run: |
export DYLD_LIBRARY_PATH=/Users/runner/work/suanPan/suanPan/suanPan-macos-openblas-vtk/lib/
./suanPan-macos-openblas-vtk/bin/suanPan -v
windows-openblas-vtk-dev:
runs-on: windows-2022
steps:
- name: Clone
uses: actions/checkout@v3
- name: Install VTK
run: |
C:/msys64/usr/bin/wget.exe https://github.com/TLCFEM/prebuilds/releases/download/latest/VTK-9.2.2-win.7z
7z x VTK-9.2.2-win.7z
- name: Golang
uses: actions/setup-go@v3
- name: Compile
run: |
go build Checker/updater.go
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 .
cmake --build . --target INSTALL --config Release
- name: Pack
run: |
cp updater.exe suanPan-win-openblas-vtk/bin
cd suanPan-win-openblas-vtk/bin
7z a ../../suanPan-win-openblas-vtk.7z ./*
./suanPan.exe -v
- uses: actions/upload-artifact@v3
with:
name: suanPan-win-openblas-vtk.7z
path: suanPan-win-openblas-vtk.7z
12 changes: 6 additions & 6 deletions .github/workflows/master-mkl-vtk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
tar czf suanPan-linux-mkl-vtk.tar.gz suanPan-linux-mkl-vtk
- name: Test
run: |
sudo apt-get install ./suanPan-2.6.1-1.x86_64.deb -y
sudo apt-get install ./suanPan-2.7.0-1.x86_64.deb -y
suanPan -v
export LD_LIBRARY_PATH=/home/runner/work/suanPan/suanPan/suanPan-linux-mkl-vtk/lib
cd suanPan-linux-mkl-vtk/bin
Expand All @@ -50,8 +50,8 @@ jobs:
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: suanPan-2.6.1-1.x86_64.deb
asset_name: suanPan-2.6.1-1.x86_64.deb
file: suanPan-2.7.0-1.x86_64.deb
asset_name: suanPan-2.7.0-1.x86_64.deb
tag: ${{ env.SP_TIME }}
prerelease: true
overwrite: true
Expand Down Expand Up @@ -87,14 +87,14 @@ jobs:
make package -j"$(nproc)"
- name: Test
run: |
dnf install ./suanPan-2.6.1-1.x86_64.rpm -y
dnf install ./suanPan-2.7.0-1.x86_64.rpm -y
suanPan -v
- name: RPM
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: suanPan-2.6.1-1.x86_64.rpm
asset_name: suanPan-2.6.1-1.x86_64.rpm
file: suanPan-2.7.0-1.x86_64.rpm
asset_name: suanPan-2.7.0-1.x86_64.rpm
tag: ${{ env.SP_TIME }}
prerelease: true
overwrite: true
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
1. `MKL` includes outdated `FEAST`, the external names in `FEAST` library are modified to avoid linking error.
2. `OpenBLAS` causes SEGFAULT with version 0.3.15+ when compiled with `DYNAMIC_ARCH` enabled.

## version 2.7

1. optimise assembling of symmetric global matrices [#79](https://github.com/TLCFEM/suanPan/pull/79)
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)
3. update `Catch2` to version `2.13.10`
4. update `Armadillo` to version `11.4`
5. update modern `Arpack` [#94](https://github.com/TLCFEM/suanPan/pull/94)
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
7. add `OALTS` two-step implicit time integration method [#92](https://github.com/TLCFEM/suanPan/pull/92)
8. add `Sinh1D` and `Tanh1D` nonlinear elastic 1D material
9. add `linear_system` flag to speed up linear system analysis

## version 2.6.1

1. add `-nu` (`--noupdate`) flag to skip check of new version on startup
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ keywords:
- IGA
- Solid Mechanics
license: GPL-3.0
version: '2.5'
date-released: '2022-08-13'
version: '2.6.1'
date-released: '2022-11-09'
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ if (FORTRAN_STATUS)
add_subdirectory(Toolbox/amd-src)
add_subdirectory(Toolbox/arpack-src)
add_subdirectory(Toolbox/feast-src)
add_subdirectory(Toolbox/lapack-ext)
add_subdirectory(Toolbox/mumps-src)
add_subdirectory(Toolbox/fext)
target_link_libraries(${PROJECT_NAME} amd arpack spmm mumps feast)
message("Linking additional amd arpack spmm mumps feast")
target_link_libraries(${PROJECT_NAME} amd arpack mumps feast)
message("Linking additional amd arpack mumps feast")
elseif (COMPILER_IDENTIFIER MATCHES "vs")
target_link_libraries(${PROJECT_NAME} libfext)
message("Linking precompiled fext (packed with amd arpack spmm mumps feast)")
message("Linking precompiled fext (packed with amd arpack mumps feast)")
else ()
message(FATAL_ERROR "Please install a valid FORTRAN compiler.")
endif ()
Expand Down Expand Up @@ -346,7 +345,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(CPACK_PACKAGE_ICON ${ROOT}/Resource/suanPan-ua.svg)
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_PACKAGE_VENDOR "tlcfem")
set(CPACK_PACKAGE_VERSION "2.6.1")
set(CPACK_PACKAGE_VERSION "2.7.0")
set(CPACK_PACKAGE_DESCRIPTION "An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework")
set(CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/TLCFEM/suanPan")

Expand Down
38 changes: 24 additions & 14 deletions Constraint/BC/MultiplierBC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "MultiplierBC.h"
#include <Domain/DomainBase.h>
#include <Domain/Factory.hpp>
#include <Step/Step.h>
#include <Solver/Integrator/Integrator.h>

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

if(auto& t_stiff = W->get_stiffness(); nullptr != t_stiff) {
std::scoped_lock lock(W->get_stiffness_mutex());
for(const auto I : dof_encoding) t_stiff->unify(I);
if(IntegratorType::Explicit == D->get_current_step()->get_integrator()->type()) {
if(auto& t_mass = W->get_mass(); nullptr != t_mass) {
std::scoped_lock lock(W->get_mass_mutex());
for(const auto I : dof_encoding) t_mass->unify(I);
}
}
if(auto& t_mass = W->get_mass(); nullptr != t_mass) {
std::scoped_lock lock(W->get_mass_mutex());
for(const auto I : dof_encoding) t_mass->nullify(I);
}
if(auto& t_damping = W->get_damping(); nullptr != t_damping) {
std::scoped_lock lock(W->get_damping_mutex());
for(const auto I : dof_encoding) t_damping->nullify(I);
}
if(auto& t_geometry = W->get_geometry(); nullptr != t_geometry) {
std::scoped_lock lock(W->get_geometry_mutex());
for(const auto I : dof_encoding) t_geometry->nullify(I);
else {
if(auto& t_stiff = W->get_stiffness(); nullptr != t_stiff) {
std::scoped_lock lock(W->get_stiffness_mutex());
for(const auto I : dof_encoding) t_stiff->unify(I);
}
if(auto& t_mass = W->get_mass(); nullptr != t_mass) {
std::scoped_lock lock(W->get_mass_mutex());
for(const auto I : dof_encoding) t_mass->nullify(I);
}
if(auto& t_damping = W->get_damping(); nullptr != t_damping) {
std::scoped_lock lock(W->get_damping_mutex());
for(const auto I : dof_encoding) t_damping->nullify(I);
}
if(auto& t_geometry = W->get_geometry(); nullptr != t_geometry) {
std::scoped_lock lock(W->get_geometry_mutex());
for(const auto I : dof_encoding) t_geometry->nullify(I);
}
}

return SUANPAN_SUCCESS;
Expand Down
1 change: 1 addition & 0 deletions Constraint/LJPotential2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
class LJPotential2D final : public ParticleCollision2D {
[[nodiscard]] double compute_f(double) const override;
[[nodiscard]] double compute_df(double) const override;

public:
using ParticleCollision2D::ParticleCollision2D;
};
Expand Down
1 change: 1 addition & 0 deletions Constraint/LinearSpring2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
class LinearSpring2D final : public ParticleCollision2D {
[[nodiscard]] double compute_f(double) const override;
[[nodiscard]] double compute_df(double) const override;

public:
using ParticleCollision2D::ParticleCollision2D;
};
Expand Down
5 changes: 1 addition & 4 deletions Constraint/RestitutionWallPenalty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ int RestitutionWallPenalty::process(const shared_ptr<DomainBase>& D) {
resistance.zeros(W->get_size());
auto counter = 0llu;
for(const auto& I : node_pool) {
if(dot(current_velocity_handler(I), outer_norm) > 0.) continue;
const auto c_vel = current_velocity_handler(I);
if(dot(c_vel, outer_norm) > 0.) continue;
auto& t_dof = I->get_reordered_dof();
Expand All @@ -85,7 +84,7 @@ int RestitutionWallPenalty::process(const shared_ptr<DomainBase>& D) {
return SUANPAN_SUCCESS;
}

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

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

W->update_trial_acceleration(trial_acceleration);

return SUANPAN_SUCCESS;
}

void RestitutionWallPenalty::commit_status() { node_pool.clear(); }
Expand Down
3 changes: 2 additions & 1 deletion Constraint/RestitutionWallPenalty.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class RestitutionWallPenalty : public RigidWallPenalty {
suanpan::set<shared_ptr<Node>> node_pool;

const double restitution_coefficient;

public:
RestitutionWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, double, double, unsigned);
RestitutionWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, vec&&, double, double, unsigned);
Expand All @@ -46,7 +47,7 @@ class RestitutionWallPenalty : public RigidWallPenalty {

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

int stage(const shared_ptr<DomainBase>&) override;
void stage(const shared_ptr<DomainBase>&) override;

void commit_status() override;
void clear_status() override;
Expand Down
1 change: 1 addition & 0 deletions Constraint/RigidWallPenalty.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class RigidWallPenalty : public Constraint {
Col<double> (*trial_displacement_handler)(const shared_ptr<Node>&) = nullptr;
Col<double> (*trial_velocity_handler)(const shared_ptr<Node>&) = nullptr;
Col<double> (*trial_acceleration_handler)(const shared_ptr<Node>&) = nullptr;

public:
RigidWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, double, unsigned);
RigidWallPenalty(unsigned, unsigned, unsigned, vec&&, vec&&, vec&&, double, unsigned);
Expand Down
8 changes: 5 additions & 3 deletions Converger/AbsDisp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <Domain/Factory.hpp>

/**
* \brief the complete constructor.
* \brief The complete constructor.
* \param T `unique_tag`
* \param E `tolerance`
* \param M `max_iteration`
Expand All @@ -31,8 +31,10 @@ AbsDisp::AbsDisp(const unsigned T, const double E, const unsigned M, const bool

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

bool AbsDisp::is_converged() {
set_error(norm(get_domain().lock()->get_factory()->get_incre_displacement()));
bool AbsDisp::is_converged(unsigned) {
auto& W = get_domain().lock()->get_factory();

set_error(norm(W->get_incre_displacement() + W->get_ninja()) / static_cast<double>(W->get_size()));
set_conv_flag(get_tolerance() > get_error());

if(is_print()) suanpan_info("absolute displacement error: %.5E.\n", get_error());
Expand Down
2 changes: 1 addition & 1 deletion Converger/AbsDisp.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AbsDisp final : public Converger {

unique_ptr<Converger> get_copy() override;

bool is_converged() override;
bool is_converged(unsigned) override;
};

#endif
Expand Down
6 changes: 4 additions & 2 deletions Converger/AbsError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ unique_ptr<Converger> AbsError::get_copy() { return make_unique<AbsError>(*this)
* \brief Method to return `conv_flag`.
* \return `conv_flag`
*/
bool AbsError::is_converged() {
set_error(get_domain().lock()->get_factory()->get_error());
bool AbsError::is_converged(unsigned) {
auto& W = get_domain().lock()->get_factory();

set_error(fabs(W->get_error()) / static_cast<double>(W->get_size()));
set_conv_flag(get_tolerance() > get_error());

if(is_print()) suanpan_info("absolute error: %.5E.\n", get_error());
Expand Down
2 changes: 1 addition & 1 deletion Converger/AbsError.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class AbsError final : public Converger {

unique_ptr<Converger> get_copy() override;

bool is_converged() override;
bool is_converged(unsigned) override;
};

#endif
Expand Down
47 changes: 47 additions & 0 deletions Converger/AbsIncreAcc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (C) 2017-2022 Theodore Chang
*
* This program 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 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/

#include "AbsIncreAcc.h"
#include <Domain/DomainBase.h>
#include <Domain/Factory.hpp>

/**
* \brief The default constructor.
* \param T `unique_tag`
* \param E `tolerance`
* \param M `max_iteration`
* \param P `print_flag`
*/
AbsIncreAcc::AbsIncreAcc(const unsigned T, const double E, const unsigned M, const bool P)
: Converger(T, E, M, P) {}

unique_ptr<Converger> AbsIncreAcc::get_copy() { return make_unique<AbsIncreAcc>(*this); }

/**
* \brief Method to return `conv_flag`.
* \return `conv_flag`
*/
bool AbsIncreAcc::is_converged(unsigned) {
auto& W = get_domain().lock()->get_factory();

set_error(norm(W->get_ninja()) / static_cast<double>(W->get_size()));
set_conv_flag(get_tolerance() > get_error());

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

return get_conv_flag();
}
Loading

0 comments on commit cec7887

Please sign in to comment.