Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions GravityParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ class extraSPHData
double _massHot; /* Hot phase mass*/
double _fDensityU; /* Energy-scaled density */
double _fThermalCond; /* Conduction rate */
#ifdef HYPCOND
double _dThermalCondTau;
Vector3D<double> _dQCond;
Vector3D<double> _dQCondPred;
Vector3D<double> _dQCondDot;
Vector3D<double> _gradU;
Vector3D<double> _gradQx;
Vector3D<double> _gradQy;
Vector3D<double> _gradQz;
#endif
double _fPromoteSum; /* Total evaporated mass */
double _fPromoteSumuPred; /* Total evaporating energy */
double _fPromoteuPredInit; /* Original energy pre-evaporation */
Expand Down Expand Up @@ -174,6 +184,16 @@ class extraSPHData
inline double& massHot() {return _massHot;}
inline double& fDensityU() {return _fDensityU;}
inline double& fThermalCond() {return _fThermalCond;}
#ifdef HYPCOND
inline double& dThermalCondTau() {return _dThermalCondTau;}
inline Vector3D<double>& gradU() {return _gradU;};
inline Vector3D<double>& gradQx() {return _gradQx;}
inline Vector3D<double>& gradQy() {return _gradQy;}
inline Vector3D<double>& gradQz() {return _gradQz;}
inline Vector3D<double>& dQCond() {return _dQCond;}
inline Vector3D<double>& dQCondPred() {return _dQCondPred;}
inline Vector3D<double>& dQCondDot() {return _dQCondDot;}
#endif
inline double& fPromoteSum() {return _fPromoteSum;}
inline double& fPromoteSumuPred() {return _fPromoteSumuPred;}
inline double& fPromoteuPredInit() {return _fPromoteuPredInit;}
Expand Down Expand Up @@ -237,6 +257,16 @@ class extraSPHData
p| _massHot;
p| _fDensityU;
p| _fThermalCond;
#ifdef HYPCOND
p| _dThermalCondTau;
p| _gradU;
p| _gradQx;
p| _gradQy;
p| _gradQz;
p| _dQCond;
p| _dQCondPred;
p| _dQCondDot;
#endif
p| _fPromoteSum;
p| _fPromoteSumuPred;
p| _fPromoteuPredInit;
Expand Down Expand Up @@ -530,6 +560,16 @@ class GravityParticle : public ExternalGravityParticle {
inline double& massHot() { IMAGAS; return (((extraSPHData*)extraData)->massHot());}
inline double& fDensityU() { IMAGAS; return (((extraSPHData*)extraData)->fDensityU());}
inline double& fThermalCond() { IMAGAS; return (((extraSPHData*)extraData)->fThermalCond());}
#ifdef HYPCOND
inline double& dThermalCondTau() { IMAGAS; return (((extraSPHData*)extraData)->dThermalCondTau());}
inline Vector3D<double>& gradU() { IMAGAS; return (((extraSPHData*)extraData)->gradU());}
inline Vector3D<double>& gradQx() { IMAGAS; return (((extraSPHData*)extraData)->gradQx());}
inline Vector3D<double>& gradQy() { IMAGAS; return (((extraSPHData*)extraData)->gradQy());}
inline Vector3D<double>& gradQz() { IMAGAS; return (((extraSPHData*)extraData)->gradQz());}
inline Vector3D<double>& dQCond() { IMAGAS; return (((extraSPHData*)extraData)->dQCond());}
inline Vector3D<double>& dQCondPred() { IMAGAS; return (((extraSPHData*)extraData)->dQCondPred());}
inline Vector3D<double>& dQCondDot() { IMAGAS; return (((extraSPHData*)extraData)->dQCondDot());}
#endif
inline double& fPromoteSum() { IMAGAS; return (((extraSPHData*)extraData)->fPromoteSum());}
inline double& fPromoteSumuPred() { IMAGAS; return (((extraSPHData*)extraData)->fPromoteSumuPred());}
inline double& fPromoteuPredInit() { IMAGAS; return (((extraSPHData*)extraData)->fPromoteuPredInit());}
Expand Down Expand Up @@ -706,6 +746,16 @@ class ExternalSmoothParticle {
double massHot;
double fDensityU;
double fThermalCond;
#ifdef HYPCOND
double dThermalCondTau;
Vector3D<double> gradU;
Vector3D<double> gradQx;
Vector3D<double> gradQy;
Vector3D<double> gradQz;
Vector3D<double> dQCond;
Vector3D<double> dQCondPred;
Vector3D<double> dQCondDot;
#endif
double fPromoteSum;
double fPromoteSumuPred;
double fPromoteuPredInit;
Expand Down Expand Up @@ -775,6 +825,16 @@ class ExternalSmoothParticle {
massHot = p->massHot();
fDensityU = p->fDensityU();
fThermalCond = p->fThermalCond();
#ifdef HYPCOND
dThermalCondTau = p->dThermalCondTau();
gradU = p->gradU();
gradQx = p->gradQx();
gradQy = p->gradQy();
gradQz = p->gradQz();
dQCond = p->dQCond();
dQCondPred = p->dQCondPred();
dQCondDot = p->dQCondDot();
#endif
fPromoteSum = p->fPromoteSum();
fPromoteSumuPred = p->fPromoteSumuPred();
fPromoteuPredInit = p->fPromoteuPredInit();
Expand Down Expand Up @@ -849,6 +909,16 @@ class ExternalSmoothParticle {
tmp->massHot() = massHot;
tmp->fDensityU() = fDensityU;
tmp->fThermalCond() = fThermalCond;
#ifdef HYPCOND
tmp->dThermalCondTau() = dThermalCondTau;
tmp->gradU() = gradU;
tmp->gradQx() = gradQx;
tmp->gradQy() = gradQy;
tmp->gradQz() = gradQz;
tmp->dQCond() = dQCond;
tmp->dQCondPred() = dQCondPred;
tmp->dQCondDot() = dQCondDot;
#endif
tmp->fPromoteSum() = fPromoteSum;
tmp->fPromoteSumuPred() = fPromoteSumuPred;
tmp->fPromoteuPredInit() = fPromoteuPredInit;
Expand Down Expand Up @@ -919,6 +989,16 @@ class ExternalSmoothParticle {
p | massHot;
p | fDensityU;
p | fThermalCond;
#ifdef HYPCOND
p | dThermalCondTau;
p | gradU;
p | gradQx;
p | gradQy;
p | gradQz;
p | dQCond;
p | dQCondPred;
p | dQCondDot;
#endif
p | fPromoteSum;
p | fPromoteSumuPred;
p | fPromoteuPredInit;
Expand Down
16 changes: 16 additions & 0 deletions InOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ void load_tipsy_gas(Tipsy::TipsyReader &r, GravityParticle &p, double dTuFac)
p.uHotDot() = 0.0;
p.massHot() = 0.0;
p.fThermalCond() = 0.0;
#ifdef HYPCOND
p.dThermalCondTau() = 0.0;
p.dQCondDot() = 0.0;
p.gradQx() = 0.0;
p.gradQy() = 0.0;
p.gradQz() = 0.0;
p.gradU() = 0.0;
#endif
p.fPromoteSum() = 0.0;
p.fPromoteSumuPred() = 0.0;
p.fPromoteuPredInit() = 0.0;
Expand Down Expand Up @@ -626,6 +634,14 @@ static void load_NC_gas(std::string filename, int64_t startParticle,
myParts[i].uHotDot() = 0.0;
myParts[i].massHot() = 0.0;
myParts[i].fThermalCond() = 0.0;
#ifdef HYPCOND
myParts[i].dThermalCondTau() = 0.0;
myParts[i].dQCondDot() = 0.0;
myParts[i].gradU() = 0.0;
myParts[i].gradQx() = 0.0;
myParts[i].gradQy() = 0.0;
myParts[i].gradQz() = 0.0;
#endif
myParts[i].fPromoteSum() = 0.0;
myParts[i].fPromoteSumuPred() = 0.0;
myParts[i].fPromoteuPredInit() = 0.0;
Expand Down
36 changes: 36 additions & 0 deletions InOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,42 @@ class OutputParams : public PUP::able
}
};

#ifdef HYPCOND
/*NAO HYPCOND*/
/// @brief Output HYPCOND
class HypCondOutputParams : public OutputParams
{
public:
virtual double dValue(GravityParticle *p){CkAssert(0); return 0.0;}
virtual Vector3D<double> vValue(GravityParticle *p){ return (p->isGas() ? p->dQCond() : 0.0);}
virtual void setDValue(GravityParticle *p, double val) {CkAssert(0);}
virtual void setVValue(GravityParticle *p, Vector3D<double> val) {
if(p->isGas()){
p->dQCond() = val;
p->dQCondPred() = p->dQCond();}
}
virtual int64_t iValue(GravityParticle *p) {CkAssert(0); return 0.0;}
virtual void setIValue(GravityParticle *p, int64_t iValue) {CkAssert(0);}
public:
HypCondOutputParams() {}
HypCondOutputParams(std::string _fileName) { bFloat = 1; bVector = 1; fileName = _fileName;}
HypCondOutputParams(std::string _fileName, int _iBinaryOut, double _dTime) {
bFloat = 1;
bVector = 1; fileName = _fileName; iBinaryOut = _iBinaryOut;
sTipsyExt = "dQCond"; sNChilExt = "dQCond";
dTime = _dTime;
iType = TYPE_GAS; }
PUPable_decl(HypCondOutputParams);
HypCondOutputParams(CkMigrateMessage *m) {}
virtual void pup(PUP::er &p) {
OutputParams::pup(p);//Call base class
}
};
/*NAO HYPCOND*/
#endif



#ifdef SUPERBUBBLE
/// @brief Output particle hot phase internal energy
class uHotOutputParams : public OutputParams
Expand Down
3 changes: 2 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ defines := $(strip @HEXADECAPOLE@ @FLAG_GDFORCE@ @FLAG_ARCH@ \
@FLAG_JEANSSOFTONLY@ @FLAG_FLOAT@ @FLAG_COLLISION@ \
@FLAG_TREE_BUILD@ $(debug_defines) @FLAG_INTERLIST@ \
@FLAG_NSMOOTHINNER@ @FLAG_SPLITGAS@ @FLAG_SIDMINTERACT@ \
@FLAG_SUPERBUBBLE@ @FLAG_SHIELDSF@ @FLAG_STOCH@ \
@FLAG_THERMALDIFFONLY@ @FLAG_ACCZERO@ \
@FLAG_SUPERBUBBLE@ @FLAG_HYPCOND@ @FLAG_SHIELDSF@ @FLAG_STOCH@ \
$(cuda_defines) -DREDUCTION_HELPER)

modules := $(strip -language charm++ -balancer @DEFAULT_LB@ \
Expand Down
4 changes: 4 additions & 0 deletions ParallelGravity.ci
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ mainmodule ParallelGravity {
PUPable Kroupa01;

#ifdef SUPERBUBBLE
#ifdef HYPCOND
PUPable HypGrads;
PUPable HypCondOutputParams;
#endif
PUPable PromoteToHotGasSmoothParams;
PUPable ShareWithHotGasSmoothParams;
PUPable uHotOutputParams;
Expand Down
23 changes: 23 additions & 0 deletions ParallelGravity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2508,6 +2508,10 @@ void Main::setupICs() {

treeProxy.loadTipsy(basefilename, dTuFac, bInDPos, bInDVel,
CkCallbackResumeThread());
#ifdef HYPCOND
nTotalParticles = treeProxy[0].ckLocal()->nTotalParticles;
initQCond();
#endif
}
}
catch (std::ios_base::failure e) {
Expand Down Expand Up @@ -3268,6 +3272,9 @@ Main::doSimulation()
* Write out additional variables when using superbubble
* (multiphase properties and effective temperature)
*/
#ifdef HYPCOND
HypCondOutputParams pdQCondOut(achFile,param.iBinaryOut,0.0);
#endif
uHotOutputParams puHotOut(achFile, param.iBinaryOut, 0.0);
uOutputParams puOut(achFile, param.iBinaryOut, 0.0);
MassHotOutputParams pmHotOut(achFile, param.iBinaryOut, 0.0);
Expand All @@ -3284,6 +3291,10 @@ Main::doSimulation()
CsOutputParams pCsOut(achFile, param.iBinaryOut, 0.0);
if (param.iBinaryOut) {
#ifdef SUPERBUBBLE
#ifdef HYPCOND
outputBinary(pdQCondOut,param.bParaWrite,
CkCallbackResumeThread());
#endif
outputBinary(puHotOut, param.bParaWrite,
CkCallbackResumeThread());
outputBinary(puOut, param.bParaWrite,
Expand Down Expand Up @@ -3315,6 +3326,9 @@ Main::doSimulation()
}
else {
#ifdef SUPERBUBBLE
#ifdef HYPCOND
treeProxy[0].outputASCII(pdQCondOut, param.bParaWrite, CkCallbackResumeThread());
#endif
treeProxy[0].outputASCII(pmHotOut, param.bParaWrite, CkCallbackResumeThread());
treeProxy[0].outputASCII(puHotOut, param.bParaWrite, CkCallbackResumeThread());
treeProxy[0].outputASCII(puOut, param.bParaWrite, CkCallbackResumeThread());
Expand Down Expand Up @@ -3792,6 +3806,9 @@ void Main::writeOutput(int iStep)
* Write out additional variables when using superbubble
* (multiphase properties and effective temperature)
*/
#ifdef HYPCOND
HypCondOutputParams pdQCondOut(achFile,param.iBinaryOut,0.0);
#endif
MassHotOutputParams pmHotOut(achFile, param.iBinaryOut, 0.0);
uHotOutputParams puHotOut(achFile, param.iBinaryOut, 0.0);
uOutputParams puOut(achFile, param.iBinaryOut, 0.0);
Expand All @@ -3816,6 +3833,9 @@ void Main::writeOutput(int iStep)
#endif
if (param.bStarForm || param.bFeedback) {
#ifdef SUPERBUBBLE
#ifdef HYPCOND
outputBinary(pdQCondOut,param.bParaWrite,CkCallbackResumeThread());
#endif
outputBinary(puHotOut, param.bParaWrite, CkCallbackResumeThread());
outputBinary(puOut, param.bParaWrite, CkCallbackResumeThread());
outputBinary(pmHotOut, param.bParaWrite, CkCallbackResumeThread());
Expand Down Expand Up @@ -3894,6 +3914,9 @@ void Main::writeOutput(int iStep)
#endif
if (param.bStarForm || param.bFeedback) {
#ifdef SUPERBUBBLE
#ifdef HYPCOND
treeProxy[0].outputASCII(pdQCondOut, param.bParaWrite, CkCallbackResumeThread());
#endif
treeProxy[0].outputASCII(pmHotOut, param.bParaWrite, CkCallbackResumeThread());
treeProxy[0].outputASCII(puHotOut, param.bParaWrite, CkCallbackResumeThread());
treeProxy[0].outputASCII(puOut, param.bParaWrite, CkCallbackResumeThread());
Expand Down
1 change: 1 addition & 0 deletions ParallelGravity.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ class Main : public CBase_Main {
void growMass(double dTime, double dDelta);
void initSph();
void initCooling();
void initQCond();
void initLWData();
void initStarLog();
void initHMStarLog();
Expand Down
Loading