Skip to content

Commit

Permalink
Fix more compiler warnings (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanlucf22 authored Mar 4, 2024
1 parent 91582f6 commit 71b2693
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 160 deletions.
3 changes: 3 additions & 0 deletions drivers/computeTieLineTernary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ namespace pt = boost::property_tree;

int main(int argc, char* argv[])
{
(void)argc;
(void)argv;

Thermo4PFM::EnergyInterpolationType energy_interp_func_type
= Thermo4PFM::EnergyInterpolationType::PBG;
Thermo4PFM::ConcInterpolationType conc_interp_func_type
Expand Down
3 changes: 3 additions & 0 deletions drivers/loopCALPHADConcSolverBinary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ typedef std::chrono::high_resolution_clock Clock;

int main(int argc, char* argv[])
{
(void)argc;
(void)argv;

const int N = 10000000;

#ifdef _OPENMP
Expand Down
3 changes: 3 additions & 0 deletions drivers/loopCALPHADSpeciesPhaseGibbsEnergy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace pt = boost::property_tree;

int main(int argc, char* argv[])
{
(void)argc;
(void)argv;

#ifdef _OPENMP
std::cout << "Run with " << omp_get_max_threads() << " threads"
<< std::endl;
Expand Down
3 changes: 3 additions & 0 deletions drivers/loopCALPHADbinaryKKS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ namespace pt = boost::property_tree;

int main(int argc, char* argv[])
{
(void)argc;
(void)argv;

#ifdef _OPENMP
std::cout << "Run test with " << omp_get_max_threads() << " threads"
<< std::endl;
Expand Down
3 changes: 3 additions & 0 deletions drivers/loopDeterminant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ using namespace Thermo4PFM;

int main(int argc, char* argv[])
{
(void)argc;
(void)argv;

#ifdef _OPENMP
std::cout << "Run test with " << omp_get_max_threads() << " threads"
<< std::endl;
Expand Down
3 changes: 3 additions & 0 deletions drivers/loopxlogx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ using namespace Thermo4PFM;

int main(int argc, char* argv[])
{
(void)argc;
(void)argv;

#ifdef _OPENMP
std::cout << "Run test with " << omp_get_max_threads() << " threads"
<< std::endl;
Expand Down
7 changes: 7 additions & 0 deletions drivers/plotEnergyVsComposition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ namespace pt = boost::property_tree;

int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cerr << "Requires two arguments: database name + temperature"
<< std::endl;
return 1;
}

std::string databasename(argv[1]);
double temperature = atof(argv[2]);

Expand Down
27 changes: 0 additions & 27 deletions src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -508,33 +508,6 @@ int CALPHADFreeEnergyFunctionsBinary3Ph2Sl::computePhaseConcentrations(
#pragma omp end declare target
#endif

//-----------------------------------------------------------------------
void CALPHADFreeEnergyFunctionsBinary3Ph2Sl::energyVsPhiAndC(
const double temperature, const double* const ceq, const bool found_ceq,
const double phi_well_scale, const int npts_phi, const int npts_c)
{
// Not implemented because it is ill-defined for a three-phase system.
}

// Print out free energy as a function of phase
// for given composition and temperature
// File format: ASCII VTK, readble with Visit
void CALPHADFreeEnergyFunctionsBinary3Ph2Sl::printEnergyVsPhiHeader(
const double temperature, const int nphi, const int nc, const double cmin,
const double cmax, const double slopec, std::ostream& os) const
{
// Not implemented because it is ill-defined for a three-phase system
}

//=======================================================================
void CALPHADFreeEnergyFunctionsBinary3Ph2Sl::printEnergyVsPhi(
const double* const conc, const double temperature,
const double phi_well_scale, const int npts, const double slopec,
std::ostream& os)
{
// Not implemented because it is ill-defined for a three-phase system
}

//=======================================================================
// compute free energy in [J/mol]

Expand Down
10 changes: 0 additions & 10 deletions src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,10 @@ class CALPHADFreeEnergyFunctionsBinary3Ph2Sl

int computePhaseConcentrations(const double temperature, const double* conc,
const double* const phi, double* x);
void energyVsPhiAndC(const double temperature, const double* const ceq,
const bool found_ceq, const double phi_well_scale,
const int npts_phi = 51,
const int npts_c = 50); // # of compositions to use (>1)
void printEnergyVsComposition(const double temperature, std::ostream& os,
const double cmin, const double cmax, const int npts = 100);
double fchem(const double* const phi, const double* const conc,
const double temperature);
void printEnergyVsPhiHeader(const double temperature, const int nphi,
const int nc, const double cmin, const double cmax, const double slopec,
std::ostream& os) const;
void printEnergyVsPhi(const double* const conc, const double temperature,
const double phi_well_scale, const int npts, const double slopec,
std::ostream& os);

void computeTdependentParameters(const double temperature,
CalphadDataType* Lmix_L, CalphadDataType* Lmix_A,
Expand Down
39 changes: 0 additions & 39 deletions src/CALPHADFreeEnergyFunctionsBinaryThreePhase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,6 @@ void CALPHADFreeEnergyFunctionsBinaryThreePhase::computeTdependentParameters(

//=======================================================================

// compute equilibrium concentrations in various phases for given temperature

bool CALPHADFreeEnergyFunctionsBinaryThreePhase::computeCeqT(
const double temperature, double* ceq, const int maxits, const bool verbose)
{
// Not used since the three phases are only in equilibrium at the eutectic
// point
return false;
}

//=======================================================================

void CALPHADFreeEnergyFunctionsBinaryThreePhase::computePhasesFreeEnergies(
const double temperature, const double* const hphi, const double conc,
double& fl, double& fa, double& fb)
Expand Down Expand Up @@ -334,33 +322,6 @@ int CALPHADFreeEnergyFunctionsBinaryThreePhase::computePhaseConcentrations(
#pragma omp end declare target
#endif

//-----------------------------------------------------------------------
void CALPHADFreeEnergyFunctionsBinaryThreePhase::energyVsPhiAndC(
const double temperature, const double* const ceq, const bool found_ceq,
const double phi_well_scale, const int npts_phi, const int npts_c)
{
// Not implemented because it is ill-defined for a three-phase system.
}

// Print out free energy as a function of phase
// for given composition and temperature
// File format: ASCII VTK, readble with Visit
void CALPHADFreeEnergyFunctionsBinaryThreePhase::printEnergyVsPhiHeader(
const double temperature, const int nphi, const int nc, const double cmin,
const double cmax, const double slopec, std::ostream& os) const
{
// Not implemented because it is ill-defined for a three-phase system
}

//=======================================================================
void CALPHADFreeEnergyFunctionsBinaryThreePhase::printEnergyVsPhi(
const double* const conc, const double temperature,
const double phi_well_scale, const int npts, const double slopec,
std::ostream& os)
{
// Not implemented because it is ill-defined for a three-phase system
}

//=======================================================================
// compute free energy in [J/mol]

Expand Down
13 changes: 0 additions & 13 deletions src/CALPHADFreeEnergyFunctionsBinaryThreePhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,14 @@ class CALPHADFreeEnergyFunctionsBinaryThreePhase
void computeSecondDerivativeFreeEnergy(const double temp,
const double* const conc, const PhaseIndex pi, double* d2fdc2);

bool computeCeqT(const double temperature, double* ceq,
const int maxits = 20, const bool verbose = false);

void preRunDiagnostics(const double T0 = 300., const double T1 = 3000.);

int computePhaseConcentrations(const double temperature, const double* conc,
const double* const phi, double* x);
void energyVsPhiAndC(const double temperature, const double* const ceq,
const bool found_ceq, const double phi_well_scale,
const int npts_phi = 51,
const int npts_c = 50); // # of compositions to use (>1)
void printEnergyVsComposition(const double temperature, std::ostream& os,
const double cmin, const double cmax, const int npts = 100);
double fchem(const double* const phi, const double* const conc,
const double temperature);
void printEnergyVsPhiHeader(const double temperature, const int nphi,
const int nc, const double cmin, const double cmax, const double slopec,
std::ostream& os) const;
void printEnergyVsPhi(const double* const conc, const double temperature,
const double phi_well_scale, const int npts, const double slopec,
std::ostream& os);

void computeTdependentParameters(const double temperature,
CalphadDataType* Lmix_L, CalphadDataType* Lmix_A,
Expand Down
4 changes: 4 additions & 0 deletions src/KKSFreeEnergyFunctionDiluteBinary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ void KKSFreeEnergyFunctionDiluteBinary::computeSecondDerivativeFreeEnergy(
const double temp, const double* const conc, const PhaseIndex pi,
double* d2fdc2)
{
(void)pi;

#ifndef HAVE_OPENMP_OFFLOAD
assert(conc[0] >= 0.);
assert(conc[0] <= 1.);
Expand Down Expand Up @@ -173,6 +175,8 @@ double KKSFreeEnergyFunctionDiluteBinary::computeFB(
bool KKSFreeEnergyFunctionDiluteBinary::computeCeqT(
const double temperature, double* ceq, const int maxits, const bool verbose)
{
(void)maxits;

#ifndef HAVE_OPENMP_OFFLOAD
if (verbose)
std::cout << "KKSFreeEnergyFunctionDiluteBinary::computeCeqT()"
Expand Down
6 changes: 5 additions & 1 deletion src/KKSFreeEnergyFunctionDiluteBinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ class KKSFreeEnergyFunctionDiluteBinary
bool computeCeqT(const double temperature, double* ceq,
const int maxits = 20, const bool verbose = false);

void preRunDiagnostics(const double T0 = 300., const double T1 = 3000.) {}
void preRunDiagnostics(const double T0 = 300., const double T1 = 3000.)
{
(void)T0;
(void)T1;
}

int computePhaseConcentrations(const double temperature, const double* conc,
const double* const phi, double* x);
Expand Down
2 changes: 2 additions & 0 deletions src/QuadraticConcSolverBinaryThreePhase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ void QuadraticConcSolverBinaryThreePhase::RHS(
void QuadraticConcSolverBinaryThreePhase::Jacobian(
const double* const c, JacobianDataType** const fjac)
{
(void)c;

fjac[0][0] = hphi0_;
fjac[0][1] = hphi1_;
fjac[0][2] = hphi2_;
Expand Down
13 changes: 6 additions & 7 deletions src/QuadraticFreeEnergyFunctionsBinary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ void QuadraticFreeEnergyFunctionsBinary::computeSecondDerivativeFreeEnergy(
const double temp, const double* const conc, const PhaseIndex pi,
double* d2fdc2)
{
(void)temp;
(void)conc;

double deriv;
switch (pi)
{
Expand All @@ -122,6 +125,9 @@ void QuadraticFreeEnergyFunctionsBinary::computeSecondDerivativeFreeEnergy(
bool QuadraticFreeEnergyFunctionsBinary::computeCeqT(
const double temperature, double* ceq, const int maxits, const bool verbose)
{
(void)maxits;
(void)verbose;

ceq[0] = ceql_ + (temperature - Tref_) * m_liquid_;
ceq[1] = ceqa_ + (temperature - Tref_) * m_solid_;

Expand Down Expand Up @@ -338,11 +344,4 @@ void QuadraticFreeEnergyFunctionsBinary::printEnergyVsComposition(
}
os << std::endl << std::endl;
}

//=======================================================================

void QuadraticFreeEnergyFunctionsBinary::preRunDiagnostics(
const double T0, const double T1)
{
}
}
2 changes: 0 additions & 2 deletions src/QuadraticFreeEnergyFunctionsBinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class QuadraticFreeEnergyFunctionsBinary
bool computeCeqT(const double temperature, double* ceq,
const int maxits = 20, const bool verbose = false);

void preRunDiagnostics(const double T0 = 300., const double T1 = 3000.);

int computePhaseConcentrations(const double temperature, const double* conc,
const double* const phi, double* x);
void energyVsPhiAndC(const double temperature, const double* const ceq,
Expand Down
51 changes: 7 additions & 44 deletions src/QuadraticFreeEnergyFunctionsBinaryThreePhase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ void QuadraticFreeEnergyFunctionsBinaryThreePhase::computeDerivFreeEnergy(
const double temperature, const double* const conc, const PhaseIndex pi,
double* deriv)
{
(void)temperature;

double A;
double ceq;

Expand Down Expand Up @@ -107,6 +109,9 @@ void QuadraticFreeEnergyFunctionsBinaryThreePhase::
computeSecondDerivativeFreeEnergy(const double temp,
const double* const conc, const PhaseIndex pi, double* d2fdc2)
{
(void)temp;
(void)conc;

double deriv;
switch (pi)
{
Expand All @@ -128,16 +133,6 @@ void QuadraticFreeEnergyFunctionsBinaryThreePhase::

//=======================================================================

// compute equilibrium concentrations in various phases for given temperature

bool QuadraticFreeEnergyFunctionsBinaryThreePhase::computeCeqT(
const double temperature, double* ceq, const int maxits, const bool verbose)
{
return false;
}

//=======================================================================

void QuadraticFreeEnergyFunctionsBinaryThreePhase::computePhasesFreeEnergies(
const double temperature, const double* const hphi, const double conc,
double& fl, double& fa, double& fb)
Expand Down Expand Up @@ -178,6 +173,8 @@ int QuadraticFreeEnergyFunctionsBinaryThreePhase::computePhaseConcentrations(
const double temperature, const double* const conc, const double* const phi,
double* x)
{
(void)temperature;

const double hphi0 = interp_func(conc_interp_func_type_, phi[0]);
const double hphi1 = interp_func(conc_interp_func_type_, phi[1]);
const double hphi2 = interp_func(conc_interp_func_type_, phi[2]);
Expand Down Expand Up @@ -206,33 +203,6 @@ int QuadraticFreeEnergyFunctionsBinaryThreePhase::computePhaseConcentrations(
#pragma omp end declare target
#endif

//-----------------------------------------------------------------------
void QuadraticFreeEnergyFunctionsBinaryThreePhase::energyVsPhiAndC(
const double temperature, const double* const ceq, const bool found_ceq,
const double phi_well_scale, const int npts_phi, const int npts_c)
{
// Not implemented because it is ill-defined for a three-phase system.
}

// Print out free energy as a function of phase
// for given composition and temperature
// File format: ASCII VTK, readble with Visit
void QuadraticFreeEnergyFunctionsBinaryThreePhase::printEnergyVsPhiHeader(
const double temperature, const int nphi, const int nc, const double cmin,
const double cmax, const double slopec, std::ostream& os) const
{
// Not implemented because it is ill-defined for a three-phase system
}

//=======================================================================
void QuadraticFreeEnergyFunctionsBinaryThreePhase::printEnergyVsPhi(
const double* const conc, const double temperature,
const double phi_well_scale, const int npts, const double slopec,
std::ostream& os)
{
// Not implemented because it is ill-defined for a three-phase system
}

//=======================================================================
// compute free energy in [J/mol]

Expand Down Expand Up @@ -318,11 +288,4 @@ void QuadraticFreeEnergyFunctionsBinaryThreePhase::printEnergyVsComposition(
os << conc << "\t" << e << std::endl;
}
}

//=======================================================================

void QuadraticFreeEnergyFunctionsBinaryThreePhase::preRunDiagnostics(
const double T0, const double T1)
{
}
}
Loading

0 comments on commit 71b2693

Please sign in to comment.