GLAMERDOC++
Gravitational Lensing Code Library
forceTree.h
1 This file has been depricated and still exists only to recycle code.
2 
3 /*
4  * forceTree.h
5  *
6  * Created on: Oct 14, 2011
7  * Author: bmetcalf
8  */
9 
10 #ifndef FORCE_TREE_H_
11 #define FORCE_TREE_H_
12 
13 #include "simpleTree.h"
14 #include "lens_halos.h"
15 
16 //enum PartProf {gaussian,powerlaw};
17 
39 class TreeForce : public TreeSimple {
40 public:
41  TreeForce(PosType **xp,IndexType Npoints,float *masses,float *rsph,bool Multimass,bool Multisize
42  ,PosType my_kappa_background = 0,int bucket = 5,int dimensions = 2,bool median = false,PosType theta = 0.1
43  );
44 
45  TreeForce(PosType **xp,IndexType Npoints,LensHalo *my_halos
46  ,bool Multisize = true,PosType my_kappa_bk=0.0,int bucket = 5,int dimensions = 2
47  ,bool median = false,PosType theta = 0.1
48  );
49 
50  ~TreeForce();
51 
53  float * CalculateSPHsmoothing(int N);
55  void force2D(PosType const *ray,PosType *alpha,KappaType *kappa,KappaType *gamma
56  ,KappaType *phi);
57  // void force2D(PosType *ray,PosType *alpha,KappaType *kappa,KappaType *gamma);
59  //void ChangeParticleProfile(PartProf partprof);
60 
61 
62 protected:
63 
64  bool init;
65 
67  bool MultiMass;
71  float *masses;
73  float *rsph;
77 
78  PosType force_theta;
79 
80  //PosType (*alpha_particle)(PosType r,float xmax);
81  //PosType (*kappa_particle)(PosType r,float xmax);
82  //PosType (*gamma_particle)(PosType r,float xmax);
83 
84  //PosType (*alpha_halo)(PosType r,HaloInternal &par);
85  //PosType (*kappa_halo)(PosType r,HaloInternal &par);
86  //PosType (*gamma_halo)(PosType r,HaloInternal &par);
87 
88  void CalcMoments();
89  void rotate_coordinates(PosType **coord);
90  //void spread_particles();
91 
92  inline virtual PosType alpha_h(PosType r2s2,PosType sigma){
93  return (sigma > 0.0 ) ? ( exp(-0.5*r2s2) - 1.0 ) : -1.0;
94  }
95  inline virtual PosType kappa_h(PosType r2s2,PosType sigma){
96  return 0.5*r2s2*exp(-0.5*r2s2);
97  }
98  inline virtual PosType gamma_h(PosType r2s2,PosType sigma){
99  return (sigma > 0.0 ) ? (-2.0 + (2.0 + r2s2)*exp(-0.5*r2s2) ) : -2.0;
100  }
101  inline virtual PosType phi_o(PosType r2,PosType sigma){
102  ERROR_MESSAGE(); // not yet written
103  std::cout << "time delay has not been fixed fot this profile yet." << std::endl;
104  exit(1);
105  return 0;
106  }
107 
108  bool haloON;
109  LensHalo *halos;
110 };
111 
112 typedef TreeForce *TreeForceHndl;
113 
114 #endif /* FORCE_TREE_H_ */
TreeSimple
A C++ class wrapper for the bianary treeNB used in the Nbody force calculation, but also useful for g...
Definition: simpleTree.h:86
LensHalo
A base class for all types of lensing "halos" which are any mass distribution that cause lensing.
Definition: lens_halos.h:57
TreeForce::masses
float * masses
Array of particle masses.
Definition: forceTree.h:71
TreeForce::MultiMass
bool MultiMass
true if particles have different masses.
Definition: forceTree.h:67
TreeForce::MultiRadius
bool MultiRadius
true if particles have different sizes.
Definition: forceTree.h:69
TreeForce::kappa_background
PosType kappa_background
Definition: forceTree.h:76
TreeForce::TreeForce
TreeForce(PosType **xp, IndexType Npoints, float *masses, float *rsph, bool Multimass, bool Multisize, PosType my_kappa_background=0, int bucket=5, int dimensions=2, bool median=false, PosType theta=0.1)
Definition: forceTree.cpp:10
TreeForce::init
bool init
provides a way to change the profiles of the particles, by default Gaussian
Definition: forceTree.h:64
TreeForce::rsph
float * rsph
Array of particle sizes.
Definition: forceTree.h:73
TreeForce::CalculateSPHsmoothing
float * CalculateSPHsmoothing(int N)
calculated sph smoothing and store them in the tree, also provide pointer to them
Definition: forceTree.cpp:156
TreeForce::force2D
void force2D(PosType const *ray, PosType *alpha, KappaType *kappa, KappaType *gamma, KappaType *phi)
calculate the deflection and lensing propertie
Definition: forceTree.cpp:182
TreeForce::rotate_coordinates
void rotate_coordinates(PosType **coord)
simple rotates the coordinates in the xp array
Definition: forceTree.cpp:137
TreeForce
Object used to calculate the force or deflection caused by a collection of "particles" by the tree me...
Definition: forceTree.h:39