Changeset - e7eab96321ce
[Not reviewed]
default
0 10 20
Roeland Merks - 15 years ago 2010-06-09 16:14:29
roeland.merks@cwi.nl
Added finalized tutorial code. Added new header files that provide simplified constructs for summing up concentrations in walls. Also added a new function for resetting all walls of a cell.
New menu items in canvas for resetting chemical values only in cells or only in walls.

--
user: Roeland Merks <roeland.merks@cwi.nl>
branch 'default'
added src/TutorialCode/Tutorial1A/mymodel.cpp
added src/TutorialCode/Tutorial1A/mymodel.h
added src/TutorialCode/Tutorial1A/mymodel.pro
added src/TutorialCode/Tutorial1B/mymodel.cpp
added src/TutorialCode/Tutorial1B/mymodel.h
added src/TutorialCode/Tutorial1B/mymodel.pro
added src/TutorialCode/Tutorial1C/mymodel.cpp
added src/TutorialCode/Tutorial1C/mymodel.h
added src/TutorialCode/Tutorial1C/mymodel.pro
added src/TutorialCode/Tutorial1D/mymodel.cpp
added src/TutorialCode/Tutorial1D/mymodel.h
added src/TutorialCode/Tutorial1D/mymodel.pro
added src/TutorialCode/Tutorial3/tutorial3_init.xml
added src/TutorialCode/Tutorial4/auxin_growth_init.xml
added src/TutorialCode/Tutorial4/mymodel
added src/TutorialCode/Tutorial4/tutorial4_init.xml
added src/TutorialCode/Tutorial5/mymodel
added src/TutorialCode/Tutorial5/tutorial5_init.xml
added src/flux_function.h
added src/vleafmodel.h
changed src/Makefile
changed src/TutorialCode/Tutorial2/mymodel.cpp
changed src/TutorialCode/Tutorial3/mymodel.cpp
changed src/TutorialCode/Tutorial4/mymodel.cpp
changed src/TutorialCode/Tutorial4/mymodel.h
changed src/TutorialCode/Tutorial5/mymodel.cpp
changed src/TutorialCode/Tutorial5/mymodel.h
changed src/VirtualLeaf.pro
changed src/cellbase.cpp
changed src/cellbase.h
15 files changed:
0 comments (0 inline, 0 general)
src/Makefile
Show inline comments
 
# $Id: Makefile,v 3f0977faba37 2010/06/03 15:54:37 michael $
 
#############################################################################
 
# Makefile for building: ../bin/VirtualLeaf
 
# Generated by qmake (2.01a) (Qt 4.4.1) on: Wed Jun 9 16:00:42 2010
 
# Project:  VirtualLeaf.pro
 
# Template: app
 
# Command: /ufs/merks/Trolltech/Qt-4.4.1/bin/qmake -unix -o Makefile VirtualLeaf.pro
 
#############################################################################
 

	
 
####### Compiler, tools and options
 

	
 
CC            = gcc
 
CXX           = g++
 
DEFINES       = -DQTGRAPHICS -DREACTIONS_HEADER= -DREACTIONS_HEADER_STRING="" -DFLEMING -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
 
CFLAGS        = -m64 -pipe -O2 -D_REENTRANT -Wall -W $(DEFINES)
 
CXXFLAGS      = -m64 -pipe -fexceptions -fPIC -I/usr/include/libxml2 -DQTGRAPHICS -O2 -D_REENTRANT -Wall -W $(DEFINES)
 
INCPATH       = -I../../../Trolltech/Qt-4.4.1/mkspecs/linux-g++-64 -I. -I../../../Trolltech/Qt-4.4.1/include/QtCore -I../../../Trolltech/Qt-4.4.1/include/QtCore -I../../../Trolltech/Qt-4.4.1/include/QtGui -I../../../Trolltech/Qt-4.4.1/include/QtGui -I../../../Trolltech/Qt-4.4.1/include/Qt3Support -I../../../Trolltech/Qt-4.4.1/include/Qt3Support -I../../../Trolltech/Qt-4.4.1/include -I. -I.
 
LINK          = g++
 
LFLAGS        = -m64 -fPIC -Wl,-rpath,/ufs/merks/Trolltech/Qt-4.4.1/lib
 
LIBS          = $(SUBLIBS)  -L/ufs/guravage/opt/qwt-5.2.1-svn/lib -L/ufs/merks/Trolltech/Qt-4.4.1/lib -lxml2 -lQt3Support -L/ufs/merks/Trolltech/Qt-4.4.1/lib -lQtSql -pthread -pthread -pthread -pthread -lQtXml -pthread -pthread -pthread -pthread -L/usr/X11R6/lib64 -pthread -pthread -pthread -pthread -pthread -pthread -lQtNetwork -pthread -pthread -pthread -pthread -pthread -pthread -lQtGui -pthread -lpng -lSM -lICE -pthread -pthread -lXi -lXrender -lXrandr -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread
 
AR            = ar cqs
 
RANLIB        = 
 
QMAKE         = /ufs/merks/Trolltech/Qt-4.4.1/bin/qmake
 
TAR           = tar -cf
 
COMPRESS      = gzip -9f
 
COPY          = cp -f
 
SED           = sed
 
COPY_FILE     = $(COPY)
 
COPY_DIR      = $(COPY) -r
 
INSTALL_FILE  = install -m 644 -p
 
INSTALL_DIR   = $(COPY_DIR)
 
INSTALL_PROGRAM = install -m 755 -p
 
DEL_FILE      = rm -f
 
SYMLINK       = ln -sf
 
DEL_DIR       = rmdir
 
MOVE          = mv -f
 
CHK_DIR_EXISTS= test -d
 
MKDIR         = mkdir -p
 

	
 
####### Output directory
 

	
 
OBJECTS_DIR   = ./
 

	
 
####### Files
 

	
 
QMAKE = qmake
 
SOURCES       = apoplastitem.cpp \
 
		canvas.cpp \
 
		cellbase.cpp \
 
		cell.cpp \
 
		cellitem.cpp \
 
		mainbase.cpp \
 
		matrix.cpp \
 
		mesh.cpp \
 
		miscq.cpp \
 
		modelcatalogue.cpp \
 
		Neighbor.cpp \
 
		node.cpp \
 
		nodeitem.cpp \
 
		nodeset.cpp \
 
		OptionFileDialog.cpp \
 
		output.cpp \
 
		parameter.cpp \
 
		pardialog.cpp \
 
		parse.cpp \
 
		random.cpp \
 
		rungekutta.cpp \
 
		simitembase.cpp \
 
		transporterdialog.cpp \
 
		UniqueMessage.cpp \
 
		vector.cpp \
 
		wallbase.cpp \
 
		wall.cpp \
 
		wallitem.cpp \
 
		warning.cpp \
 
		xmlwritecode.cpp \
 
		xmlwrite.cpp \
 
		VirtualLeaf.cpp moc_canvas.cpp \
 
		moc_cellbase.cpp \
 
		moc_cell.cpp \
 
		moc_infobar.cpp \
 
		moc_modelcatalogue.cpp \
 
		moc_OptionFileDialog.cpp \
 
		moc_pardialog.cpp \
 
		moc_transporterdialog.cpp \
 
		moc_UniqueMessage.cpp
 
OBJECTS       = apoplastitem.o \
 
		canvas.o \
 
		cellbase.o \
 
		cell.o \
 
		cellitem.o \
 
		mainbase.o \
 
		matrix.o \
 
		mesh.o \
 
		miscq.o \
 
		modelcatalogue.o \
 
		Neighbor.o \
 
		node.o \
 
		nodeitem.o \
 
		nodeset.o \
 
		OptionFileDialog.o \
 
		output.o \
 
		parameter.o \
 
		pardialog.o \
 
		parse.o \
 
		random.o \
 
		rungekutta.o \
 
		simitembase.o \
 
		transporterdialog.o \
 
		UniqueMessage.o \
 
		vector.o \
 
		wallbase.o \
 
		wall.o \
 
		wallitem.o \
 
		warning.o \
 
		xmlwritecode.o \
 
		xmlwrite.o \
 
		VirtualLeaf.o \
 
		moc_canvas.o \
 
		moc_cellbase.o \
 
		moc_cell.o \
 
		moc_infobar.o \
 
		moc_modelcatalogue.o \
 
		moc_OptionFileDialog.o \
 
		moc_pardialog.o \
 
		moc_transporterdialog.o \
 
		moc_UniqueMessage.o
 
DIST          = ../../../Trolltech/Qt-4.4.1/mkspecs/common/g++.conf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/common/unix.conf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/common/linux.conf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/qconfig.pri \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/qt_functions.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/qt_config.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/exclusive_builds.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/default_pre.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/release.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/default_post.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/qt.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/unix/thread.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/moc.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/warn_on.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/resources.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/uic.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/yacc.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/lex.prf \
 
		VirtualLeaf.pro
 
QMAKE_TARGET  = VirtualLeaf
 
DESTDIR       = ../bin/
 
TARGET        = ../bin/VirtualLeaf
 

	
 
all: VirtualLeaf libplugin plugins
 
first: all
 
####### Implicit rules
 

	
 
.SUFFIXES: .o .c .cpp .cc .cxx .C
 

	
 
.cpp.o:
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 

	
 
.cc.o:
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 

	
 
.cxx.o:
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 

	
 
.C.o:
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
 

	
 
.c.o:
 
	$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
 

	
 
####### Build rules
 

	
 
all: Makefile $(TARGET)
 

	
 
$(TARGET):  $(OBJECTS)  
 
	@$(CHK_DIR_EXISTS) ../bin/ || $(MKDIR) ../bin/ 
 
	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
 

	
 
VirtualLeaf: Makefile.VirtualLeaf
 
	make -f Makefile.VirtualLeaf
 
Makefile: VirtualLeaf.pro  ../../../Trolltech/Qt-4.4.1/mkspecs/linux-g++-64/qmake.conf ../../../Trolltech/Qt-4.4.1/mkspecs/common/g++.conf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/common/unix.conf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/common/linux.conf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/qconfig.pri \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/qt_functions.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/qt_config.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/exclusive_builds.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/default_pre.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/release.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/default_post.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/qt.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/unix/thread.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/moc.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/warn_on.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/resources.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/uic.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/yacc.prf \
 
		../../../Trolltech/Qt-4.4.1/mkspecs/features/lex.prf \
 
		/ufs/merks/Trolltech/Qt-4.4.1/lib/libQt3Support.prl \
 
		/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtSql.prl \
 
		/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtCore.prl \
 
		/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtXml.prl \
 
		/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtGui.prl \
 
		/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtNetwork.prl
 
	$(QMAKE) -unix -o Makefile VirtualLeaf.pro
 
../../../Trolltech/Qt-4.4.1/mkspecs/common/g++.conf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/common/unix.conf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/common/linux.conf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/qconfig.pri:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/qt_functions.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/qt_config.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/exclusive_builds.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/default_pre.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/release.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/default_post.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/qt.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/unix/thread.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/moc.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/warn_on.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/resources.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/uic.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/yacc.prf:
 
../../../Trolltech/Qt-4.4.1/mkspecs/features/lex.prf:
 
/ufs/merks/Trolltech/Qt-4.4.1/lib/libQt3Support.prl:
 
/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtSql.prl:
 
/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtCore.prl:
 
/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtXml.prl:
 
/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtGui.prl:
 
/ufs/merks/Trolltech/Qt-4.4.1/lib/libQtNetwork.prl:
 
qmake:  FORCE
 
	@$(QMAKE) -unix -o Makefile VirtualLeaf.pro
 

	
 
dist: 
 
	@$(CHK_DIR_EXISTS) .tmp/VirtualLeaf1.0.0 || $(MKDIR) .tmp/VirtualLeaf1.0.0 
 
	$(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/VirtualLeaf1.0.0/ && $(COPY_FILE) --parents apoplastitem.h canvas.h cellbase.h cell.h cellitem.h infobar.h mainbase.h mainbase.h matrix.h mesh.h miscq.h modelcatalogue.h Neighbor.h node.h nodeitem.h nodeset.h OptionFileDialog.h output.h parameter.h pardialog.h parse.h pi.h qcanvasarrow.h random.h rungekutta.h simitembase.h simplugin.h sqr.h tiny.h transporterdialog.h UniqueMessage.h vector.h wallbase.h wall.h wallitem.h warning.h xmlwrite.h flux_function.h vleafmodel.h VirtualLeafpar.tmpl .tmp/VirtualLeaf1.0.0/ && $(COPY_FILE) --parents apoplastitem.cpp canvas.cpp cellbase.cpp cell.cpp cellitem.cpp mainbase.cpp matrix.cpp mesh.cpp miscq.cpp modelcatalogue.cpp Neighbor.cpp node.cpp nodeitem.cpp nodeset.cpp OptionFileDialog.cpp output.cpp parameter.cpp pardialog.cpp parse.cpp random.cpp rungekutta.cpp simitembase.cpp transporterdialog.cpp UniqueMessage.cpp vector.cpp wallbase.cpp wall.cpp wallitem.cpp warning.cpp xmlwritecode.cpp xmlwrite.cpp VirtualLeaf.cpp .tmp/VirtualLeaf1.0.0/ && (cd `dirname .tmp/VirtualLeaf1.0.0` && $(TAR) VirtualLeaf1.0.0.tar VirtualLeaf1.0.0 && $(COMPRESS) VirtualLeaf1.0.0.tar) && $(MOVE) `dirname .tmp/VirtualLeaf1.0.0`/VirtualLeaf1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/VirtualLeaf1.0.0
 

	
 

	
 
clean:compiler_clean 
 
	-$(DEL_FILE) $(OBJECTS)
 
	-$(DEL_FILE) *~ core *.core
 

	
 

	
 
####### Sub-libraries
 

	
 
distclean: clean
 
	-$(DEL_FILE) $(TARGET) 
 
	-$(DEL_FILE) Makefile
 

	
 

	
 
mocclean: compiler_moc_header_clean compiler_moc_source_clean
 

	
 
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
 

	
 
compiler_moc_header_make_all: moc_canvas.cpp moc_cellbase.cpp moc_cell.cpp moc_infobar.cpp moc_modelcatalogue.cpp moc_OptionFileDialog.cpp moc_pardialog.cpp moc_transporterdialog.cpp moc_UniqueMessage.cpp
 
compiler_moc_header_clean:
 
	-$(DEL_FILE) moc_canvas.cpp moc_cellbase.cpp moc_cell.cpp moc_infobar.cpp moc_modelcatalogue.cpp moc_OptionFileDialog.cpp moc_pardialog.cpp moc_transporterdialog.cpp moc_UniqueMessage.cpp
 
moc_canvas.cpp: simitembase.h \
 
		mainbase.h \
 
		mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		canvas.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) canvas.h -o moc_canvas.cpp
 

	
 
moc_cellbase.cpp: vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) cellbase.h -o moc_cellbase.cpp
 

	
 
Makefile.VirtualLeaf: VirtualLeaf.pro
 
	$(QMAKE) -makefile -o $@ $< 
 
moc_cell.cpp: vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		cell.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) cell.h -o moc_cell.cpp
 

	
 
moc_infobar.cpp: infobar.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) infobar.h -o moc_infobar.cpp
 

	
 
moc_modelcatalogue.cpp: warning.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		cellbase.h \
 
		mesh.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		canvas.h \
 
		simitembase.h \
 
		mainbase.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		modelcatalogue.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) modelcatalogue.h -o moc_modelcatalogue.cpp
 

	
 
moc_OptionFileDialog.cpp: OptionFileDialog.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) OptionFileDialog.h -o moc_OptionFileDialog.cpp
 

	
 
moc_pardialog.cpp: pardialog.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) pardialog.h -o moc_pardialog.cpp
 

	
 
moc_transporterdialog.cpp: transporterdialog.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) transporterdialog.h -o moc_transporterdialog.cpp
 

	
 
moc_UniqueMessage.cpp: UniqueMessage.h
 
	/ufs/merks/Trolltech/Qt-4.4.1/bin/moc $(DEFINES) $(INCPATH) UniqueMessage.h -o moc_UniqueMessage.cpp
 

	
 
compiler_rcc_make_all:
 
compiler_rcc_clean:
 
compiler_image_collection_make_all: qmake_image_collection.cpp
 
compiler_image_collection_clean:
 
	-$(DEL_FILE) qmake_image_collection.cpp
 
compiler_moc_source_make_all:
 
compiler_moc_source_clean:
 
compiler_uic_make_all:
 
compiler_uic_clean:
 
compiler_yacc_decl_make_all:
 
compiler_yacc_decl_clean:
 
compiler_yacc_impl_make_all:
 
compiler_yacc_impl_clean:
 
compiler_lex_make_all:
 
compiler_lex_clean:
 
compiler_clean: compiler_moc_header_clean 
 

	
 
####### Compile
 

	
 
apoplastitem.o: apoplastitem.cpp canvas.h \
 
		simitembase.h \
 
		mainbase.h \
 
		mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		apoplastitem.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o apoplastitem.o apoplastitem.cpp
 

	
 
canvas.o: canvas.cpp pardialog.h \
 
		parameter.h \
 
		vector.h \
 
		sqr.h \
 
		canvas.h \
 
		simitembase.h \
 
		mainbase.h \
 
		mesh.h \
 
		cell.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		nodeset.h \
 
		wallitem.h \
 
		xmlwrite.h \
 
		miscq.h \
 
		OptionFileDialog.h \
 
		modelcatalogue.h \
 
		psb.xpm \
 
		cwi.xpm
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o canvas.o canvas.cpp
 

	
 
libplugin: Makefile.libplugin
 
	make -f Makefile.libplugin
 
cellbase.o: cellbase.cpp nodeitem.h \
 
		simitembase.h \
 
		node.h \
 
		vector.h \
 
		sqr.h \
 
		random.h \
 
		parameter.h \
 
		cell.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		cellitem.h \
 
		qcanvasarrow.h \
 
		nodeset.h \
 
		mesh.h \
 
		simplugin.h \
 
		tiny.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o cellbase.o cellbase.cpp
 

	
 
cell.o: cell.cpp cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		mesh.h \
 
		simplugin.h \
 
		tiny.h \
 
		nodeset.h \
 
		cellitem.h \
 
		simitembase.h \
 
		nodeitem.h \
 
		qcanvasarrow.h \
 
		canvas.h \
 
		mainbase.h \
 
		infobar.h \
 
		data_plot.h \
 
		curvecolors.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o cell.o cell.cpp
 

	
 
cellitem.o: cellitem.cpp cellitem.h \
 
		simitembase.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o cellitem.o cellitem.cpp
 

	
 
mainbase.o: mainbase.cpp mainbase.h \
 
		mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		xmlwrite.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainbase.o mainbase.cpp
 

	
 
matrix.o: matrix.cpp vector.h \
 
		sqr.h \
 
		matrix.h \
 
		tiny.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o matrix.o matrix.cpp
 

	
 
mesh.o: mesh.cpp mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		tiny.h \
 
		pi.h \
 
		parse.h \
 
		matrix.h \
 
		nodeset.h \
 
		nodeitem.h \
 
		simitembase.h \
 
		rungekutta.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mesh.o mesh.cpp
 

	
 
Makefile.libplugin: libplugin.pro
 
	$(QMAKE) -makefile -o $@ $< 
 
miscq.o: miscq.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o miscq.o miscq.cpp
 

	
 
modelcatalogue.o: modelcatalogue.cpp modelcatalogue.h \
 
		warning.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		cellbase.h \
 
		mesh.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		canvas.h \
 
		simitembase.h \
 
		mainbase.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o modelcatalogue.o modelcatalogue.cpp
 

	
 
Neighbor.o: Neighbor.cpp Neighbor.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o Neighbor.o Neighbor.cpp
 

	
 
node.o: node.cpp node.h \
 
		vector.h \
 
		sqr.h \
 
		random.h \
 
		parameter.h \
 
		cell.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		mesh.h \
 
		simplugin.h \
 
		pi.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o node.o node.cpp
 

	
 
nodeitem.o: nodeitem.cpp nodeitem.h \
 
		simitembase.h \
 
		node.h \
 
		vector.h \
 
		sqr.h \
 
		random.h \
 
		parameter.h \
 
		cell.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		modelelement.h \
 
		Neighbor.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o nodeitem.o nodeitem.cpp
 

	
 
nodeset.o: nodeset.cpp nodeset.h \
 
		node.h \
 
		vector.h \
 
		sqr.h \
 
		random.h \
 
		parameter.h \
 
		cell.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		modelelement.h \
 
		Neighbor.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o nodeset.o nodeset.cpp
 

	
 
OptionFileDialog.o: OptionFileDialog.cpp OptionFileDialog.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o OptionFileDialog.o OptionFileDialog.cpp
 

	
 
output.o: output.cpp warning.h \
 
		parameter.h \
 
		vector.h \
 
		sqr.h \
 
		output.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o output.o output.cpp
 

	
 
parameter.o: parameter.cpp parameter.h \
 
		vector.h \
 
		sqr.h \
 
		output.h \
 
		parse.h \
 
		xmlwrite.h \
 
		warning.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o parameter.o parameter.cpp
 

	
 
pardialog.o: pardialog.cpp pardialog.h \
 
		parameter.h \
 
		vector.h \
 
		sqr.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o pardialog.o pardialog.cpp
 

	
 
plugins:
 
	make -C build_models
 
parse.o: parse.cpp warning.h \
 
		parse.h \
 
		output.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o parse.o parse.cpp
 

	
 
random.o: random.cpp random.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o random.o random.cpp
 

	
 
rungekutta.o: rungekutta.cpp rungekutta.h \
 
		warning.h \
 
		maxmin.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o rungekutta.o rungekutta.cpp
 

	
 
simitembase.o: simitembase.cpp simitembase.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o simitembase.o simitembase.cpp
 

	
 
transporterdialog.o: transporterdialog.cpp canvas.h \
 
		simitembase.h \
 
		mainbase.h \
 
		mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		transporterdialog.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o transporterdialog.o transporterdialog.cpp
 

	
 
UniqueMessage.o: UniqueMessage.cpp UniqueMessage.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o UniqueMessage.o UniqueMessage.cpp
 

	
 
vector.o: vector.cpp sqr.h \
 
		pi.h \
 
		vector.h \
 
		tiny.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o vector.o vector.cpp
 

	
 
wallbase.o: wallbase.cpp wall.h \
 
		wallbase.h \
 
		vector.h \
 
		sqr.h \
 
		node.h \
 
		random.h \
 
		parameter.h \
 
		cell.h \
 
		warning.h \
 
		cellbase.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		mesh.h \
 
		simplugin.h \
 
		wallitem.h \
 
		simitembase.h \
 
		apoplastitem.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o wallbase.o wallbase.cpp
 

	
 
wall.o: wall.cpp wall.h \
 
		wallbase.h \
 
		vector.h \
 
		sqr.h \
 
		cell.h \
 
		parameter.h \
 
		warning.h \
 
		cellbase.h \
 
		wallitem.h \
 
		simitembase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		apoplastitem.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o wall.o wall.cpp
 

	
 
clean:
 
	make -f Makefile.libplugin clean
 
	make -f Makefile.VirtualLeaf clean
 
	make -C build_models clean
 
wallitem.o: wallitem.cpp canvas.h \
 
		simitembase.h \
 
		mainbase.h \
 
		mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		wallitem.h \
 
		transporterdialog.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o wallitem.o wallitem.cpp
 

	
 
warning.o: warning.cpp warning.h \
 
		canvas.h \
 
		simitembase.h \
 
		mainbase.h \
 
		mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		cellitem.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		UniqueMessage.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o warning.o warning.cpp
 

	
 
xmlwritecode.o: xmlwritecode.cpp xmlwrite.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o xmlwritecode.o xmlwritecode.cpp
 

	
 
#finis
 
xmlwrite.o: xmlwrite.cpp mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		xmlwrite.h \
 
		nodeset.h \
 
		output.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o xmlwrite.o xmlwrite.cpp
 

	
 
VirtualLeaf.o: VirtualLeaf.cpp mesh.h \
 
		cell.h \
 
		vector.h \
 
		sqr.h \
 
		parameter.h \
 
		wall.h \
 
		wallbase.h \
 
		warning.h \
 
		cellbase.h \
 
		node.h \
 
		random.h \
 
		modelelement.h \
 
		Neighbor.h \
 
		simplugin.h \
 
		pi.h \
 
		cellitem.h \
 
		simitembase.h \
 
		canvas.h \
 
		mainbase.h \
 
		infobar.h \
 
		nodeitem.h \
 
		data_plot.h \
 
		curvecolors.h \
 
		output.h \
 
		modelcatalogue.h
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o VirtualLeaf.o VirtualLeaf.cpp
 

	
 
moc_canvas.o: moc_canvas.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_canvas.o moc_canvas.cpp
 

	
 
moc_cellbase.o: moc_cellbase.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_cellbase.o moc_cellbase.cpp
 

	
 
moc_cell.o: moc_cell.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_cell.o moc_cell.cpp
 

	
 
moc_infobar.o: moc_infobar.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_infobar.o moc_infobar.cpp
 

	
 
moc_modelcatalogue.o: moc_modelcatalogue.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_modelcatalogue.o moc_modelcatalogue.cpp
 

	
 
moc_OptionFileDialog.o: moc_OptionFileDialog.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_OptionFileDialog.o moc_OptionFileDialog.cpp
 

	
 
moc_pardialog.o: moc_pardialog.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_pardialog.o moc_pardialog.cpp
 

	
 
moc_transporterdialog.o: moc_transporterdialog.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_transporterdialog.o moc_transporterdialog.cpp
 

	
 
moc_UniqueMessage.o: moc_UniqueMessage.cpp 
 
	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_UniqueMessage.o moc_UniqueMessage.cpp
 

	
 
####### Install
 

	
 
install:   FORCE
 

	
 
uninstall:   FORCE
 

	
 
FORCE:
 

	
src/TutorialCode/Tutorial1A/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 

	
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial1A/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial1A/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf is free software: you can redistribute it and/or modify
 
#  it under the terms of the GNU General Public License as published by
 
#  the Free Software Foundation, either version 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  The Virtual Leaf is distributed in the hope that it will be useful,
 
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
#  GNU General Public License for more details.
 
#
 
#  You should have received a copy of the GNU General Public License
 
#  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
#  Copyright 2010 Roeland Merks.
 
#
 

	
 

	
 
TARGET = mymodel
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1B/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth and cell division" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 

	
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->Divide();
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial1B/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial1B/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf is free software: you can redistribute it and/or modify
 
#  it under the terms of the GNU General Public License as published by
 
#  the Free Software Foundation, either version 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  The Virtual Leaf is distributed in the hope that it will be useful,
 
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
#  GNU General Public License for more details.
 
#
 
#  You should have received a copy of the GNU General Public License
 
#  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
#  Copyright 2010 Roeland Merks.
 
#
 

	
 

	
 
TARGET = mymodel
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1C/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth and cell division" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->DivideOverAxis(Vector(1,0,0));
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial1C/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial1C/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf is free software: you can redistribute it and/or modify
 
#  it under the terms of the GNU General Public License as published by
 
#  the Free Software Foundation, either version 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  The Virtual Leaf is distributed in the hope that it will be useful,
 
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
#  GNU General Public License for more details.
 
#
 
#  You should have received a copy of the GNU General Public License
 
#  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
#  Copyright 2010 Roeland Merks.
 
#
 

	
 

	
 
TARGET = mymodel
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1D/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Growth, division, coloring" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 
	if (c->Area()/c->BaseArea()>1.8) { color->setNamedColor("blue"); }
 
	else { color->setNamedColor("green"); }
 

	
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->Divide();
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial1D/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  The Virtual Leaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  The Virtual Leaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial1D/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf is free software: you can redistribute it and/or modify
 
#  it under the terms of the GNU General Public License as published by
 
#  the Free Software Foundation, either version 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  The Virtual Leaf is distributed in the hope that it will be useful,
 
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
#  GNU General Public License for more details.
 
#
 
#  You should have received a copy of the GNU General Public License
 
#  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
#
 
#  Copyright 2010 Roeland Merks.
 
#
 

	
 

	
 
TARGET = mymodel
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial2/mymodel.cpp
Show inline comments
 
@@ -34,26 +34,66 @@ static const std::string _module_id("$Id
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth and cell division" );
 
  return QString( "Growth hormones" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 
int MyModel::NChem(void) { return 1; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
	
 
	// set one cell to source after first division
 
	if (CellBase::NCells()==2) {
 
		daughter1->SetCellType(1);
 
		daughter2->SetCellType(0);
 
	}
 
	
 
	// if a source cells has divided, one of the daughters becomes the new source
 
	if (daughter1->CellType()==1) {
 
		
 
		// if both cells are at the tissue perimeter, choose at random
 
		if (daughter1->AtBoundaryP() && daughter2->AtBoundaryP()) {
 
		
 
			if (qrand()%2){
 
				daughter1->SetCellType(1);
 
				daughter2->SetCellType(0);
 
			} else {
 
				daughter1->SetCellType(0);
 
				daughter2->SetCellType(1);
 
			}
 
		} else {
 
			// otherwise choose the one that is still at the perimeter
 
			if (daughter1->AtBoundaryP()) {
 
				daughter1->SetCellType(1);
 
				daughter2->SetCellType(0);
 
			} else {
 
				daughter1->SetCellType(0);
 
				daughter2->SetCellType(1);
 
			}
 
		}
 
	}
 
	
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 

	
 
	
 
	// white: high concentration of growth hormone, black low concentration
 
	double val = 1.-c->Chemical(0)/(1.+c->Chemical(0));
 
	color->setRgbF(val, val, val);
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (CellBase::NCells()==1)
 
		// first cell expands unconditionally 
 
		c->EnlargeTargetArea(par->cell_expansion_rate);
 
	else 
 
		c->EnlargeTargetArea(c->Chemical(0)*par->cell_expansion_rate);
 
	
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->Divide();
 
	}
 
@@ -61,12 +101,19 @@ void MyModel::CellHouseKeeping(CellBase 
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
	double phi = w->Length() * par->D[0] * ( w->C2()->Chemical(0) - w->C1()->Chemical(0) );
 
	dchem_c1[0]+=phi;
 
	dchem_c2[0]-=phi;
 
}
 

	
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
	if (c->CellType()==1) {
 
		dchem[0] = par->leaf_tip_source;
 
	}
 
}
 

	
 

	
src/TutorialCode/Tutorial3/mymodel.cpp
Show inline comments
 
@@ -34,38 +34,99 @@ static const std::string _module_id("$Id
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth and cell division" );
 
  return QString( "Growth hormones" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 
int MyModel::NChem(void) { return 2; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
	
 
	// set one cell to source after first division
 
	if (CellBase::NCells()==2) {
 
		daughter1->SetCellType(1);
 
		daughter2->SetCellType(0);
 
	}
 
	
 
	// if a source cells has divided, one of the daughters becomes the new source
 
	if (daughter1->CellType()==1) {
 
		
 
		// if both cells are at the tissue perimeter, choose at random
 
		if (daughter1->AtBoundaryP() && daughter2->AtBoundaryP()) {
 
		
 
			if (qrand()%2){
 
				daughter1->SetCellType(1);
 
				daughter2->SetCellType(0);
 
			} else {
 
				daughter1->SetCellType(0);
 
				daughter2->SetCellType(1);
 
			}
 
		} else {
 
			// otherwise choose the one that is still at the perimeter
 
			if (daughter1->AtBoundaryP()) {
 
				daughter1->SetCellType(1);
 
				daughter2->SetCellType(0);
 
			} else {
 
				daughter1->SetCellType(0);
 
				daughter2->SetCellType(1);
 
			}
 
		}
 
	}
 
	
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 
	
 
	// white: high concentration of growth hormone, black low concentration
 
	double val = 1.-c->Chemical(0)/(1.+c->Chemical(0));
 
	color->setRgbF(val, val, val);
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (CellBase::NCells()==1)
 
		// first cell expands unconditionally 
 
		c->EnlargeTargetArea(par->cell_expansion_rate);
 
	else 
 
		c->EnlargeTargetArea(c->Chemical(0)*par->cell_expansion_rate);
 
	
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->DivideOverAxis(Vector(1,0,0));
 
		c->Divide();
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
	double phi = w->Length() * par->D[0] * ( w->C2()->Chemical(0) - w->C1()->Chemical(0) );
 
	dchem_c1[0]+=phi;
 
	dchem_c2[0]-=phi;
 
	
 
	// directed transport
 
	// efflux from cell 1 to cell 2
 
  	double trans12 = ( par->transport * w->Transporters1(1) * 
 
					  w->C1()->Chemical(0) / (par->ka + w->C1()->Chemical(0)) );
 
	
 
    // efflux from cell 2 to cell 1
 
    double trans21 = ( par->transport * w->Transporters2(1) * 
 
					  w->C2()->Chemical(0) / (par->ka + w->C2()->Chemical(0)) );
 
    
 
    dchem_c1[0] += trans21 - trans12;
 
    dchem_c2[0] += trans12 - trans21;
 
	
 
}
 

	
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
	if (c->CellType()==1) {
 
		dchem[0] = par->leaf_tip_source;
 
	}
 
}
 

	
 

	

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)