Main Page   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

dyn_tt.C

Go to the documentation of this file.
00001 //
00002 // dyn_tt.C: dyn-specific node-handling functions.
00003 //
00004 
00005 #include "dyn.h"
00006 
00007 void dyn::null_pointers()
00008 {
00009     // Clear all pointers (don't touch what they point to)
00010     // -- for use in cleaning up temporary nodes...  Careful!!
00011 
00012     kep = NULL;
00013 
00014     node::null_pointers();
00015 }
00016 
00017 bool dyn::nn_stats(real energy_cutoff, real kT,
00018                    vector center, bool verbose,
00019                    bool long_binary_output,     // default = true
00020                    int which)                   // default = 0
00021 {
00022     // Kludgy dummy function to enable hdyn::nn_stats().
00023 
00024     // Print header information on first entry.
00025 
00026     if (verbose && long_binary_output
00027         && is_top_level_node() && elder_sister == NULL && which == 0)
00028         cerr << "\n  (No NN information available for dyn class)" << endl;
00029 
00030     return true;        // Avoid "(none)" output in sys_stats.
00031 }
00032 
00033 real dyn::print_pert(bool long_binary_output,   // default = true
00034                      int indent)                // default = BIN_INDENT
00035 {
00036     // Similarly kludgy function to enable hdyn::print_pert().
00037 
00038     if (!long_binary_output) cerr << endl;
00039     return 0;
00040 }
00041 
00042 real dyn::get_radius()
00043 {
00044     if (oldest_daughter == NULL) return 0;
00045 
00046     real rmax2 = 0;
00047 
00048     for (dyn* b = this; b != NULL; b = (dyn*) b->next_node(this))
00049         if (b->get_oldest_daughter() == NULL) {
00050             
00051             vector dx = b->get_pos();
00052             real r2 = dx*dx;
00053             if (r2 > rmax2) rmax2 = r2;
00054         }
00055     return sqrt(rmax2);
00056 }
00057 
00058 vector something_relative_to_root(dyn* bi,
00059                                   dyn_VMF_ptr get_something)
00060 {
00061 #ifdef DEBUG
00062     cerr << "something_relative_to_ancestor\n";
00063 #endif    
00064     vector  d_something = 0.0;
00065     for(dyn * b = bi;b->get_parent() != NULL; b = b->get_parent()){
00066         if(b == NULL){
00067             cerr << "something_relative_to_root: Error, bj is not the "
00068                  << "ancestor of bi\n";
00069             exit(1);
00070         }
00071         d_something += (b->*get_something)();
00072     }
00073     return d_something;
00074 }

Generated at Sun Feb 24 09:56:59 2002 for STARLAB by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001