previous up next SYLLABUS  Previous: 8.2 Program execution  Up: 8 THE JBONE USER  Next: 8.4 An object-oriented example:


8.3 Program structure & documentation


Slide : [ documentation - edit || JBONE tree - names || JAVA tutorial ]

Using an object oriented language such as JAVA, it is important to realize that you don't have to read the entire listing to understand and even modify the code. This section gives you some hints as where to find information and what needs to be done to add a new scheme.

* Documentation.
It is generated and automatically updated with the command make docs, using the comments /** */ that preceed the declarations in the JBONE source code. Check how this happens in the method Mesh.point() from the Mesh object in the file Mesh.java
/** Coordinate value
    @param i The index of a coordinate
    @return The value of a coordinate */
public double   point(int i) { return x[i]; }
Follow the links to verify where Mesh.point() appears in the program tree and the name index, defining everything you need to know to obtain a mesh point coordinate: give it an integer index and it will return the corresponding real position. Unless you want to modify the properties of the Mesh object, you never need to know where and how the position was stored!

* All you need to modify.
To complete most of the projects, it is sufficient to modify or add some small sections in the sub-classes of the Solution hierarchy, i.e. the files
  • FDSolution.java -- for finite difference schemes
  • FEMSolution.java -- for finite elements schemes
  • FFTSolution.java -- for Fourier methods
  • MCPSolution.java -- for Monte Carlo particle schemes
  • MCSSolution.java -- for Monte Carlo sampling schemes
  • CHASolution.java -- for Lagarangian schemes
Having identified the section with a specific choice of the selectors(here ``Finite elements'',``Explicit 2-level'',``Advection'')your task consists in defining new values fp[] from the old f[]. If you add a new combination of selectors, you need to define it in Solution.hasOption() to finally make it appear at run time.

After each modification, remember that you need to recompile with the command make all. And you must press SHIFT and select View->RELOAD to force the browser to load the new compiled code.

SYLLABUS  Previous: 8.2 Program execution  Up: 8 THE JBONE USER  Next: 8.4 An object-oriented example:

      
back up next contents bibliography Copyright © Lifelong-learners at 15:52:37, November 22nd, 2017