Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Computational modelling and simulation
pb4covid19
Commits
e19aca7a
Commit
e19aca7a
authored
Jul 03, 2020
by
Randy Heiland
Browse files
cleanup
parent
3b61c022
Changes
77
Expand all
Hide whitespace changes
Inline
Side-by-side
src/ALL_CITATIONS.txt
deleted
100644 → 0
View file @
3b61c022
Using PhysiCell version 1.7.1
Please cite DOI: 10.1371/journal.pcbi.1005991
Project website: http://PhysiCell.MathCancer.org
src/BioFVM/BioFVM.h
deleted
100644 → 0
View file @
3b61c022
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.7) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#ifndef __BioFVM_h__
#define __BioFVM_h__
#include <iostream>
#include <fstream>
namespace
BioFVM
{
extern
std
::
string
BioFVM_Version
;
extern
std
::
string
BioFVM_URL
;
};
#include "BioFVM_utilities.h"
#include "BioFVM_vector.h"
#include "BioFVM_vector.h"
#include "BioFVM_mesh.h"
#include "BioFVM_microenvironment.h"
#include "BioFVM_solvers.h"
#include "BioFVM_basic_agent.h"
#endif
src/BioFVM/BioFVM_MultiCellDS.cpp
deleted
100644 → 0
View file @
3b61c022
This diff is collapsed.
Click to expand it.
src/BioFVM/BioFVM_MultiCellDS.h
deleted
100644 → 0
View file @
3b61c022
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.7) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#ifndef __BioFVM_MultiCellDS_h__
#define __BioFVM_MultiCellDS_h__
#include "pugixml.hpp"
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <ctime>
#include <cstring>
#include <vector>
#include <fstream>
namespace
BioFVM
{
extern
std
::
string
MultiCellDS_version_string
;
extern
std
::
string
MultiCellDS_clinical_snapshot_type_string
;
extern
int
MultiCellDS_clinical_snapshot_code
;
extern
std
::
string
MultiCellDS_experimental_snapshot_type_string
;
extern
int
MultiCellDS_experimental_snapshot_code
;
extern
std
::
string
MultiCellDS_simulation_snapshot_type_string
;
extern
int
MultiCellDS_simulation_snapshot_code
;
extern
std
::
string
MultiCellDS_digital_cell_line_type_string
;
extern
int
MultiCellDS_digital_cell_line_code
;
/* options */
extern
bool
save_mesh_as_matlab
;
extern
bool
save_density_data_as_matlab
;
extern
bool
save_cells_as_custom_matlab
;
extern
bool
save_cell_data
;
class
Microenvironment
;
extern
pugi
::
xml_document
biofvm_doc
;
class
Person_Metadata
{
private:
bool
is_empty
;
public:
std
::
string
type
;
// author, creator, user, curator
std
::
string
surname
;
std
::
string
given_names
;
std
::
string
email
;
std
::
string
URL
;
std
::
string
organization
;
std
::
string
department
;
std
::
string
ORCID
;
Person_Metadata
(
);
void
display_information
(
std
::
ostream
&
os
);
void
insert_in_open_xml_pugi
(
pugi
::
xml_node
&
insert_here
);
};
class
Citation_Metadata
{
private:
public:
std
::
string
DOI
;
std
::
string
PMID
;
std
::
string
PMCID
;
std
::
string
text
;
std
::
string
notes
;
std
::
string
URL
;
Citation_Metadata
();
void
display_information
(
std
::
ostream
&
os
);
void
insert_in_open_xml_pugi
(
pugi
::
xml_node
&
insert_here
);
};
class
Software_Metadata
{
private:
public:
// basic program information
std
::
string
program_name
;
std
::
string
program_version
;
std
::
string
program_URL
;
Person_Metadata
creator
;
Person_Metadata
user
;
Citation_Metadata
citation
;
Software_Metadata
();
void
display_information
(
std
::
ostream
&
os
);
void
insert_in_open_xml_pugi
(
pugi
::
xml_node
&
insert_here
);
};
class
MultiCellDS_Metadata
{
private:
public:
std
::
string
MultiCellDS_type
;
Software_Metadata
program
;
Citation_Metadata
data_citation
;
// scientific information
std
::
string
spatial_units
;
std
::
string
time_units
;
std
::
string
runtime_units
;
double
current_time
;
double
current_runtime
;
std
::
string
description
;
// any optional text -- not implemented
MultiCellDS_Metadata
();
void
display_information
(
std
::
ostream
&
os
);
void
sync_to_microenvironment
(
Microenvironment
&
M
);
void
restart_runtime
(
void
);
void
add_to_open_xml_pugi
(
double
current_simulation_time
,
pugi
::
xml_document
&
xml_dom
);
};
extern
MultiCellDS_Metadata
BioFVM_metadata
;
/* setting up the main MultiCellDS tree structure */
void
add_MultiCellDS_main_structure_to_open_xml_pugi
(
pugi
::
xml_document
&
xml_dom
);
/* set options */
void
set_save_biofvm_mesh_as_matlab
(
bool
newvalue
);
// default: true
void
set_save_biofvm_data_as_matlab
(
bool
newvalue
);
// default: true
void
set_save_biofvm_cell_data
(
bool
newvalue
);
// default: true
void
set_save_biofvm_cell_data_as_custom_matlab
(
bool
newvalue
);
// default: true
/* writing parts of BioFVM to a MultiCellDS file */
void
add_BioFVM_substrates_to_open_xml_pugi
(
pugi
::
xml_document
&
xml_dom
,
std
::
string
filename_base
,
Microenvironment
&
M
);
void
add_BioFVM_basic_agent_to_open_xml_pugi
(
pugi
::
xml_document
&
xml_dom
,
Basic_Agent
&
BA
);
// not implemented -- future edition
void
add_BioFVM_agents_to_open_xml_pugi
(
pugi
::
xml_document
&
xml_dom
,
std
::
string
filename_base
,
Microenvironment
&
M
);
void
add_BioFVM_to_open_xml_pugi
(
pugi
::
xml_document
&
xml_dom
,
std
::
string
filename_base
,
double
current_simulation_time
,
Microenvironment
&
M
);
void
save_BioFVM_to_MultiCellDS_xml_pugi
(
std
::
string
filename_base
,
Microenvironment
&
M
,
double
current_simulation_time
);
/* future / not yet supported */
void
read_BioFVM_from_open_xml_pugi
(
pugi
::
xml_document
&
xml_dom
,
std
::
string
filename_base
,
double
&
current_simulation_time
,
Microenvironment
&
M
);
void
read_BioFVM_to_MultiCellDS_xml_pugi
(
std
::
string
filename_base
,
Microenvironment
&
M
,
double
&
current_simulation_time
);
/* partly-implemented code snippets -- not to be used as of March 2016 */
// functions to read multiscale_microenvironment from MultiCellDS file (requires pugixml)
void
read_microenvironment_from_MultiCellDS_xml
(
Microenvironment
&
M_destination
,
std
::
string
filename
);
void
read_microenvironment_from_MultiCellDS_xml
(
Microenvironment
&
M_destination
,
pugi
::
xml_document
&
xml_dom
);
};
#endif
src/BioFVM/BioFVM_agent_container.cpp
deleted
100644 → 0
View file @
3b61c022
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.7) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#include "BioFVM_agent_container.h"
#include "BioFVM_basic_agent.h"
#include "BioFVM_vector.h"
namespace
BioFVM
{
Agent_Container
::
Agent_Container
(){}
void
Agent_Container
::
initialize
(
int
num_voxels
){}
void
Agent_Container
::
register_agent
(
Basic_Agent
*
agent
){}
void
Agent_Container
::
remove_agent
(
Basic_Agent
*
agent
){}
void
Agent_Container
::
add_agent_to_outer_voxel
(
Basic_Agent
*
agent
){}
void
Agent_Container
::
remove_agent_from_voxel
(
Basic_Agent
*
agent
,
int
voxel_index
){}
void
Agent_Container
::
add_agent_to_voxel
(
Basic_Agent
*
agent
,
int
voxel_index
){}
void
Agent_Container
::
update_all_cells
(
double
dt
){}
};
\ No newline at end of file
src/BioFVM/BioFVM_agent_container.h
deleted
100644 → 0
View file @
3b61c022
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.7) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#ifndef __BioFVM_agent_container_h__
#define __BioFVM_agent_container_h__
#include <vector>
namespace
BioFVM
{
class
Basic_Agent
;
class
Microenvironment
;
class
Agent_Container
{
private:
public:
std
::
vector
<
std
::
vector
<
Basic_Agent
*>
>
agent_grid
;
Agent_Container
();
void
register_agent
(
Basic_Agent
*
agent
);
void
initialize
(
int
num_voxels
);
void
remove_agent
(
Basic_Agent
*
agent
);
void
add_agent_to_outer_voxel
(
Basic_Agent
*
agent
);
void
remove_agent_from_voxel
(
Basic_Agent
*
agent
,
int
voxel_index
);
void
add_agent_to_voxel
(
Basic_Agent
*
agent
,
int
voxel_index
);
void
update_all_cells
(
double
dt
);
};
int
find_escaping_face_index
(
Basic_Agent
*
agent
);
};
#endif
src/BioFVM/BioFVM_basic_agent.cpp
deleted
100644 → 0
View file @
3b61c022
/*
#############################################################################
# If you use BioFVM in your project, please cite BioFVM and the version #
# number, such as below: #
# #
# We solved the diffusion equations using BioFVM (Version 1.1.7) [1] #
# #
# [1] A. Ghaffarizadeh, S.H. Friedman, and P. Macklin, BioFVM: an efficient #
# parallelized diffusive transport solver for 3-D biological simulations,#
# Bioinformatics 32(8): 1256-8, 2016. DOI: 10.1093/bioinformatics/btv730 #
# #
#############################################################################
# #
# BSD 3-Clause License (see https://opensource.org/licenses/BSD-3-Clause) #
# #
# Copyright (c) 2015-2017, Paul Macklin and the BioFVM Project #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# 1. Redistributions of source code must retain the above copyright notice, #
# this list of conditions and the following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the distribution. #
# #
# 3. Neither the name of the copyright holder nor the names of its #
# contributors may be used to endorse or promote products derived from this #
# software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, #
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR #
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF #
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING #
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS #
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #
# #
#############################################################################
*/
#include "BioFVM_basic_agent.h"
#include "BioFVM_agent_container.h"
#include "BioFVM_vector.h"
namespace
BioFVM
{
std
::
vector
<
Basic_Agent
*>
all_basic_agents
(
0
);
Basic_Agent
::
Basic_Agent
()
{
//give the agent a unique ID
static
int
max_basic_agent_ID
=
0
;
ID
=
max_basic_agent_ID
;
//
max_basic_agent_ID
++
;
// initialize position and velocity
is_active
=
true
;
volume
=
1.0
;
position
.
assign
(
3
,
0.0
);
velocity
.
assign
(
3
,
0.0
);
previous_velocity
.
assign
(
3
,
0.0
);
// link into the microenvironment, if one is defined
secretion_rates
=
new
std
::
vector
<
double
>
(
0
);
uptake_rates
=
new
std
::
vector
<
double
>
(
0
);
saturation_densities
=
new
std
::
vector
<
double
>
(
0
);
net_export_rates
=
new
std
::
vector
<
double
>
(
0
);
// extern Microenvironment* default_microenvironment;
// register_microenvironment( default_microenvironment );
internalized_substrates
=
new
std
::
vector
<
double
>
(
0
);
//
fraction_released_at_death
=
new
std
::
vector
<
double
>
(
0
);
fraction_transferred_when_ingested
=
new
std
::
vector
<
double
>
(
0
);
register_microenvironment
(
get_default_microenvironment
()
);
// these are done in register_microenvironment
// internalized_substrates.assign( get_default_microenvironment()->number_of_densities() , 0.0 );
return
;
}
void
Basic_Agent
::
update_position
(
double
dt
){
//make sure to update current_voxel_index if you are implementing this function
};
bool
Basic_Agent
::
assign_position
(
std
::
vector
<
double
>
new_position
)
{
return
assign_position
(
new_position
[
0
],
new_position
[
1
],
new_position
[
2
]);
}
bool
Basic_Agent
::
assign_position
(
double
x
,
double
y
,
double
z
)
{
if
(
!
get_microenvironment
()
->
mesh
.
is_position_valid
(
x
,
y
,
z
))
{
// std::cout<<"Error: the new position for agent "<< ID << " is invalid: "<<x<<","<<y<<","<<"z"<<std::endl;
return
false
;
}
position
[
0
]
=
x
;
position
[
1
]
=
y
;
position
[
2
]
=
z
;
update_voxel_index
();
// make sure the agent is not already registered
get_microenvironment
()
->
agent_container
->
register_agent
(
this
);
return
true
;
}
void
Basic_Agent
::
update_voxel_index
()
{
if
(
!
get_microenvironment
()
->
mesh
.
is_position_valid
(
position
[
0
],
position
[
1
],
position
[
2
]))
{
current_voxel_index
=-
1
;
is_active
=
false
;
return
;
}
current_voxel_index
=
microenvironment
->
nearest_voxel_index
(
position
);
}
int
mycount
=
0
;
void
Basic_Agent
::
set_internal_uptake_constants
(
double
dt
)
{
// overall form: dp/dt = S*(T-p) - U*p
// p(n+1) - p(n) = dt*S(n)*T(n) - dt*( S(n) + U(n))*p(n+1)
// p(n+1)*temp2 = p(n) + temp1
// p(n+1) = ( p(n) + temp1 )/temp2
//int nearest_voxel= current_voxel_index;
/*
// new for tracking internal densities
if( use_internal_densities_as_targets == true )
{
*saturation_densities = *internalized_substrates;
*saturation_densities /= ( 1e-15 + volume );
}
*/
double
internal_constant_to_discretize_the_delta_approximation
=
dt
*
volume
/
(
(
microenvironment
->
voxels
(
current_voxel_index
)).
volume
)
;
// needs a fix
// temp1 = dt*(V_cell/V_voxel)*S*T
cell_source_sink_solver_temp1
.
assign
(
(
*
secretion_rates
).
size
()
,
0.0
);
cell_source_sink_solver_temp1
+=
*
secretion_rates
;
cell_source_sink_solver_temp1
*=
*
saturation_densities
;
cell_source_sink_solver_temp1
*=
internal_constant_to_discretize_the_delta_approximation
;
// total_extracellular_substrate_change.assign( (*secretion_rates).size() , 1.0 );
// temp2 = 1 + dt*(V_cell/V_voxel)*( S + U )
cell_source_sink_solver_temp2
.
assign
(
(
*
secretion_rates
).
size
()
,
1.0
);
axpy
(
&
(
cell_source_sink_solver_temp2
)
,
internal_constant_to_discretize_the_delta_approximation
,
*
secretion_rates
);
axpy
(
&
(
cell_source_sink_solver_temp2
)
,
internal_constant_to_discretize_the_delta_approximation
,
*
uptake_rates
);
// temp for net export
cell_source_sink_solver_temp_export1
=
*
net_export_rates
;
cell_source_sink_solver_temp_export1
*=
dt
;
// amount exported in dt of time
cell_source_sink_solver_temp_export2
=
cell_source_sink_solver_temp_export1
;
cell_source_sink_solver_temp_export2
/=
(
(
microenvironment
->
voxels
(
current_voxel_index
)).
volume
)
;
// change in surrounding density
volume_is_changed
=
false
;
return
;
}
void
Basic_Agent
::
register_microenvironment
(
Microenvironment
*
microenvironment_in
)
{
microenvironment
=
microenvironment_in
;
secretion_rates
->
resize
(
microenvironment
->
density_vector
(
0
).
size
()
,
0.0
);
saturation_densities
->
resize
(
microenvironment
->
density_vector
(
0
).
size
()
,
0.0
);
uptake_rates
->
resize
(
microenvironment
->
density_vector
(
0
).
size
()
,
0.0
);
net_export_rates
->
resize
(
microenvironment
->
density_vector
(
0
).
size
()
,
0.0
);