Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ add_subdirectory("distribution")
# Enforce and check code format
# -----------------------------------------------------------------------------
# set paths of files to format
set(SDIR ${PROJECT_SOURCE_DIR}/src/**/)
set(SDIR ${PROJECT_SOURCE_DIR}/src)

# format the code
add_custom_target(codeformat
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"devDependencies": {
"prettier": "^3.6.2"
"prettier": "^3.8.4"
},
"scripts": {
"format": "prettier --write \"**/*.json\"",
Expand Down
4 changes: 2 additions & 2 deletions src/model/Block.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
* to the global system.
*/
struct TripletsContributions {
TripletsContributions() {};
TripletsContributions(){};
/**
* @brief Set the number of triplets that the element contributes
* to the global system.
* @param F Contributions to F matrix
* @param E Contributions to E matrix
* @param D Contributions to dC/dy matrix
*/
TripletsContributions(int F, int E, int D) : F(F), E(E), D(D) {};
TripletsContributions(int F, int E, int D) : F(F), E(E), D(D){};
/**
* @brief Set the number of triplets that the element contributes
* to the global system.
Expand Down
11 changes: 9 additions & 2 deletions src/model/ChamberSphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@ void ChamberSphere::get_elastance_values(std::vector<double>& parameters) {
const auto T_cardiac = model->cardiac_cycle_period;
const auto t_in_cycle = fmod(model->time, T_cardiac);

const double S_plus = 0.5 * (1.0 + tanh((t_in_cycle - tsys) / steepness));
const double S_minus = 0.5 * (1.0 - tanh((t_in_cycle - tdias) / steepness));
auto warp_signed = [T_cardiac](double dt) {
return fmod(dt + 1.5 * T_cardiac, T_cardiac) - 0.5 * T_cardiac;
};

const double phase_tsys = warp_signed(t_in_cycle - tsys);
const double phase_tdias = warp_signed(t_in_cycle - tdias);

const double S_plus = 0.5 * (1.0 + tanh(phase_tsys / steepness));
const double S_minus = 0.5 * (1.0 - tanh(phase_tdias / steepness));

// indicator function
const double f = S_plus * S_minus;
Expand Down
Loading