wiki:AstroBearObjects

Version 3 (modified by Brandon Shroyer, 14 years ago) ( diff )

AstroBEAR Objects

Object Types

AstroBEAR uses objects to encapsulate data about certain features of the problem. At the user level, these objects simplify setups by making it easier to manage and manipulate certain physical features. At the developer level, they create consistency by providing a template for new physics.

Objects can be classified as one of three types:

  • Initial Condition / Instantaneous sources: These objects create geometric features during problem setups. Unless they are somehow maintained, these objects can be altered or even dispersed by the dynamics of the simulation.
  • Boundary Conditions: Objects that enforce special conditions on the boundaries of a domain.
    • Winds—Velocity conditions at one or more boundaries.
  • Source Objects: These objects are used to model source terms. Source objects can be associated with a particular region (or even another object) or they can be applied to the entire problem domain.
    • Point Gravity Sources—These objects generate a central gravitational force around a specific point. These point sources are fixed unless attached to a sink particle.
    • Cooling Objects—These objects describe the radiative cooling mechanism associated with a specified region or domain. This cooling can be represented by an analytic function or (more commonly) a lookup table.
  • Sink Particles—An additional object type that combines instantaneous and source term attributes, SinkParticles are moving particles that exert a central gravitational pull on the matter around them. Sink particles can be instantiated during the initial setup, or they can be generated during run time when sink particles are enabled and the Jeans instability criterion is met.

Sub-Objects

Many of these objects use geometric sub-objects that handle object shape and orientation. These objects are usually referenced by a pointer in the parent object, which means that multiple objects can reference the same sub-object.

  • Shapes - Contains routines for orienting various physical objects
  • Interfaces - Useful for dividing a region into two pieces based on a perturbed interface


Using Objects

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.

Information on Existing objects

Information on SubObjects

Note: See TracWiki for help on using the wiki.