Class for containing chemical solutes, that are represented by a grid. More...
Public Member Functions | |
SoluteGrid (Simulator aSim, XMLParser xmlRoot) | |
Creates a solute grid for a solute specified in the simulation protocol file. More... | |
SoluteGrid (int nI, int nJ, int nK, double res) | |
Constructor used to establish a solute grid when creating multigrids. Simply calls the SpatialGrid constructor. More... | |
SoluteGrid (int nI, int nJ, int nK, double res, String aName, Domain aDomain) | |
Creates a solute grid of a specified size and resolution, and with a given name. Example - Used to define computation domain. More... | |
SoluteGrid (int nI, int nJ, int nK, double res, SoluteGrid aSolG) | |
Class for creating a new solute grid using a previous solute grid. More... | |
SoluteGrid (SoluteGrid aSolG) | |
Initialise a solute grid based on the properties of another provided grid. More... | |
void | useExternalSoluteGrid (SoluteGrid aSolG) |
Initialise a new solute grid, cloning the properties of a provided solute grid. More... | |
void | useDomaingrid () |
Use the size and the resolution used to define the computation domain to define the solute grid. More... | |
void | specifyResolution (double reso) |
Set the resolution of the solute grid on the value specified in the protocol file. More... | |
void | refreshBoundary () |
Examines all objects at the boundary of the grid, and adjusts them as specified by the boundary condition rules. More... | |
String | getName () |
Returns the name of this solute grid. More... | |
double | getDiffusivity () |
Returns the diffusivity of the solute in this grid. More... | |
Domain | getDomain () |
Returns the computation domain that this solute is associated with. More... | |
Public Member Functions inherited from simulator.SpatialGrid | |
SpatialGrid () | |
Blank constructor. More... | |
SpatialGrid (int nI, int nJ, int nK, double resolution) | |
Default constructor for an empty spatial grid. More... | |
SpatialGrid (int nI, int nJ, double resolution) | |
Default constructor for an empty 2D spatial grid. More... | |
boolean | isValid (DiscreteVector dC) |
Determine if a given discrete position is valid or outside the grid (Padding excluded) More... | |
boolean | isValidOrPadded (DiscreteVector dC) |
Determine if a given discrete position is valid or outside the grid (Padding included) More... | |
boolean | isValidorPadded (int i, int j, int k) |
Determine if a given voxel coordinate is valid or outside the grid. More... | |
boolean | isValid (ContinuousVector cc) |
Determine if a given continuous location is valid or outside the grid. More... | |
boolean | isValidOrPadded (ContinuousVector cc) |
Test if a location is valid or is outside the grid. Note padding is included as valid. More... | |
DiscreteVector | getDiscreteCoordinates (ContinuousVector cC) |
Transform a location, expressed as a continuous vector into a discrete position on the basis of the resolution of the grid. More... | |
ContinuousVector | getContinuousCoordinates (DiscreteVector dC) |
Transform a position, expressed as a discrete vector into a continuous location on the basis of the resolution of the grid. More... | |
ContinuousVector | getContinuousCoordinates (int i, int j, int k) |
Convert a set of voxel coordinates into a continuous vector. More... | |
double | getMax () |
Return the maximum value on this grid (padding included) More... | |
double | getAverage () |
Return the average value on this grid (padding included) More... | |
double | getSum () |
Return the sum of this grid. More... | |
double | getMin () |
Return the minimum value on this grid (padding included) More... | |
double | diff2X (int i, int j, int k) |
For a given location, calculate the 2nd spatial derivative according to X. More... | |
double | diff2X (DiscreteVector dV) |
For a given location, expressed as a discrete vector, calculate the 2nd spatial derivative according to X. More... | |
double | diffX (int i, int j, int k) |
For a given location, calculate the 1st spatial derivative according to X. More... | |
double | diffX (DiscreteVector dV) |
For a given location, expressed as a discrete vector, calculate the 1st spatial derivative according to X. More... | |
double | diff2Y (int i, int j, int k) |
For a given location, calculate the 2nd spatial derivative according to Y. More... | |
double | diff2Y (DiscreteVector dV) |
For a given location, expressed as a discrete vector, calculate the 2nd spatial derivative according to Y. More... | |
double | diffY (int i, int j, int k) |
For a given location, calculate the 1st spatial derivative according to Y. More... | |
double | diffY (DiscreteVector dV) |
For a given location, expressed as a discrete vector, calculate the 1st spatial derivative according to Y. More... | |
double | diff2Z (int i, int j, int k) |
For a given location, calculate the 2nd spatial derivative according to Z. More... | |
double | diffZ (int i, int j, int k) |
For a given location, calculate the 1st spatial derivative according to Z. More... | |
double | diffZ (DiscreteVector dV) |
For a given location, expressed as a discrete vector, calculate the 1st spatial derivative according to Z. More... | |
double | getValueAround (ContinuousVector cC, double extReso) |
Computes the average concentration seen in a sphere (or cube) centered around a given point. More... | |
double | getValueAround (LocatedAgent aLocAgent) |
Returns the average grid value seen in a sphere (or cube) located around a given agent. More... | |
double | getValueAt (ContinuousVector cC) |
Return the value stored at the location given by the stated continuous vector. More... | |
ContinuousVector | getGradient (ContinuousVector cC) |
Returns a vector of the first spatial derivatives in x, y & z. More... | |
ContinuousVector | getGradient2D (ContinuousVector cC) |
Returns a vector of the first spatial derivatives in x and y, for 2D simulations. More... | |
double | getValueAt (DiscreteVector dV) |
Return the value on the padded grid at a given position (the coordinates are NOT corrected) More... | |
double | getValueAt (int i, int j, int k) |
Return the value on the padded grid at a given position (the coordinates are NOT corrected) More... | |
void | setValueAt (double value, ContinuousVector cC) |
Set a grid location, expressed as a ContinuousVector, to a specified value. The coordinates are corrected. More... | |
void | setValueAt (double value, DiscreteVector dC) |
Set a grid location, expressed as a DiscreteVector, to a specified value. The coordinates are corrected. More... | |
void | setValueAt (double value, int i, int j, int k) |
Set a grid location to a specified value. Note the coordinates are NOT corrected. More... | |
void | addValueAt (double value, ContinuousVector cC) |
Add a value to that contained at the given discrete coordinates of this grid. Coordinates are corrected for padding. More... | |
void | addValueAt (double value, DiscreteVector dC) |
Add a value to that contained at the given discrete coordinates of this grid. Coordinates are corrected for padding. More... | |
void | addAllValues (double value) |
Add a value to all locations on this grid (including the padding) More... | |
void | truncateValueAt (int i, int j, int k) |
Checks a value at a given location and sets it to zero if the value is negative. More... | |
void | setAllValueAt (double value) |
Set all meshes of a grid with the same value (including the padding - if not a chemostat run) More... | |
int | getGridSizeI () |
Return the number of voxels in the X direction. More... | |
int | getGridSizeJ () |
Return the number of voxels in the Y direction. More... | |
int | getGridSizeK () |
Return the number of voxels in the Z direction. More... | |
int | getGridTotalSize (int axeCode) |
Return the number of voxels along a given direction (axeCode) More... | |
double | getGridLength (int axeCode) |
Returns the length (in distance unit) along a given direction. More... | |
double | getVoxelVolume () |
Return the volume of one voxel of the spatial grid. More... | |
double[][][] | getGrid () |
Return the whole grid including the padding. More... | |
double[][][] | getCloneGrid () |
Return a clone of this spatial grid. More... | |
double | getResolution () |
Returns the resolution of this spatial grid. More... | |
boolean | is3D () |
Determine if this spatial grid is 3D or 2D. More... | |
void | setGrid (double[][][] u) |
Set the values of this spatial grid to those contained in the supplied grid. More... | |
void | writeReport (ResultFile bufferState, ResultFile bufferSummary) throws Exception |
Write the contents of this grid to the XML results files. More... | |
Public Attributes | |
int | soluteIndex |
double | diffusivity |
Public Attributes inherited from simulator.SpatialGrid | |
String | gridName |
String | gridUnit = "g.L-1" |
double[][][] | grid |
Additional Inherited Members | |
Protected Member Functions inherited from simulator.SpatialGrid | |
void | initGrids () |
Creates the solute grid at the required size. More... | |
Protected Attributes inherited from simulator.SpatialGrid | |
int | _nI |
int | _nJ |
int | _nK |
double | _reso |
boolean | _is3D |
Class for containing chemical solutes, that are represented by a grid.
Class for containing chemical solutes, that are represented by a grid. The grid is a padded 2D or 3D grid as specified in the protocol file, unless the simulation is being run in chemostat conditions. Solute diffusivity is expressed in the local time unit
Creates a solute grid for a solute specified in the simulation protocol file.
Each of the solutes specified in the XML protocol file exists in iDynoMiCS within its own solute grid. This constructor is used by createSolutes (in the Simulator class) to create the grids for each solute. Once created, the grid is populated with the initial concentration value of this solute
aSim | The simulator object in which the conditions specified in the protocol file are being created |
xmlRoot | The solute XML element being processed |
simulator.SoluteGrid.SoluteGrid | ( | int | nI, |
int | nJ, | ||
int | nK, | ||
double | res | ||
) |
Constructor used to establish a solute grid when creating multigrids. Simply calls the SpatialGrid constructor.
Constructor used to establish a solute grid when creating multigrids. Simply calls the SpatialGrid constructor
nI | Number of grid elements in X direction of grid |
nJ | Number of grid elements in Y direction of grid |
nK | Number of grid elements in Z direction of grid |
res | The width of each grid element (in micrometres) |
simulator.SoluteGrid.SoluteGrid | ( | int | nI, |
int | nJ, | ||
int | nK, | ||
double | res, | ||
String | aName, | ||
Domain | aDomain | ||
) |
Creates a solute grid of a specified size and resolution, and with a given name. Example - Used to define computation domain.
Creates a solute grid of a specified size and resolution, as calculated by the Domain class, and with the name specified in the protocol file.
nI | Number of grid elements in X direction of grid |
nJ | Number of grid elements in Y direction of grid |
nK | Number of grid elements in Z direction of grid |
res | The width of each grid element (in micrometres) |
aName | The type of grid being created (e.g. domainGrid) |
aDomain | The computation domain to which this grid is part of |
simulator.SoluteGrid.SoluteGrid | ( | int | nI, |
int | nJ, | ||
int | nK, | ||
double | res, | ||
SoluteGrid | aSolG | ||
) |
Class for creating a new solute grid using a previous solute grid.
Class for creating a new solute grid using a previous solute grid
nI | Number of grid elements in X direction of grid |
nJ | Number of grid elements in Y direction of grid |
nK | Number of grid elements in Z direction of grid |
res | The width of each grid element (in micrometres) |
aSolG | The solute grid to use to create this grid |
simulator.SoluteGrid.SoluteGrid | ( | SoluteGrid | aSolG | ) |
Initialise a solute grid based on the properties of another provided grid.
Initialise a solute grid based on the properties of another provided grid
aSolG | Solute grid on which to base a new solute grid |
double simulator.SoluteGrid.getDiffusivity | ( | ) |
Returns the diffusivity of the solute in this grid.
Returns the diffusivity of the solute in this grid, as was specified in the protocol file
Domain simulator.SoluteGrid.getDomain | ( | ) |
Returns the computation domain that this solute is associated with.
Returns the computation domain that this solute is associated with
String simulator.SoluteGrid.getName | ( | ) |
Returns the name of this solute grid.
Returns the name of this solute grid, as was specified in the protocol file
void simulator.SoluteGrid.refreshBoundary | ( | ) |
Examines all objects at the boundary of the grid, and adjusts them as specified by the boundary condition rules.
Examines all objects at the boundary of the grid, and adjusts them as specified by the boundary condition rules
void simulator.SoluteGrid.specifyResolution | ( | double | reso | ) |
Set the resolution of the solute grid on the value specified in the protocol file.
This allows the resolution of the solute grid to differ from that of the domain. Takes the resolution value specified when this solute value was declared and makes this the resolution of the grid
reso | Double value specified in the resolution tag of the solute markup in the protocol file |
void simulator.SoluteGrid.useDomaingrid | ( | ) |
Use the size and the resolution used to define the computation domain to define the solute grid.
Use the size and the resolution used to define the computation domain to define the solute grid. This is in cases where the protocol file does not specifically specify a resolution to use for this solute
void simulator.SoluteGrid.useExternalSoluteGrid | ( | SoluteGrid | aSolG | ) |
Initialise a new solute grid, cloning the properties of a provided solute grid.
Initialise a new solute grid, cloning the properties of a provided solute grid
aSolG | Solute grid for which the properties are being copied for this new grid |
double simulator.SoluteGrid.diffusivity |
Diffusivity of this solute in water, if specified in the protocol file
int simulator.SoluteGrid.soluteIndex |
All solute names are stored in a simulation dictionary. This holds the position of this solute in this list