Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
simulator.geometry.Domain Class Reference

Define the computation domain: an evenly spaced rectilinear grid described by its dimensionality (2D or 3D) More...

Inheritance diagram for simulator.geometry.Domain:
simulator.geometry.IsComputationDomain

Public Member Functions

 Domain (Simulator aSim, XMLParser cdRoot)
 Creates a computation domain compartment object with attributes specified in the protocol file. More...
 
SoluteGrid createGrid (String gridName, double defaultValue)
 Creates a solute or species grid and initialises the values within that grid. Used to create boundary and biomass grids. More...
 
void applyAllBoundary ()
 Applies all specified domain boundaries to this computation domain one by one. More...
 
AllBC testCrossedBoundary (ContinuousVector newLoc)
 Test if a given location is outside a boundary. Used to detect the crossed boundary when moving an agent. More...
 
AllBC testCrossedBoundarySelfAttach (ContinuousVector newLoc)
 Test if a given location is outside a boundary other than the bottom. Used in self-attach scenarios. More...
 
void addBoundary (AllBC aBC)
 Add a boundary condition to the list of boundaries on this domain. More...
 
LinkedList< AllBCgetAllBoundaries ()
 Return all the boundary conditions applicable to this domain. More...
 
void calculateTopOfBoundaryLayer ()
 Creates an array list containing the 'i' coordinate of the computation domain that is the top of the boundary layer. More...
 
void refreshBioFilmGrids ()
 Refresh relative diffusivity and boundary layer grids to ensure biomass updated this step is included. More...
 
void calculateComputationDomainGrids ()
 Calculates the diffusivity and boundary layer grid levels. More...
 
LinkedList< DiscreteVectorgetBorder ()
 Returns a list of discrete vectors that specify the limit of the boundary layer. More...
 
double[] getInterface ()
 Creates a list of doubles with the heights of the biofilm/liquid interface. Used for writing simulation statistics. More...
 
double getLongestSize ()
 Return longest side of this domain. More...
 
double getResolution ()
 Return the resolution of this domain. More...
 
SpatialGrid getGrid ()
 Returns the domain grid. More...
 
String getName ()
 Return the name of this domain. More...
 
boolean is3D ()
 Determine if the simulation is recreating a 3D environment. More...
 
SoluteGrid getDiffusivity ()
 Return the diffusivity grid associated with this domain. More...
 
SoluteGrid getBoundaryLayer ()
 Return the boundary layer grid associated with this domain. More...
 
SoluteGrid getBiomass ()
 Return the biomass grid associated with this domain. More...
 
void printTopOfBoundaryLayerArray ()
 Used in testing to check the top of the boundary layer was calculated correctly. More...
 
void printBoundaryLayer ()
 Used in testing to view the boundary layer matrix for a set part of the domain. More...
 
void printBioMassGrid ()
 Used in testing to view the biomass matrix for a set part of the domain. More...
 

Public Attributes

String domainName
 
double length_X
 
double length_Y
 
double length_Z
 
boolean is3D
 
int _nI
 
int _nJ
 
int _nK
 
double _resolution
 
double[][] _topOfBoundaryLayer
 
SoluteGrid _biomassGrid
 

Protected Member Functions

int checkDilationRadius (int n, int m, int l)
 Sets the value of a grid space in the boundary layer, indicating whether the space is part of the boundary layer, or biomass is present. More...
 
final int cyclicIndex (int val, int limit)
 For cyclic boundaries, returns the index of the grid space on the opposite side of the boundary. More...
 

Protected Attributes

Simulator currentSim
 
int _i
 
int _j
 
int _k
 
SpatialGrid _domainGrid
 
SoluteGrid _boundaryLayer
 
SoluteGrid _diffusivityGrid
 
double _dilationBand
 
double specificArea
 
double _biofilmDiffusivity = 1d
 

Detailed Description

Define the computation domain: an evenly spaced rectilinear grid described by its dimensionality (2D or 3D)

The computation domain is an evenly spaced rectilinear grid described by its dimensionality (2D or 3D), its size, geometry and the behaviour at its boundaries. See Figure 1 of the Lardon et al paper (2011) for a good description on how this is divided into several regions - the support, the bulk, the biofilm matrix, and the diffusion boundary layer.

Since
June 2006
Version
1.2
Author
Andreas Dötsch (andre.nosp@m.as.d.nosp@m.oetsc.nosp@m.h@he.nosp@m.lmhol.nosp@m.tz-h.nosp@m.zi.de), Helmholtz Centre for Infection Research (Germany)
Laurent Lardon (lardo.nosp@m.nl@s.nosp@m.upagr.nosp@m.o.in.nosp@m.ra.fr), INRA, France
Brian Merkey (brim@.nosp@m.env..nosp@m.dtu.d.nosp@m.k, bvm@n.nosp@m.orth.nosp@m.weste.nosp@m.rn.e.nosp@m.du), Department of Engineering Sciences and Applied Mathematics, Northwestern University (USA)
Sónia Martins (SCM80.nosp@m.8@bh.nosp@m.am.ac.nosp@m..uk), Centre for Systems Biology, University of Birmingham (UK)
Kieran Alden (k.j.a.nosp@m.lden.nosp@m.@bham.nosp@m..ac..nosp@m.uk), Centre for Systems Biology, University of Birmingham (UK)

Constructor & Destructor Documentation

simulator.geometry.Domain.Domain ( Simulator  aSim,
XMLParser  cdRoot 
)

Creates a computation domain compartment object with attributes specified in the protocol file.

The computation domain is an evenly spaced rectilinear grid described by its dimensionality (2D or 3D), its size, geometry and the behaviour at its boundaries. See Figure 1 of the Lardon et al paper (2011) for a good description on how this is divided into several regions - the support, the bulk, the biofilm matrix, and the diffusion boundary layer. The definition within the computationDomain markup of the protocol file notes how these regions are set up. This constructor sets up each computation domain that is specified in the protocol file.

Parameters
aSimThe simulation object upon which the scenario specified in the protocol file is being run
cdRootThe XML tag objects that sub-nodes of the 'Bulk' tag in the protocol file

Member Function Documentation

void simulator.geometry.Domain.addBoundary ( AllBC  aBC)

Add a boundary condition to the list of boundaries on this domain.

Add a boundary condition to the list of boundaries on this domain

Parameters
aBCBoundary condition to add to the list of boundaries
void simulator.geometry.Domain.applyAllBoundary ( )

Applies all specified domain boundaries to this computation domain one by one.

This method should be used when you have finished to register all boundary conditions; this function will populate a 3-D matrix. Apply all boundaries one after one ; a point is outside of the computational domain if it is declared outside by at least one of the Boundary Conditions

void simulator.geometry.Domain.calculateComputationDomainGrids ( )

Calculates the diffusivity and boundary layer grid levels.

Calculates the diffusivity and boundary layer grid levels. In previous versions of iDynoMiCS this method could be found within refreshBioFilmGrids. This has been moved here as, with the addition of self attachment, this method needs to be called before agent initialisation. KA May 2013

void simulator.geometry.Domain.calculateTopOfBoundaryLayer ( )

Creates an array list containing the 'i' coordinate of the computation domain that is the top of the boundary layer.

Creates an array list containing the 'i' coordinate of the computation domain that is the top of the boundary layer. Note that this is in the resolution specified by the 'resolution' parameter in the computation domain section of the protocol file, and this may need to be adjusted if being used in calculations where the resolution differs

int simulator.geometry.Domain.checkDilationRadius ( int  n,
int  m,
int  l 
)
protected

Sets the value of a grid space in the boundary layer, indicating whether the space is part of the boundary layer, or biomass is present.

Sets the value of a grid space in the boundary layer, indicating whether the space is part of the boundary layer, or biomass is present

Parameters
nThe N coordinate of the grid to check whether this square is in the boundary
mThe M coordinate of the grid to check whether this square is in the boundary
lThe L coordinate of the grid to check whether this square is in the boundary
Returns
Integer noting whether or not the square is in the boundary (1 if yes, 0 if not)
SoluteGrid simulator.geometry.Domain.createGrid ( String  gridName,
double  defaultValue 
)

Creates a solute or species grid and initialises the values within that grid. Used to create boundary and biomass grids.

Creates a solute or species grid and initialises the values within that grid. Used to create boundary and biomass grids

Parameters
gridNameThe name of the grid being created (e.g. boundaryLayer / totalBioMass)
defaultValueThe default value to assign to all grid spaces
Returns
Initialised solute grid of the size required by the simulation, initialised to the given default value
final int simulator.geometry.Domain.cyclicIndex ( int  val,
int  limit 
)
protected

For cyclic boundaries, returns the index of the grid space on the opposite side of the boundary.

For cyclic boundaries, returns the index of the grid space on the opposite side of the boundary

Parameters
valThe integer grid spqce to check
limitThe limit of the grid
Returns
The integer of the grid square the opposite side of the boundary
LinkedList<AllBC> simulator.geometry.Domain.getAllBoundaries ( )

Return all the boundary conditions applicable to this domain.

Return all the boundary conditions applicable to this domain

Returns
LinkedList of boundary conditions for this domain

Implements simulator.geometry.IsComputationDomain.

SoluteGrid simulator.geometry.Domain.getBiomass ( )

Return the biomass grid associated with this domain.

Return the biomass grid associated with this domain

Returns
SoluteGrid containing biomass throughout this domain

Implements simulator.geometry.IsComputationDomain.

LinkedList<DiscreteVector> simulator.geometry.Domain.getBorder ( )

Returns a list of discrete vectors that specify the limit of the boundary layer.

Returns a list of discrete vectors that specify the limit of the boundary layer

Returns
LinkedList of DiscreteVectors with the limit of the boundary layer

Implements simulator.geometry.IsComputationDomain.

SoluteGrid simulator.geometry.Domain.getBoundaryLayer ( )

Return the boundary layer grid associated with this domain.

Return the boundary layer associated with this domain

Returns
SoluteGrid containing boundary between bulk and biofilm

Implements simulator.geometry.IsComputationDomain.

SoluteGrid simulator.geometry.Domain.getDiffusivity ( )

Return the diffusivity grid associated with this domain.

Return the diffusivity grid associated with this domain

Returns
SoluteGrid containing diffusivity grid statistics

Implements simulator.geometry.IsComputationDomain.

SpatialGrid simulator.geometry.Domain.getGrid ( )

Returns the domain grid.

Returns the domain grid

Returns
SpatialGrid within this domain

Implements simulator.geometry.IsComputationDomain.

double [] simulator.geometry.Domain.getInterface ( )

Creates a list of doubles with the heights of the biofilm/liquid interface. Used for writing simulation statistics.

Creates a list of doubles with the heights of the biofilm/liquid interface. Used for writing simulation statistics. This routine is very basic in that it just captures the overall height (x-position) of each point from the nearest carrier, but for most cases it should be sufficient)

Returns
Array of double values of the heights of the biofilm/liquid interface
double simulator.geometry.Domain.getLongestSize ( )

Return longest side of this domain.

Return longest side of this domain

Returns
Double of the length of the longest side of this domain
String simulator.geometry.Domain.getName ( )

Return the name of this domain.

Return the name of this domain

Returns
Name of this domain

Implements simulator.geometry.IsComputationDomain.

double simulator.geometry.Domain.getResolution ( )

Return the resolution of this domain.

Return the resolution of this domain

Returns
Double value stating the resolution of this domain
boolean simulator.geometry.Domain.is3D ( )

Determine if the simulation is recreating a 3D environment.

Determine if the simulation is recreating a 3D environment

Returns
A boolean value stating whether or not the environment is 3D
void simulator.geometry.Domain.printBioMassGrid ( )

Used in testing to view the biomass matrix for a set part of the domain.

Used in testing to view the biomass matrix for a set part of the domain. KA 210513

void simulator.geometry.Domain.printBoundaryLayer ( )

Used in testing to view the boundary layer matrix for a set part of the domain.

Used in testing to view the boundary layer matrix for a set part of the domain. KA 210513

void simulator.geometry.Domain.printTopOfBoundaryLayerArray ( )

Used in testing to check the top of the boundary layer was calculated correctly.

Used in testing to check the top of the boundary layer was calculated correctly. KA 210513

void simulator.geometry.Domain.refreshBioFilmGrids ( )

Refresh relative diffusivity and boundary layer grids to ensure biomass updated this step is included.

Method to refresh relative diffusivity and boundary layer grids to ensure biomass updated this step is included. Used in the creation of output files

Implements simulator.geometry.IsComputationDomain.

AllBC simulator.geometry.Domain.testCrossedBoundary ( ContinuousVector  newLoc)

Test if a given location is outside a boundary. Used to detect the crossed boundary when moving an agent.

Test if a given location is outside a boundary. Used to detect the crossed boundary when moving an agent

Parameters
newLocThe location to test
Returns
Boundary that the point has crossed (if applicable - null if no boundary crossed)

Implements simulator.geometry.IsComputationDomain.

AllBC simulator.geometry.Domain.testCrossedBoundarySelfAttach ( ContinuousVector  newLoc)

Test if a given location is outside a boundary other than the bottom. Used in self-attach scenarios.

Test if a given location is outside a boundary other than the bottom. For self-attachment, the simulation detects a swimming agent may have crossed the substratum boundary and will then assume that agent attaches. However we need to check that move has not crossed any of the other boundaries, else that move is invalid. To do this, all boundaries are checked. If using the method above, y0z could still be returned and thus we end up in a loop. Thus this has had to be adapted so this cannot be returned

Parameters
newLocThe new location of this swimming agent
Returns
The boundary which this move crosses, if applicable. Null if no such boundary

Member Data Documentation

double simulator.geometry.Domain._biofilmDiffusivity = 1d
protected

Factor used to decrease solute diffusivity inside the biofilm. Multiplicative factor applied to the diffusivity in water

SoluteGrid simulator.geometry.Domain._biomassGrid

Grid to hold total biomass in a particular area

SoluteGrid simulator.geometry.Domain._boundaryLayer
protected

Boundary layer between bulk and biofilm

SoluteGrid simulator.geometry.Domain._diffusivityGrid
protected

Diffusivity of solutes in each area of this domain

double simulator.geometry.Domain._dilationBand
protected

Band between the boundary and bulk, capturing change in diffusivity and solute levels

SpatialGrid simulator.geometry.Domain._domainGrid
protected

The solute grid that is a component of this computation domain

int simulator.geometry.Domain._i
protected
int simulator.geometry.Domain._j
protected
int simulator.geometry.Domain._k
protected
int simulator.geometry.Domain._nI

Number of grid elements in the x direction

int simulator.geometry.Domain._nJ

Number of grid elements in the y direction

int simulator.geometry.Domain._nK

Number of grid elements in the z direction

double simulator.geometry.Domain._resolution

Width of each side of the grid element (in micrometres)

double [][] simulator.geometry.Domain._topOfBoundaryLayer

Array to hold the X position that is the top of the boundary layer in each of the Y and Z positions. Used for self-attach scenarios

Simulator simulator.geometry.Domain.currentSim
protected

The simulation object being used to simulate the conditions specified in the protocol file

String simulator.geometry.Domain.domainName

Name of this computation domain, as supplied in the specified protocol file

boolean simulator.geometry.Domain.is3D

Whether this computation domain is two or three dimensional

double simulator.geometry.Domain.length_X

Domain X dimension in micrometers

double simulator.geometry.Domain.length_Y

Domain Y dimension in micrometers

double simulator.geometry.Domain.length_Z

Domain Z dimension in micrometers

double simulator.geometry.Domain.specificArea
protected

The ratio between the carrier surface (the substratum on which the biofilm grows) and the bulk compartment volume. The physical volume of the system that appears in the simulation definition. In m2/m3.


The documentation for this class was generated from the following file: