In this section, we will carry out some numerical experiments with a PDE application based on the toolkit just described.
The ``code'', i.e. the set of components, properly configured and connected is in PDE_STUDENT_SRC/components/tests/example1.rc; (see also Appendix B). Note that the connection between the RHSCombiner and Reaction is commented out.
The Driver has been designed with a parameter port (part of the CCA specification) which allows you to change some of the basic simulation parameters without changing the code. In example1.rc, the application is configured to take 2000 time steps of size dt = 1.0 x 10-4 .
We will now integrate forward in time and try to view the output of the code.
|$||make USER_TESTS=example1.rc example1.rc|
The simulation takes a few moments to execute, but at the end of the output from your make command, you should see messages similar to:
Test script: /san/homedirs/bernhold/tutorial-src/obj/pde/components/tests/example1.rc SUCCESS: ==> Test passed, go command(s) executed successfully (see /san/homedirs/bernhold/tutorial-src/obj/pde/components/tests/example1.rc.log).
Notice that the messages from the build system indicate where the log of the test is located (in this case $PDE_STUDENT_SRC/components/tests/example1.rc.log). Edit it, and jump to the bottom to confirm that it appears to have executed correctly.
What you're seeing in this log is the output of the Ccaffeine session in which the application was run. So you see the stdout and stderr streams from the application and from Ccaffeine itself.
A message that is repeated throughout the log hints at an interesting point about the CCA that we haven't discussed yet:
!Info: Requested uses port dump in component RHSCombiner is not connected.(and similarly for the reaction port). A CCA component can use and provide whatever ports it wants, and use them in whatever way it considers appropriate. For example, a component may consider some port connections as ``optional'' - to be used if the port is connected, but if there is no connection, the component can do its job in some other way. In this case, the RHSCombiner component can use a NamedPatchPort (which it refers to as dump) to expose internal data for debugging or visualization purposes. But if it is not connected, the component skips those logging activities.
If you're working remotely from the machine where you are running Ccaffeine , you'll need to have an X11 server on your local machine in order to view the simulation results using gnuplot. Linux/unix and Mac users may need to make sure that the X11 protocol is being tunneled through their ssh connection (see Appendix D.2). Windows users will need to run an X11 server (unfortunately, we have no documentation for that yet).
Let's gnuplot and then use it to explore the simulation output a little:
The triplet 1:2:4 at the end of the command line above tells gnuplot to use columns 1, 2, and 4 of the data file. The data file contains five columns of numbers: x , y , (temperature), (reactant), and (product). So you can view other fields by changing the final element of the triplet.
Try changing the time step dt. Note that Changing the time step without corresponding changes to the mesh resolutions (parameters NX and NY) will cause the time integration algorithm to become unstable at some point, giving incorrect results. For example, with dt set to 102 instead of 10-4 , the system will rapidly become unstable, and you will see the boundaries of the regions of high reactant concentration ( ) become jagged instead of smooth, and may cease to be simply connected. Also, to minimum and maximum values of will grow without bound with time.