diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f305b41..6a1b352 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -18,14 +18,14 @@ jobs: # os: windows-2022, # } - { - name: "Ubuntu 20.04", + name: "Ubuntu Latest", build_type: "Release", - os: ubuntu-20.04, + os: ubuntu-latest, } - { - name: "macOS Monterey 12", + name: "macOS Latest", build_type: "Release", - os: macos-12, + os: macos-latest, } steps: # Useful for debugging dll load issues. @@ -76,6 +76,11 @@ jobs: with: compiler: 'intel' version: '2023.2' + - name: Install build prerequisites – macOS + if: runner.os == 'macOS' + run: | + brew update + brew install gcc@13 swig # - name: Install oneAPI HPC kit # if: runner.os == 'Windows' # uses: hsorby/install-intelfortran-action@main diff --git a/src/lib/pressure_resistance_flow.f90 b/src/lib/pressure_resistance_flow.f90 index 269ce43..6bb1780 100644 --- a/src/lib/pressure_resistance_flow.f90 +++ b/src/lib/pressure_resistance_flow.f90 @@ -1901,8 +1901,8 @@ subroutine capillary_resistance(nelem,vessel_type,rheology_type,press_in,press_o enddo !Repeat for veins do ng = 1, numgens - - int_radius_gen = int_rad_vin + (int_rad_vout-int_rad_vin)/dble(numgens)*(dble(ng)-1.0_dp) + !Veins constructed bottom up, so construct radii in opposite order to arteries + int_radius_gen = int_rad_vin + (int_rad_vout-int_rad_vin)/dble(numgens)*(dble(numgens + 1.0_dp - ng)-1.0_dp) if(update_mu.eq.1) then call viscosity_from_radius(int_radius_gen*1000.0_dp,0.45_dp,visc_factor) @@ -1936,37 +1936,25 @@ subroutine capillary_resistance(nelem,vessel_type,rheology_type,press_in,press_o SparseVal(nnz) = -1.0_dp nnz = nnz+1 checkgen = 1 - curgen = ceiling((dble(p_unknowns) - dble(i2))/dble(numconvolutes)) + curgen = ceiling((dble(p_unknowns) - dble(i2) + 1)/dble(numconvolutes)) divider = 2.0_dp**(curgen-1) do j = 1,(p_unknowns - i2) - if(j.eq.(p_unknowns - i2))then - SparseCol(nnz) = p_unknowns+j - SparseVal(nnz) = R_seg - if(update_resistance)then - update_resist(nnz,1) = 2 !indicating this one needs to be updated and is a vein - update_resist(nnz,2) = numgens - ng + 1 !current generation - update_resist(nnz,3) = i2 !segment that this resistance is associated with - original_resist(nnz) = SparseVal(nnz) - endif - nnz = nnz+1 - else - SparseCol(nnz) = p_unknowns + j - SparseVal(nnz) = R_seg/divider - if(update_resistance)then - update_resist(nnz,1) = 2 !indicating this one needs to be updated and is a vein - update_resist(nnz,2) = numgens - ng + 1 !current generation - update_resist(nnz,3) = i2 !segment that this resistance is associated with - original_resist(nnz) = SparseVal(nnz) - endif - nnz = nnz + 1 + SparseCol(nnz) = p_unknowns + j + SparseVal(nnz) = R_seg/divider + if(update_resistance)then + update_resist(nnz,1) = 2 !indicating this one needs to be updated and is a vein + update_resist(nnz,2) = numgens - ng + 1 !current generation + update_resist(nnz,3) = i2 !segment that this resistance is associated with + original_resist(nnz) = SparseVal(nnz) endif + nnz = nnz + 1 if(j.eq.checkgen*numconvolutes)then checkgen = checkgen + 1 curgen = curgen - 1 divider = 2.0_dp**(curgen-1.0_dp) endif enddo - curgen = ceiling((dble(p_unknowns) - dble(i2))/dble(numconvolutes)) + curgen = ceiling((dble(p_unknowns) - dble(i2) + 1)/dble(numconvolutes)) SparseCol(nnz) = MatrixSize SparseVal(nnz) = -R_seg/(2.0_dp**curgen) if(update_resistance)then