Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Fix compilation errors related to PARTICLE condition #367

Merged
merged 3 commits into from
Oct 23, 2024
Merged
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
10 changes: 5 additions & 5 deletions src/Auxiliary/Aux_ComputeProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void Aux_ComputeProfile( Profile_t *Prof[], const double Center[], const double
# ifdef GRAVITY
SupportedFields |= _POTE;
# endif
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
SupportedFields |= _PAR_DENS;
SupportedFields |= _TOTAL_DENS;
# endif
Expand All @@ -156,7 +156,7 @@ void Aux_ComputeProfile( Profile_t *Prof[], const double Center[], const double


// record whether particle density is requested
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
bool NeedPar = false;
for (int p=0; p<NProf; p++) {
if ( TVarBitIdx[p] == _PAR_DENS || TVarBitIdx[p] == _TOTAL_DENS ) {
Expand Down Expand Up @@ -274,7 +274,7 @@ void Aux_ComputeProfile( Profile_t *Prof[], const double Center[], const double


// initialize the particle density array (rho_ext) and collect particles to the target level
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
const bool TimingSendPar_No = false;
const bool JustCountNPar_No = false;
# ifdef LOAD_BALANCE
Expand All @@ -295,7 +295,7 @@ void Aux_ComputeProfile( Profile_t *Prof[], const double Center[], const double

Prepare_PatchData_InitParticleDensityArray( lv, PrepTime );
} // if ( NeedPar )
# endif // #ifdef PARTICLE
# endif // #ifdef MASSIVE_PARTICLES


// different OpenMP threads and MPI processes first compute profiles independently
Expand Down Expand Up @@ -546,7 +546,7 @@ void Aux_ComputeProfile( Profile_t *Prof[], const double Center[], const double

// free particle resources
// --> these two routines should NOT be put inside an OpenMP parallel region
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
if ( NeedPar )
{
Par_CollectParticle2OneLevel_FreeMemory( lv, SibBufPatch, FaSibBufPatch );
Expand Down
8 changes: 4 additions & 4 deletions src/Auxiliary/Aux_FindExtrema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi
const real MinTemp_No = -1.0;
const real MinEntr_No = -1.0;
const bool DE_Consistency_No = false;
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
const bool TimingSendPar_No = false;
const bool JustCountNPar_No = false;
# ifdef LOAD_BALANCE
Expand All @@ -181,7 +181,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi
const bool SibBufPatch = NULL_BOOL;
const bool FaSibBufPatch = NULL_BOOL;
# endif
# endif // #ifdef PARTICLE
# endif // #ifdef MASSIVE_PARTICLES


// initialize the extrema
Expand All @@ -205,7 +205,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi
for (int t=0; t<NTotal; t++) PID0_List[t] = 8*t;

// initialize the particle density array (rho_ext) and collect particles to the target level
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
if ( Extrema->Field & _PAR_DENS || Extrema->Field & _TOTAL_DENS )
{
Par_CollectParticle2OneLevel( lv, _PAR_MASS|_PAR_POSX|_PAR_POSY|_PAR_POSZ|_PAR_TYPE, PredictPos, Time[lv],
Expand Down Expand Up @@ -324,7 +324,7 @@ void Aux_FindExtrema( Extrema_t *Extrema, const ExtremaMode_t Mode, const int Mi
} // for (int Disp=0; Disp<NTotal; Disp+=NPG_Max)

// free memory for collecting particles from other ranks and levels, and free density arrays with ghost zones (rho_ext)
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
if ( Extrema->Field & _PAR_DENS || Extrema->Field & _TOTAL_DENS )
{
Par_CollectParticle2OneLevel_FreeMemory( lv, SibBufPatch, FaSibBufPatch );
Expand Down
8 changes: 4 additions & 4 deletions src/Auxiliary/Aux_FindWeightedAverageCenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void Aux_FindWeightedAverageCenter( double WeightedAverageCenter[], const double
const real MinTemp_No = -1.0;
const real MinEntr_No = -1.0;
const bool DE_Consistency_No = false;
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
const bool TimingSendPar_No = false;
const bool JustCountNPar_No = false;
# ifdef LOAD_BALANCE
Expand All @@ -127,7 +127,7 @@ void Aux_FindWeightedAverageCenter( double WeightedAverageCenter[], const double
const bool SibBufPatch = NULL_BOOL;
const bool FaSibBufPatch = NULL_BOOL;
# endif
# endif // #ifdef PARTICLE
# endif // #ifdef MASSIVE_PARTICLES

// initialize the referenced center in the first iteration as the input Center_ref
const double MaxR2 = SQR( MaxR );
Expand Down Expand Up @@ -183,7 +183,7 @@ void Aux_FindWeightedAverageCenter( double WeightedAverageCenter[], const double
for (int t=0; t<NTotal; t++) PID0_List[t] = 8*t;

// initialize the particle density array (rho_ext) and collect particles to the target level
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
if ( WeightingDensityField & _PAR_DENS || WeightingDensityField & _TOTAL_DENS )
{
Par_CollectParticle2OneLevel( lv, _PAR_MASS|_PAR_POSX|_PAR_POSY|_PAR_POSZ|_PAR_TYPE, PredictPos, Time[lv],
Expand Down Expand Up @@ -283,7 +283,7 @@ void Aux_FindWeightedAverageCenter( double WeightedAverageCenter[], const double
} // for (int Disp=0; Disp<NTotal; Disp+=NPG_Max)

// free memory for collecting particles from other ranks and levels, and free density arrays with ghost zones (rho_ext)
# ifdef PARTICLE
# ifdef MASSIVE_PARTICLES
if ( WeightingDensityField & _PAR_DENS || WeightingDensityField & _TOTAL_DENS )
{
Par_CollectParticle2OneLevel_FreeMemory( lv, SibBufPatch, FaSibBufPatch );
Expand Down
2 changes: 2 additions & 0 deletions src/Auxiliary/Aux_TakeNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,9 @@ void Aux_TakeNote()
fprintf( Note, "OPT__OUTPUT_TEXT_FORMAT_FLT %s\n", OPT__OUTPUT_TEXT_FORMAT_FLT );
# ifdef PARTICLE
fprintf( Note, "OPT__OUTPUT_PAR_MODE % d\n", OPT__OUTPUT_PAR_MODE );
# ifdef TRACER
fprintf( Note, "OPT__OUTPUT_PAR_MESH % d\n", OPT__OUTPUT_PAR_MESH );
# endif
# endif
fprintf( Note, "OPT__OUTPUT_BASEPS % d\n", OPT__OUTPUT_BASEPS );
fprintf( Note, "OPT__OUTPUT_BASE % d\n", OPT__OUTPUT_BASE );
Expand Down
4 changes: 2 additions & 2 deletions src/Init/Init_Load_Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,11 @@ void Init_Load_Parameter()
ReadPara->Add( "OPT__OUTPUT_TEXT_FORMAT_FLT", OPT__OUTPUT_TEXT_FORMAT_FLT, "%24.16e", Useless_str, Useless_str );
# ifdef PARTICLE
ReadPara->Add( "OPT__OUTPUT_PAR_MODE", &OPT__OUTPUT_PAR_MODE, 0, 0, 2 );
# endif
# ifdef TRACER
ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, true, Useless_bool, Useless_bool );
# else
ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, false, false, false );
ReadPara->Add( "OPT__OUTPUT_PAR_MESH", &OPT__OUTPUT_PAR_MESH, false, Useless_bool, Useless_bool );
# endif
# endif
ReadPara->Add( "OPT__OUTPUT_BASEPS", &OPT__OUTPUT_BASEPS, false, Useless_bool, Useless_bool );
ReadPara->Add( "OPT__OUTPUT_BASE", &OPT__OUTPUT_BASE, false, Useless_bool, Useless_bool );
Expand Down
9 changes: 9 additions & 0 deletions src/Init/Init_ResetParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,15 @@ void Init_ResetParameter()
PRINT_RESET_PARA( amr->Par->GhostSizeTracer, FORMAT_INT, "for the adopted PAR_TR_INTERP scheme" );
}

# ifndef TRACER
if ( OPT__OUTPUT_PAR_MESH )
{
OPT__OUTPUT_PAR_MESH = false;

PRINT_RESET_PARA( OPT__OUTPUT_PAR_MESH, FORMAT_INT, "since TRACER is disabled" );
}
# endif

# endif // #ifdef PARTICLE


Expand Down
Loading