Changes between Version 3 and Version 4 of AstroBearObjects


Ignore:
Timestamp:
05/05/11 14:28:54 (14 years ago)
Author:
Brandon Shroyer
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • AstroBearObjects

    v3 v4  
    3333== Using Objects ==
    3434
     35All AstroBEAR objects share a common creation and destruction interface.  To create a new object of type {{{AstroObj}}}, call the {{{CreateAstroObj()}}} subroutine in {{{ProblemInitializeModule()}}}.  This creates a new object whose properties you can then modify.  Many objects require further initialization to affect the problem domain, either before or during the run.  These objects usually come with {{{GridInit()}}} and {{{beforeStep()}}} routines.
    3536
    36 Using these objects within a problem module is as simple as calling the createobject subroutine during the ProblemInitializeModule routine - and then modifying the objects properties.  For instance !MyClump%radius, !MyClump%density, or !MyWind%dir, !MyWind%edge, !MyPointGravity%mass, etc...  All of the difficult coding and loops that deal with properly updating the grids is already taken care of.  Of course you might find that an object does not have all of the features you need.  In that case you can manually modify grids as in AstroBear in the routines ProblemGridInit, ProblemBeforeStep, ProblemAfterStep, and ProblemSetErrFlags.  You could also add the needed feature to an existing object - or consider creating a new object.  Adding features to existing objects is fairly straightforward - and will not break other people's problem modules as long as the new default values effectively turn the new feature off.
     37To make memory management less hellish, our objects also come with destruction routines. '''BE SURE TO USE THESE ROUTINES IF YOU PLAN ON DELETING AN OBJECT.'''  This is the best way to make sure that ''all'' of the memory these objects use is safely freed.
    3738
    38  = Information on Existing objects =
     39Most of the AstroBEAR standard objects have the bulk of their inner workings encapsulated by simple subroutines.  Review the documentation for each object carefully so that you understand how to use these routines; they are there to make object use simple and intuitive.
     40
     41[[BR]]
     42== Developing New Objects ==
     43
     44
     45=== Modifying Existing Objects ===
     46
     47Adding features to existing objects is fairly straightforward--simply add the required attributes to the object's definition and include whatever additional methods operate on that object.  It is important to remember, though, that other people rely on these objects to behave as advertised.  To be on the safe side, make sure that your new feature is turned off by default.  That way, you aren't leaving nasty surprises for other people who use the object.
     48
     49Modifications are a little trickier, especially if you are substantially changing the behavior of the object.  Developers are advised to consult with the AstroBEAR team before modifying the behavior of existing objects, so that the changes can be thoroughly vetted and announced to the community at large.
     50
     51
     52
     53== Information on Existing objects ==
    3954 * [UniformRegions Uniform Regions]
    4055 * [SplitRegions Split Regions]
     
    4459 * [OutflowObjects Outflow Sources]
    4560
    46  = Information on !SubObjects =
     61=== Information on !SubObjects ===
    4762 * [ShapeObjects Shapes]
    4863 * [InterfaceObjects Interfaces]