Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
84554df
Create exception.hpp
chemiskyy Apr 14, 2025
f0baf73
Update contimech.cpp
chemiskyy Apr 14, 2025
1bddf8e
Update criteria.cpp
chemiskyy Apr 14, 2025
6e88b6c
Update hyperelastic.cpp
chemiskyy Apr 14, 2025
c74d3b5
Update objective_rates.cpp
chemiskyy Apr 14, 2025
0699acf
Update SMA_mono.cpp
chemiskyy Apr 14, 2025
3bf41d0
Update SMA_mono_cubic.cpp
chemiskyy Apr 14, 2025
de58f10
Update contimech.cpp
chemiskyy Apr 15, 2025
2232f3d
add exception.hpp
chemiskyy Apr 15, 2025
397a21b
Update hyperelastic.cpp
chemiskyy Apr 15, 2025
b314549
Update boostpython_smartplus_wrappers.cpp
chemiskyy Apr 16, 2025
19c2b16
Update boostpython_smartplus_wrappers.cpp
chemiskyy Apr 16, 2025
894067d
replace sim_ with simcoon::
chemiskyy Apr 17, 2025
70540b4
Update parameter.hpp
chemiskyy Apr 17, 2025
922613d
Update parameter.hpp
chemiskyy Apr 17, 2025
8df71f3
Update recovery_props.cpp
chemiskyy Apr 17, 2025
117d872
add exception for det and inv (not finished)
chemiskyy Apr 22, 2025
1e4985e
add try catch inv
chemiskyy Apr 24, 2025
6eaf8a4
include exception.hpp
chemiskyy Apr 24, 2025
d968af8
Add test
chemiskyy Apr 24, 2025
97cd59b
Update kinematics.cpp
chemiskyy Apr 24, 2025
f484a64
Update objective_rates.cpp
chemiskyy Apr 24, 2025
99f49a7
Update objective_rates.cpp
chemiskyy Apr 24, 2025
c0910cf
Update objective_rates.cpp
chemiskyy Apr 24, 2025
879daa4
Update objective_rates.cpp
chemiskyy Apr 24, 2025
5a8f65d
Update objective_rates.cpp
chemiskyy Apr 24, 2025
6b3bdad
Update objective_rates.cpp
chemiskyy Apr 24, 2025
427f24e
add sqrtmat_sympd and expmat_sympd
chemiskyy Apr 25, 2025
9ecd18e
add powmat exception
chemiskyy Apr 25, 2025
d5d53fa
modify exception
chemiskyy Apr 25, 2025
51f5fd5
Update TLOG_int.cpp
chemiskyy Apr 25, 2025
4e9ad8d
Update boostpython_smartplus_wrappers.cpp
chemiskyy Apr 25, 2025
69e35e1
Update include/simcoon/Continuum_mechanics/Functions/kinematics.hpp
chemiskyy May 23, 2025
04f6698
Merge branch 'master' into throw_and_fix
chemiskyy Jul 11, 2025
0308961
Update umat.cpp
chemiskyy Jul 11, 2025
bda87e3
Update umat.cpp
chemiskyy Jul 11, 2025
67335ac
Update parameter.hpp
chemiskyy Jul 17, 2025
0168743
Update parameter.hpp
chemiskyy Jul 18, 2025
38c8da8
Update parameter.hpp
chemiskyy Jul 18, 2025
40cb05a
Update parameter.hpp
chemiskyy Jul 18, 2025
863aafb
Update parameter.hpp
chemiskyy Jul 18, 2025
01c2318
Update parameter.hpp
chemiskyy Jul 18, 2025
6c5e84b
.for -> .f
chemiskyy Jul 18, 2025
473f3a2
.for -> .f
chemiskyy Jul 18, 2025
f339f2d
Update CMakeLists.txt
chemiskyy Jul 18, 2025
298fd0b
Update environment_arm64.yml
chemiskyy Jul 18, 2025
f4ef270
Update environment_arm64.yml
chemiskyy Jul 18, 2025
351768d
Merge branch 'master' into throw_and_fix
chemiskyy Jan 18, 2026
101f5ab
Merge branch 'master' into throw_and_fix
chemiskyy Jan 20, 2026
e98167b
Merge branch 'master' into throw_and_fix
chemiskyy Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,17 @@ if(SIMCOON_BUILD_TESTS)
enable_language(Fortran)
add_library(umat_plugin_aba SHARED testBin/Umats/UMABA/external/UMAT_ABAQUS_ELASTIC.for testBin/Umats/UMABA/external/umat_plugin_aba.cpp)

set_target_properties(umat_plugin_aba PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/testBin/Umats/UMABA/external
)
if(NOT MSVC)
set_source_files_properties(testBin/Umats/UMABA/external/UMAT_ABAQUS_ELASTIC.f PROPERTIES Fortran_PREPROCESS OFF)
add_library(umat_plugin_aba SHARED testBin/Umats/UMABA/external/UMAT_ABAQUS_ELASTIC.f testBin/Umats/UMABA/external/umat_plugin_aba.cpp)
set_target_properties(umat_plugin_aba PROPERTIES
PREFIX ""
SUFFIX ""
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/testBin/Umats/UMABA/external
)

target_link_libraries(umat_plugin_aba PRIVATE simcoon)
target_link_libraries(umat_plugin_aba PRIVATE simcoon ${ARMADILLO_LIBRARIES})
endif()
endif()

add_library(umat_plugin_ext SHARED
Expand Down
2 changes: 1 addition & 1 deletion environment_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ channels:

dependencies:
- cxx-compiler
- fortran-compiler
- gfortran_osx-arm64
- blas
- lapack
- numpy>=1.26
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ arma::mat sym_dyadic_operator(const arma::mat &a, const arma::mat &b);
double f_z = 0.;
for (unsigned int i=0; i<3; i++) {
for (unsigned int j=0; j<3; j++) {
if ((i!=j)&&(fabs(bi(i)-bi(j))>sim_iota)) {
if ((i!=j)&&(fabs(bi(i)-bi(j))>simcoon::iota)) {
f_z = (1.+(bi(i)/bi(j)))/(1.-(bi(i)/bi(j)))+2./log(bi(i)/bi(j));
BBBB = BBBB + f_z*B_klmn(Bi.col(i),Bi.col(j));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace simcoon{
* @param[out] axis : The axis of symmetry (if applicable)
* @param[out] props : The material properties vector
* @param[out] maj_sym : The major symmetry condition (L_ij = L_ji ?).
* @param[in] tol : The tolerance utilized to check the symetries. If less than the global sim_limit (1.E-8), sim_limit is utilized. Default is 0. (so sim_limit is utilized by default)
* @param[in] tol : The tolerance utilized to check the symetries. If less than the global simcoon::limit (1.E-8), simcoon::limit is utilized. Default is 0. (so simcoon::limit is utilized by default)
*
* Material Symmetries considered:
*
Expand Down
2 changes: 1 addition & 1 deletion include/simcoon/Continuum_mechanics/Material/ODF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ODF
arma::vec limits; //minimal and maximal angles of orientation

ODF(); //default constructor
ODF(const int &, const bool & = false, const double & = 0., const double & = sim_pi); //Partial constructor
ODF(const int &, const bool & = false, const double & = 0., const double & = simcoon::pi); //Partial constructor
ODF(const int &, const int &, const int &, const std::vector<peak> &, const double &, const arma::vec &, const arma::vec &, const bool & = false); //Full constructor

ODF(const ODF&); //Copy constructor
Expand Down
71 changes: 71 additions & 0 deletions include/simcoon/exception.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* This file is part of simcoon.

simcoon 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.

simcoon 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 simcoon. If not, see <http://www.gnu.org/licenses/>.

*/

///@file exception.hpp
///@brief exceptions of simcoon
///@version 1.0

#pragma once

#include <stdexcept>
#include <string>

namespace simcoon {

class exception_eig_sym : public std::runtime_error {
public:
explicit exception_eig_sym(const std::string& msg)
: std::runtime_error(msg) {}
};

class exception_det : public std::runtime_error {
public:
explicit exception_det(const std::string& msg)
: std::runtime_error(msg) {}
};

class exception_inv : public std::runtime_error {
public:
explicit exception_inv(const std::string& msg)
: std::runtime_error(msg) {}
};

class exception_sqrtmat_sympd : public std::runtime_error {
public:
explicit exception_sqrtmat_sympd(const std::string& msg)
: std::runtime_error(msg) {}
};

class exception_logmat_sympd : public std::runtime_error {
public:
explicit exception_logmat_sympd(const std::string& msg)
: std::runtime_error(msg) {}
};

class exception_expmat_sym : public std::runtime_error {
public:
explicit exception_expmat_sym(const std::string& msg)
: std::runtime_error(msg) {}
};

class exception_powmat : public std::runtime_error {
public:
explicit exception_powmat(const std::string& msg)
: std::runtime_error(msg) {}
};

} //namespace simcoon
66 changes: 15 additions & 51 deletions include/simcoon/parameter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,73 +19,37 @@
///@brief parameters of simcoon
///@version 1.0

#pragma once
#if defined(__cpp_lib_math_constants)
#include <numbers>
#define HAS_STD_NUMBERS
#endif

#define UNUSED(x) [&x]{}()

#ifndef version_full
#define version_full 1
#endif

namespace simcoon{

#ifndef sim_pi
#ifdef HAS_STD_NUMBERS
#define sim_pi std::numbers::pi
constexpr double pi = std::numbers::pi;
#else
#define sim_pi 3.14159265358979323846
constexpr double pi = 3.14159265358979323846;
#endif
#endif

#ifndef axis_psi
#define axis_psi 3
#endif
constexpr int axis_psi = 3;
constexpr int axis_theta = 1;
constexpr int axis_phi = 3;

#ifndef axis_theta
#define axis_theta 1
#endif
constexpr double limit = 1.E-9;
constexpr double iota = 1.E-12;
constexpr int miniter_umat = 10;

#ifndef axis_phi
#define axis_phi 3
#endif
constexpr int maxiter_umat = 100;
constexpr double precision_umat = 1E-9;

#ifndef sim_limit
#define sim_limit 1.E-9
#endif
constexpr double div_tnew_dt_umat = 0.2;
constexpr double mul_tnew_dt_umat = 2.0;
constexpr int maxiter_micro = 100;

#ifndef sim_iota
#define sim_iota 1.E-12
#endif

#ifndef miniter_umat
#define miniter_umat 10
#endif

#ifndef maxiter_umat
#define maxiter_umat 100
#endif

#ifndef precision_umat
#define precision_umat 1E-9
#endif

#ifndef div_tnew_dt_umat
#define div_tnew_dt_umat 0.2
#endif

#ifndef mul_tnew_dt_umat
#define mul_tnew_dt_umat 2
#endif

#ifndef maxiter_micro
#define maxiter_micro 100
#endif

#ifndef precision_micro
#define precision_micro 1E-6
#endif
constexpr double precision_micro = 1E-6;

} //namespace simcoon
142 changes: 141 additions & 1 deletion simcoon-python-builder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,147 @@ else()
message(STATUS "Building Python bindings (standalone)")
endif()

# All dependencies (Python, pybind11, carma, Armadillo, simcoon) are already found by parent
#set(CMAKE_VERBOSE_MAKEFILE ON)

# The version number
set(VERSION_MAJOR 1)
set(VERSION_MINOR 9)
set(VERSION_PATCH 4)

if(VERSION_PATCH MATCHES "0")
set(VERSION_NUMBER "${VERSION_MAJOR}.${VERSION_MINOR}")
else()
set(VERSION_NUMBER "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
endif()

set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON)

##### RPATH HANDLING ####
#set(CMAKE_MACOSX_RPATH 1)
#set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
################


# put our local cmake find scripts at the beginning of the cmake
# module search path
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

if (MSVC) #if windows using visual c++

# Specify the output directory for each configuration (Debug, Release, etc.)
foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${CONFIG_TYPE} CONFIG)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG} "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG} "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} "${CMAKE_BINARY_DIR}/bin")
endforeach()
endif()

#Set executable files and library files
set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE})
set(LIBRARY_OUTPUT_PATH lib/${CMAKE_BUILD_TYPE})

find_package(Python3 COMPONENTS Interpreter Development NumPy)

#Inclusion of Armadillo
if (MSVC)
find_package(pybind11 REQUIRED)
find_package(carma CONFIG REQUIRED)
find_package(blas REQUIRED)
find_package(lapack REQUIRED)
set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
else()
find_package(pybind11 REQUIRED)
find_package(Armadillo 12.6 REQUIRED)
find_package(carma CONFIG REQUIRED)
endif()

if (NOT DEFINED USE_OPENMP)
set(USE_OPENMP True)
endif()

if (USE_OPENMP)
find_package(OpenMP)
endif()
find_package(simcoon REQUIRED)

#${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}

include_directories(SYSTEM ${ARMADILLO_INCLUDE_DIRS})
include_directories(SYSTEM ${PYTHON_INCLUDE_DIRS})
include_directories(SYSTEM ${SIMCOON_INCLUDE_DIRS})
include_directories(SYSTEM ${CARMA_INCLUDE_DIR})

message(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
message(STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}")
message(STATUS "PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}")
message(STATUS "SIMCOON_INCLUDE_DIRS = ${SIMCOON_INCLUDE_DIRS}")
message(STATUS "SIMCOON_LIBRARIES = ${SIMCOON_LIBRARIES}")
message(STATUS "ARMADILLO_INCLUDE_DIRS = ${ARMADILLO_INCLUDE_DIRS}")
message(STATUS "ARMADILLO_LIBRARIES = ${ARMADILLO_LIBRARIES}")
message(STATUS "carma_INCLUDE_DIR = ${carma_INCLUDE_DIR}")

# Build type
if(NOT CMAKE_BUILD_TYPE) # Debug by default
set(CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel"
FORCE)
endif()

# Set the CFLAGS and CXXFLAGS depending on the options the user specified.
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter")


if (MSVC)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (USE_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest /Drestrict= /openmp:llvm /Y-") #\Y- to disable precompile header (don't work for an unknown reason)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest /Drestrict= /openmp /Y-") #\Y- to disable precompile header (don't work for an unknown reason)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest /Drestrict=")
endif()
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") #do nothing but kept anyway if required to add some options
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") #do nothing but kept anyway if required to add some options
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") #do nothing but kept anyway if required to add some options
elseif (UNIX AND NOT APPLE)
if (DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20 -O0 -Drestrict=")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -std=c++20")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -std=c++20")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -std=c++20")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20 -O3 -Drestrict=")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -std=c++20")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -std=c++20")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -std=c++20")
endif()
else()
if (DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20 -stdlib=libc++ -O0 -Drestrict=")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -std=c++20 -stdlib=libc++")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -std=c++20 -stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -std=c++20 -stdlib=libc++")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20 -stdlib=libc++ -O3 -Drestrict=")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -std=c++20 -stdlib=libc++")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -std=c++20 -stdlib=libc++")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -std=c++20 -stdlib=libc++")
endif()
endif()

#Inclusion of public headers
include_directories(include)

#Command file to get all the files in the src/ and include/
file(GLOB_RECURSE source_files_simmit src/python_wrappers/* include/simcoon/python_wrappers/*)
file(GLOB_RECURSE test_files_carma test/Carma/*.cpp test/Carma/*.hpp)
file(GLOB_RECURSE test_files_exception test/exception_test/*.cpp test/exception_test/*.hpp)

################################################################################
# SIMCOON PYBIND11 MODULE (simmit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

#include <carma>
#include <armadillo>


#include <simcoon/exception.hpp>
#include <simcoon/Continuum_mechanics/Functions/hyperelastic.hpp>
#include <simcoon/Continuum_mechanics/Functions/transfer.hpp>
#include <simcoon/python_wrappers/Libraries/Continuum_mechanics/hyperelastic.hpp>
Expand Down
Loading
Loading