@@ -60,6 +60,7 @@ namespace BasisClasses
60
60
" self_consistent" ,
61
61
" cachename" ,
62
62
" modelname" ,
63
+ " pyname" ,
63
64
" rnum"
64
65
};
65
66
@@ -860,7 +861,9 @@ namespace BasisClasses
860
861
{" gaussian" , DiskType::gaussian},
861
862
{" mn" , DiskType::mn},
862
863
{" exponential" , DiskType::exponential},
863
- {" doubleexpon" , DiskType::doubleexpon}
864
+ {" doubleexpon" , DiskType::doubleexpon},
865
+ {" diskbulge" , DiskType::diskbulge},
866
+ {" python" , DiskType::python}
864
867
};
865
868
866
869
const std::set<std::string>
@@ -911,6 +914,8 @@ namespace BasisClasses
911
914
" aratio" ,
912
915
" hratio" ,
913
916
" dweight" ,
917
+ " Mfac" ,
918
+ " HERNA" ,
914
919
" rwidth" ,
915
920
" rfactor" ,
916
921
" rtrunc" ,
@@ -921,7 +926,8 @@ namespace BasisClasses
921
926
" self_consistent" ,
922
927
" playback" ,
923
928
" coefCompute" ,
924
- " coefMaster"
929
+ " coefMaster" ,
930
+ " pyname"
925
931
};
926
932
927
933
Cylindrical::Cylindrical (const YAML::Node& CONF) :
@@ -980,6 +986,22 @@ namespace BasisClasses
980
986
w2*exp (-R/a2)/(4.0 *M_PI*a2*a2*h2*f2*f2) ;
981
987
}
982
988
break ;
989
+
990
+ case DiskType::diskbulge:
991
+ {
992
+ double f = cosh (z/hcyl);
993
+ double rr = pow (pow (R, 2 ) + pow (z,2 ), 0.5 );
994
+ double w1 = Mfac;
995
+ double w2 = 1.0 - Mfac;
996
+ double as = HERNA;
997
+
998
+ ans = w1*exp (-R/acyl)/(4.0 *M_PI*acyl*acyl*hcyl*f*f) +
999
+ w2*pow (as, 4 )/(2.0 *M_PI*rr)*pow (rr+as,-3.0 ) ;
1000
+ }
1001
+ break ;
1002
+ case DiskType::python:
1003
+ ans = (*pyDens)(R, z, phi);
1004
+ break ;
983
1005
case DiskType::exponential:
984
1006
default :
985
1007
{
@@ -1068,6 +1090,12 @@ namespace BasisClasses
1068
1090
// Ratio of second disk relative to the first disk for disk basis construction with double-exponential
1069
1091
dweight = 1.0 ;
1070
1092
1093
+ // mass fraction for disk for diskbulge
1094
+ Mfac = 1.0 ;
1095
+
1096
+ // Hernquist scale a disk basis construction with diskbulge
1097
+ HERNA = 0.10 ;
1098
+
1071
1099
// Width for erf truncation for EOF conditioning density (ignored if zero)
1072
1100
rwidth = 0.0 ;
1073
1101
@@ -1124,16 +1152,19 @@ namespace BasisClasses
1124
1152
if (conf[" dmodel" ]) dmodel = conf[" dmodel" ].as <bool >();
1125
1153
1126
1154
if (conf[" aratio" ]) aratio = conf[" aratio" ].as <double >();
1127
- if (conf[" hratio" ]) aratio = conf[" hratio" ].as <double >();
1128
- if (conf[" dweight" ]) aratio = conf[" dweight" ].as <double >();
1129
- if (conf[" rwidth" ]) aratio = conf[" rwidth" ].as <double >();
1130
- if (conf[" ashift" ]) aratio = conf[" ashift" ].as <double >();
1155
+ if (conf[" hratio" ]) hratio = conf[" hratio" ].as <double >();
1156
+ if (conf[" dweight" ]) dweight = conf[" dweight" ].as <double >();
1157
+ if (conf[" Mfac" ]) Mfac = conf[" Mfac" ].as <double >();
1158
+ if (conf[" HERNA" ]) HERNA = conf[" HERNA" ].as <double >();
1159
+ if (conf[" rwidth" ]) rwidth = conf[" rwidth" ].as <double >();
1160
+ if (conf[" ashift" ]) ashift = conf[" ashift" ].as <double >();
1131
1161
if (conf[" rfactor" ]) rfactor = conf[" rfactor" ].as <double >();
1132
1162
if (conf[" rtrunc" ]) rtrunc = conf[" rtrunc" ].as <double >();
1133
1163
if (conf[" pow" ]) ppow = conf[" ppow" ].as <double >();
1134
1164
if (conf[" mtype" ]) mtype = conf[" mtype" ].as <std::string>();
1135
1165
if (conf[" dtype" ]) dtype = conf[" dtype" ].as <std::string>();
1136
1166
if (conf[" vflag" ]) vflag = conf[" vflag" ].as <int >();
1167
+ if (conf[" pyname" ]) pyname = conf[" pyname" ].as <std::string>();
1137
1168
1138
1169
// Deprecation warning
1139
1170
if (conf[" density" ]) {
@@ -1261,7 +1292,7 @@ namespace BasisClasses
1261
1292
DTYPE = dtlookup.at (dtype); // key is not in the map.
1262
1293
1263
1294
if (myid==0 ) // Report DiskType
1264
- std::cout << " DiskType is <" << dtype << " >" << std::endl;
1295
+ std::cout << " ---- DiskType is <" << dtype << " >" << std::endl;
1265
1296
}
1266
1297
catch (const std::out_of_range& err) {
1267
1298
if (myid==0 ) {
@@ -1273,6 +1304,12 @@ namespace BasisClasses
1273
1304
throw std::runtime_error (" Cylindrical::initialize: invalid DiskType" );
1274
1305
}
1275
1306
1307
+ // Check for and initialize the Python density type
1308
+ //
1309
+ if (DTYPE == DiskType::python) {
1310
+ pyDens = std::make_shared<DiskDensityFunc>(pyname);
1311
+ }
1312
+
1276
1313
// Use these user models to deproject for the EOF spherical basis
1277
1314
//
1278
1315
if (deproject) {
0 commit comments