GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
forceTree.h
1This 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
39class TreeForce : public TreeSimple {
40public:
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
62protected:
63
64 bool init;
65
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
112typedef TreeForce *TreeForceHndl;
113
114#endif /* FORCE_TREE_H_ */
A base class for all types of lensing "halos" which are any mass distribution that cause lensing.
Definition lens_halos.h:56
Object used to calculate the force or deflection caused by a collection of "particles" by the tree me...
Definition forceTree.h:39
void force2D(PosType const *ray, PosType *alpha, KappaType *kappa, KappaType *gamma, KappaType *phi)
calculate the deflection and lensing propertie
Definition forceTree.cpp:182
void rotate_coordinates(PosType **coord)
simple rotates the coordinates in the xp array
Definition forceTree.cpp:137
bool MultiMass
true if particles have different masses.
Definition forceTree.h:67
float * rsph
Array of particle sizes.
Definition forceTree.h:73
float * masses
Array of particle masses.
Definition forceTree.h:71
PosType kappa_background
Definition forceTree.h:76
bool MultiRadius
true if particles have different sizes.
Definition forceTree.h:69
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
bool init
provides a way to change the profiles of the particles, by default Gaussian
Definition forceTree.h:64
float * CalculateSPHsmoothing(int N)
calculated sph smoothing and store them in the tree, also provide pointer to them
Definition forceTree.cpp:156
A C++ class wrapper for the bianary treeNB used in the Nbody force calculation, but also useful for g...
Definition simpleTree.h:86