Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
96e9647
initial framework for lymphatics code
Oct 3, 2021
b965956
test
EdeTede Oct 13, 2021
14b2cc0
Merge pull request #3 from EdeTede/lymph2
tawhai Oct 13, 2021
dbaf8e0
lymphatics_transport subroutine and bindings, to evaluate whole syste…
Oct 13, 2021
c7502c9
merging Edward's changes
Oct 13, 2021
ea0357b
lymphatics_transport subroutine and bindings, to evaluate whole syste…
Oct 13, 2021
d1ae623
code produces results and redundancies removed
EdeTede Oct 17, 2021
cd3e3ac
Merge pull request #4 from EdeTede/lymph2
tawhai Oct 17, 2021
02391c0
debugging alveolar flux code
Oct 19, 2021
ca29379
ability to transfer data from ventilation and perfusion simulations t…
Oct 25, 2021
aabc737
updated pressure volume profiles
EdeTede Oct 26, 2021
e8e0006
Merge pull request #5 from EdeTede/lymphatic-transport
tawhai Oct 26, 2021
a05c283
testing developments
Oct 27, 2021
14af1ee
merge with Edward's commitMergg branch 'lymphatic-transport' of https…
Oct 27, 2021
24abbdd
added run time to arrays and updated lymphatic parameters
EdeTede Oct 27, 2021
cf83dd1
Merge pull request #6 from EdeTede/lymphatic-transport
tawhai Oct 27, 2021
50ffb3d
updated conductivity parameters
EdeTede Oct 28, 2021
818c11d
Merge pull request #7 from EdeTede/lymphatic-transport
tawhai Oct 28, 2021
3bb91d1
another final update on conductivity parameters
EdeTede Oct 29, 2021
b4a9bb2
Merge pull request #8 from EdeTede/lymphatic-transport
tawhai Oct 29, 2021
5f4bad0
new bindings to alveolar_flux and lymphatic_transport
Oct 29, 2021
d65993f
testing some conditions for stopping the alveolar flux simulation, an…
Oct 30, 2021
e63e9cf
Updated end-point criteria and added outputs
EdeTede Nov 2, 2021
93bb98b
Merge pull request #9 from EdeTede/lymphatic-transport
tawhai Nov 2, 2021
4cac6e3
tidying up nu_ indices, adding lymphatic terminal unit export
Nov 3, 2021
1385675
fixed errors in export_lymphatics and export_terminal_solution, plus …
Nov 3, 2021
4259169
updated output parameters
EdeTede Nov 4, 2021
8d8b1bb
corrected error in export
Nov 4, 2021
e8985b6
Merge branch 'lymphatic-transport' into lymphatic-transport
tawhai Nov 4, 2021
9ee6716
Merge pull request #10 from EdeTede/lymphatic-transport
tawhai Nov 4, 2021
845987c
resolving some errors in indices, lymphatics
Nov 4, 2021
f045a38
updated parameters
EdeTede Nov 15, 2021
3162151
Merge pull request #11 from EdeTede/lymphatic-transport
tawhai Nov 15, 2021
56a452b
lymphatic flow in export
Nov 16, 2021
3a9f7fe
documentation
EdeTede Jan 18, 2022
780253d
Merge pull request #12 from EdeTede/lymphatic-transport
tawhai Jan 18, 2022
746426d
removed junk - updated doc
EdeTede Jan 19, 2022
1efd9e8
Future Directions
EdeTede Jan 20, 2022
be9aa3b
Merge pull request #13 from EdeTede/lymphatic-transport
tawhai Jan 23, 2022
e65c160
Merge pull request #14 from EdeTede/patch-1
tawhai Jan 23, 2022
e7de5ea
updating some of the outputs from code for including in paper
Sep 15, 2022
d5b43cf
nothing
Sep 20, 2022
8f9cbc9
remove parentlist from arrays declaration
Apr 16, 2024
6bee253
remove parentlist from arrays declaration
Apr 16, 2024
7602111
Merge branch 'Lym_issue_128' into develop
ruobing-rl Feb 25, 2025
de9948d
Remove chest wall compliance from tissue compliance.
ruobing-rl Feb 26, 2025
2c50655
Fixing the run time statement
behdadebsh Dec 4, 2025
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
3 changes: 3 additions & 0 deletions src/bindings/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set(C_FORTRAN_LIB_SRCS
growtree.f90
indices.f90
imports.f90
lymphatics.f90
pressure_resistance_flow.f90
species_transport.f90
surface_fitting.f90
Expand All @@ -33,6 +34,7 @@ set(C_C_LIB_SRCS
growtree.c
indices.c
imports.c
lymphatics.c
pressure_resistance_flow.c
species_transport.c
surface_fitting.c
Expand All @@ -54,6 +56,7 @@ set(C_LIB_HDRS
growtree.h
indices.h
imports.h
lymphatics.h
pressure_resistance_flow.h
species_transport.h
surface_fitting.h
Expand Down
7 changes: 6 additions & 1 deletion src/bindings/c/arrays.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
#include "string.h"

void set_node_field_value_c(int *row, int *col, double *value);
void update_parameter_c(const char *parameter_name, int *parameter_name_len, double *parameter_value);

void set_node_field_value(int row, int col, double value)
{
set_node_field_value_c(&row, &col, &value);
}


void update_parameter(const char *parameter_name, double parameter_value)
{
int parameter_name_len = (int)strlen(parameter_name);
update_parameter_c(parameter_name, &parameter_name_len, &parameter_value);
}
20 changes: 19 additions & 1 deletion src/bindings/c/arrays.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ subroutine set_node_field_value_c(row, col, value) bind(C, name="set_node_field_

end subroutine set_node_field_value_c

subroutine update_parameter_c(parameter_name, parameter_name_len, parameter_value) bind(C, name="update_parameter_c")
use iso_c_binding, only: c_ptr
use utils_c, only: strncpy
use other_consts, only: max_filename_len
use arrays, only: update_parameter
implicit none


integer, intent(in) :: parameter_name_len
real(dp), intent(in) :: parameter_value
type(c_ptr),value, intent(in) :: parameter_name
character(len=max_filename_len) :: parameter_name_f

call strncpy(parameter_name_f, parameter_name, parameter_name_len)
#if defined _WIN32 && defined __INTEL_COMPILER
call so_update_parameter(parameter_name_f, parameter_value)
#else
call update_parameter(parameter_name_f, parameter_value)
#endif
end subroutine update_parameter_c

end module arrays_c
1 change: 1 addition & 0 deletions src/bindings/c/arrays.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
#include "symbol_export.h"

SHO_PUBLIC void set_node_field_value(int row, int col, double value);
SHO_PUBLIC void update_parameter(const char *parameter_name, double parameter_value);

#endif /* AETHER_ARRAYS_H */
9 changes: 9 additions & 0 deletions src/bindings/c/exports.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ void export_node_field_c(int *nj_field, const char *EXNODEFIELD, int *EXNODEFIEL
const char *name, int *name_len, const char *field_name, int *field_name_len);
void export_elem_geometry_2d_c(const char *EXELEMFILE, int *EXELEMFILE_LEN,
const char *name, int *name_len, int *offset_elem, int *offset_node);
void export_terminal_lymphatic_c(const char *EXNODEFILE, int *EXNODEFILE_LEN, const char *name, int *name_len);
void export_terminal_solution_c(const char *EXNODEFILE, int *EXNODEFILE_LEN,
const char *name, int *name_len);
void export_terminal_perfusion_c(const char *EXNODEFILE, int *EXNODEFILE_LEN,
Expand Down Expand Up @@ -87,6 +88,14 @@ void export_node_field(int nj_field, const char *EXNODEFIELD,
&name_len, field_name, &field_name_len);
}

void export_terminal_lymphatic(const char *EXNODEFILE, const char *name)
{
int filename_len = strlen(EXNODEFILE);
int name_len = strlen(name);

export_terminal_lymphatic_c(EXNODEFILE, &filename_len, name, &name_len);
}

void export_terminal_solution(const char *EXNODEFILE, const char *name)
{
int filename_len = strlen(EXNODEFILE);
Expand Down
25 changes: 25 additions & 0 deletions src/bindings/c/exports.f90
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,31 @@ subroutine export_data_geometry_c(EXDATAFILE, filename_len, name, name_len, offs

end subroutine export_data_geometry_c

!!!########################################################################

subroutine export_terminal_lymphatic_c(EXNODEFILE, filename_len, name, name_len) bind(C, name="export_terminal_lymphatic_c")

use iso_c_binding, only: c_ptr
use utils_c, only: strncpy
use exports, only: export_terminal_lymphatic
use other_consts, only: MAX_STRING_LEN, MAX_FILENAME_LEN
implicit none
integer,intent(in) :: filename_len, name_len
type(c_ptr), value, intent(in) :: EXNODEFILE, name
character(len=MAX_FILENAME_LEN) :: filename_f
character(len=MAX_STRING_LEN) :: name_f

call strncpy(filename_f, EXNODEFILE, filename_len)
call strncpy(name_f, name, name_len)

#if defined _WIN32 && defined __INTEL_COMPILER
call so_export_terminal_lymphatic(filename_f, name_f)
#else
call export_terminal_lymphatic(filename_f, name_f)
#endif

end subroutine export_terminal_lymphatic_c

!!!########################################################################

subroutine export_terminal_solution_c(EXNODEFILE, filename_len, name, name_len) bind(C, name="export_terminal_solution_c")
Expand Down
1 change: 1 addition & 0 deletions src/bindings/c/exports.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ SHO_PUBLIC void export_1d_elem_field(int ne_field, const char *EXELEMFILE, const
SHO_PUBLIC void export_1d_elem_geometry(const char *EXELEMFILE, const char *name);
SHO_PUBLIC void export_elem_geometry_2d(const char *EXELEMFILE, const char *name, int offset_elem, int offset_node);
SHO_PUBLIC void export_node_field(int nj_field, const char *EXNODEFIELD, const char *name, const char *field_name);
SHO_PUBLIC void export_terminal_lymphatic(const char *EXNODEFILE, const char *name);
SHO_PUBLIC void export_terminal_solution(const char *EXNODEFILE, const char *name);
SHO_PUBLIC void export_terminal_perfusion(const char *EXNODEFILE, const char *name);
SHO_PUBLIC void export_terminal_ssgexch(const char *EXNODEFILE, const char *name);
Expand Down
12 changes: 12 additions & 0 deletions src/bindings/c/imports.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@

#include <string.h>

void import_capillary_c(const char *FLOWFILE,int *FLOWFILE_LEN);
void import_terminal_c(const char *FLOWFILE,int *FLOWFILE_LEN);
void import_ventilation_c(const char *FLOWFILE,int *FLOWFILE_LEN);
void import_perfusion_c(const char *FLOWFILE,int *FLOWFILE_LEN);

void import_capillary(const char *FLOWFILE)
{
int filename_len = strlen(FLOWFILE);
import_capillary_c(FLOWFILE, &filename_len);
}
void import_terminal(const char *FLOWFILE)
{
int filename_len = strlen(FLOWFILE);
import_terminal_c(FLOWFILE, &filename_len);
}
void import_ventilation(const char *FLOWFILE)
{
int filename_len = strlen(FLOWFILE);
Expand Down
48 changes: 48 additions & 0 deletions src/bindings/c/imports.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@ module imports_c
private

contains
!
!###################################################################################
!
subroutine import_capillary_c(FLOWFILE, filename_len) bind(C, name="import_capillary_c")

use iso_c_binding, only: c_ptr
use utils_c, only: strncpy
use imports, only: import_capillary
use other_consts, only: MAX_STRING_LEN, MAX_FILENAME_LEN
implicit none
integer,intent(in) :: filename_len
type(c_ptr), value, intent(in) :: FLOWFILE
character(len=MAX_FILENAME_LEN) :: filename_f

call strncpy(filename_f, FLOWFILE, filename_len)

#if defined _WIN32 && defined __INTEL_COMPILER
call so_import_capillary(filename_f)
#else
call import_capillary(filename_f)
#endif

end subroutine import_capillary_c

!
!###################################################################################
!
subroutine import_terminal_c(FLOWFILE, filename_len) bind(C, name="import_terminal_c")

use iso_c_binding, only: c_ptr
use utils_c, only: strncpy
use imports, only: import_terminal
use other_consts, only: MAX_STRING_LEN, MAX_FILENAME_LEN
implicit none
integer,intent(in) :: filename_len
type(c_ptr), value, intent(in) :: FLOWFILE
character(len=MAX_FILENAME_LEN) :: filename_f

call strncpy(filename_f, FLOWFILE, filename_len)

#if defined _WIN32 && defined __INTEL_COMPILER
call so_import_terminal(filename_f)
#else
call import_terminal(filename_f)
#endif

end subroutine import_terminal_c

!
!###################################################################################
!
Expand Down
2 changes: 2 additions & 0 deletions src/bindings/c/imports.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "symbol_export.h"

SHO_PUBLIC void import_capillary(const char *FLOWFILE);
SHO_PUBLIC void import_terminal(const char *FLOWFILE);
SHO_PUBLIC void import_ventilation(const char *FLOWFILE);
SHO_PUBLIC void import_perfusion(const char *FLOWFILE);

Expand Down
6 changes: 6 additions & 0 deletions src/bindings/c/indices.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string.h>

void define_problem_type_c(const char *PROBLEMTYPE,int *PROBLEMTYPE_LEN);
void lymphatic_indices_c();
void ventilation_indices_c();
void perfusion_indices_c();
int get_ne_radius_c();
Expand All @@ -18,6 +19,11 @@ void define_problem_type(const char *PROBLEMTYPE)
}


void lymphatic_indices()
{
lymphatic_indices_c();
}

void ventilation_indices()
{
ventilation_indices_c();
Expand Down
17 changes: 17 additions & 0 deletions src/bindings/c/indices.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ end subroutine ventilation_indices_c
!
!######################################################################
!
!> Lymphatic indices
subroutine lymphatic_indices_c() bind(C, name="lymphatic_indices_c")

use indices, only: lymphatic_indices
implicit none

#if defined _WIN32 && defined __INTEL_COMPILER
call so_lymphatic_indices()
#else
call lymphatic_indices()
#endif

end subroutine lymphatic_indices_c

!
!######################################################################
!
!> Perfusion indices
subroutine perfusion_indices_c() bind(C, name="perfusion_indices_c")

Expand Down
1 change: 1 addition & 0 deletions src/bindings/c/indices.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "symbol_export.h"
SHO_PUBLIC void define_problem_type(const char *PROBLEMTYPE);
SHO_PUBLIC void lymphatic_indices();
SHO_PUBLIC void ventilation_indices();
SHO_PUBLIC void perfusion_indices();
SHO_PUBLIC int get_ne_radius();
Expand Down
17 changes: 17 additions & 0 deletions src/bindings/c/lymphatics.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "lymphatics.h"
#include "string.h"

void alveolar_capillary_flux_c(int *num_nodes, int *write_out);
void lymphatic_transport_c(const char *filename, int *filename_len);


void alveolar_capillary_flux(int num_nodes, int write_out)
{
alveolar_capillary_flux_c(&num_nodes, &write_out);
}

void lymphatic_transport(const char *filename)
{
int filename_len = (int)strlen(filename);
lymphatic_transport_c(filename, &filename_len);
}
53 changes: 53 additions & 0 deletions src/bindings/c/lymphatics.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module lymphatics_c
implicit none

private

contains
!
!###################################################################################
!
!*alveolar_capillary_flux:*
subroutine alveolar_capillary_flux_c(num_nodes,write_out) bind(C, name="alveolar_capillary_flux_c")
use lymphatics,only: alveolar_capillary_flux
implicit none

integer,intent(in) :: num_nodes
logical,intent(in) :: write_out

#if defined _WIN32 && defined __INTEL_COMPILER
call so_alveolar_capillary_flux(num_nodes,write_out)
#else
call alveolar_capillary_flux(num_nodes,write_out)
#endif

end subroutine alveolar_capillary_flux_c
!
!###################################################################################
!
!*lymphatic_transport*
subroutine lymphatic_transport_c(filename, filename_len) bind(C, name="lymphatic_transport_c")
use iso_c_binding, only: c_ptr
use utils_c, only: strncpy
use other_consts, only: MAX_FILENAME_LEN
use lymphatics,only: lymphatic_transport
implicit none

integer,intent(in) :: filename_len
type(c_ptr), value, intent(in) :: filename
character(len=MAX_FILENAME_LEN) :: filename_f

call strncpy(filename_f, filename, filename_len)
#if defined _WIN32 && defined __INTEL_COMPILER
call so_lymphatic_transport(filename_f)
#else
call lymphatic_transport(filename_f)
#endif

end subroutine lymphatic_transport_c

!
!###################################################################################
!

end module lymphatics_c
9 changes: 9 additions & 0 deletions src/bindings/c/lymphatics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef AETHER_LYMPHATICS_H
#define AETHER_LYMPHATICS_H

#include "symbol_export.h"

SHO_PUBLIC void alveolar_capillary_flux(int num_nodes, int write_out);
SHO_PUBLIC void lymphatic_transport(const char *filename);

#endif /* AETHER_LYMPHATICS_H */
10 changes: 10 additions & 0 deletions src/bindings/interface/lymphatics.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

%module(package="aether") lymphatics
%include symbol_export.h
%include lymphatics.h

%{
#include "lymphatics.h"
%}


1 change: 1 addition & 0 deletions src/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ set(INTERFACE_SRCS
../interface/growtree.i
../interface/indices.i
../interface/imports.i
../interface/lymphatics.i
../interface/pressure_resistance_flow.i
../interface/species_transport.i
../interface/surface_fitting.i
Expand Down
Binary file added src/lib/.lymphatics.f90.swp
Binary file not shown.
1 change: 1 addition & 0 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set(LIB_SRCS
growtree.f90
indices.f90
imports.f90
lymphatics.f90
math_utilities.f90
mesh_utilities.f90
other_consts.f90
Expand Down
Loading
Loading