orsa_interaction.cc File Reference

#include "orsa_interaction.h"
#include "orsa_secure_math.h"
#include "orsa_universe.h"
#include "orsa_error.h"
#include <cmath>
#include <iostream>

Include dependency graph for orsa_interaction.cc:

Go to the source code of this file.

Namespaces

namespace  orsa

Functions

std::string label (const InteractionType it)
void make_new_interaction (Interaction **i, const InteractionType type)


Function Documentation

std::string label const InteractionType  it  ) 
 

Definition at line 37 of file orsa_interaction.cc.

References orsa::ARMONICOSCILLATOR, orsa::GALACTIC_POTENTIAL_ALLEN, orsa::GALACTIC_POTENTIAL_ALLEN_PLUS_NEWTON, orsa::GRAVITATIONALTREE, orsa::JPL_PLANETS_NEWTON, orsa::NEWTON, orsa::NEWTON_MPI, and orsa::RELATIVISTIC.

00037                                             {
00038     
00039     std::string s("");
00040     
00041     switch (it) {
00042     case NEWTON:                                s = "Newton";                               break;
00043     case NEWTON_MPI:                            s = "Newton (MPI)";                         break;
00044     case ARMONICOSCILLATOR:                     s = "Armonic Oscillator";                   break;
00045     case GALACTIC_POTENTIAL_ALLEN:              s = "Galactic Potential (Allen)";           break; 
00046     case GALACTIC_POTENTIAL_ALLEN_PLUS_NEWTON:  s = "Galactic Potential (Allen) + Newton";  break;
00047     case JPL_PLANETS_NEWTON:                    s = "JPL planets + Newton";                 break; 
00048     case GRAVITATIONALTREE:                     s = "Gravitational TreeCode";               break;
00049     case RELATIVISTIC:                          s = "Newton + Relativistic effects";        break;
00050     }   
00051     
00052     return s;
00053   }

void make_new_interaction Interaction **  i,
const InteractionType  type
 

Definition at line 55 of file orsa_interaction.cc.

References orsa::ARMONICOSCILLATOR, orsa::GALACTIC_POTENTIAL_ALLEN, orsa::GALACTIC_POTENTIAL_ALLEN_PLUS_NEWTON, orsa::GRAVITATIONALTREE, orsa::JPL_PLANETS_NEWTON, orsa::NEWTON, orsa::NEWTON_MPI, ORSA_WARNING, and orsa::RELATIVISTIC.

Referenced by OrsaFile::Read(), and Evolution::SetInteraction().

00055                                                                           {
00056     
00057     delete (*i);
00058     (*i) = 0;
00059     
00060     switch (type) {
00061     case NEWTON:                               (*i) = new Newton;                           break;
00062     case NEWTON_MPI:                        
00063 #ifdef HAVE_MPI
00064       (*i) = new Newton_MPI;                  
00065 #else
00066       ORSA_WARNING("read NEWTON_MPI interaction from application without MPI support.");
00067 #endif
00068       break;
00069     case ARMONICOSCILLATOR:                    (*i) = new ArmonicOscillator(1,1);           break;
00070     case GALACTIC_POTENTIAL_ALLEN:             (*i) = new GalacticPotentialAllen;           break;
00071     case GALACTIC_POTENTIAL_ALLEN_PLUS_NEWTON: (*i) = new GalacticPotentialAllenPlusNewton; break;
00072     case JPL_PLANETS_NEWTON:                   /*************************************/      break;
00073     case GRAVITATIONALTREE:                    (*i) = new GravitationalTree;                break;
00074     case RELATIVISTIC:                         (*i) = new Relativistic;                     break;
00075     }    
00076   }


Generated on Tue Jan 11 15:27:03 2005 for liborsa by  doxygen 1.4.0