diff --git a/drivers/computeTieLineTernary.cc b/drivers/computeTieLineTernary.cc index 0d78d3f..cf51c5a 100644 --- a/drivers/computeTieLineTernary.cc +++ b/drivers/computeTieLineTernary.cc @@ -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 diff --git a/drivers/loopCALPHADConcSolverBinary.cc b/drivers/loopCALPHADConcSolverBinary.cc index 8df2138..19114af 100644 --- a/drivers/loopCALPHADConcSolverBinary.cc +++ b/drivers/loopCALPHADConcSolverBinary.cc @@ -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 diff --git a/drivers/loopCALPHADSpeciesPhaseGibbsEnergy.cc b/drivers/loopCALPHADSpeciesPhaseGibbsEnergy.cc index c14f30c..188119d 100644 --- a/drivers/loopCALPHADSpeciesPhaseGibbsEnergy.cc +++ b/drivers/loopCALPHADSpeciesPhaseGibbsEnergy.cc @@ -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; diff --git a/drivers/loopCALPHADbinaryKKS.cc b/drivers/loopCALPHADbinaryKKS.cc index 1c78563..60b0c80 100644 --- a/drivers/loopCALPHADbinaryKKS.cc +++ b/drivers/loopCALPHADbinaryKKS.cc @@ -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; diff --git a/drivers/loopDeterminant.cc b/drivers/loopDeterminant.cc index 76a469c..8e74014 100644 --- a/drivers/loopDeterminant.cc +++ b/drivers/loopDeterminant.cc @@ -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; diff --git a/drivers/loopxlogx.cc b/drivers/loopxlogx.cc index 8457b51..6f87918 100644 --- a/drivers/loopxlogx.cc +++ b/drivers/loopxlogx.cc @@ -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; diff --git a/drivers/plotEnergyVsComposition.cc b/drivers/plotEnergyVsComposition.cc index 7330338..add31e5 100644 --- a/drivers/plotEnergyVsComposition.cc +++ b/drivers/plotEnergyVsComposition.cc @@ -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]); diff --git a/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.cc b/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.cc index ca9554f..3ded5ab 100644 --- a/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.cc +++ b/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.cc @@ -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] diff --git a/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.h b/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.h index c63b2d6..75fd493 100644 --- a/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.h +++ b/src/CALPHADFreeEnergyFunctionsBinary3Ph2Sl.h @@ -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, diff --git a/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.cc b/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.cc index c4e7c65..6b00687 100644 --- a/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.cc +++ b/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.cc @@ -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) @@ -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] diff --git a/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.h b/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.h index 8c3eeff..02ac097 100644 --- a/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.h +++ b/src/CALPHADFreeEnergyFunctionsBinaryThreePhase.h @@ -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, diff --git a/src/KKSFreeEnergyFunctionDiluteBinary.cc b/src/KKSFreeEnergyFunctionDiluteBinary.cc index ea0ba7a..119d7e9 100644 --- a/src/KKSFreeEnergyFunctionDiluteBinary.cc +++ b/src/KKSFreeEnergyFunctionDiluteBinary.cc @@ -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.); @@ -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()" diff --git a/src/KKSFreeEnergyFunctionDiluteBinary.h b/src/KKSFreeEnergyFunctionDiluteBinary.h index e3d1a8e..70a4a6e 100644 --- a/src/KKSFreeEnergyFunctionDiluteBinary.h +++ b/src/KKSFreeEnergyFunctionDiluteBinary.h @@ -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); diff --git a/src/QuadraticConcSolverBinaryThreePhase.cc b/src/QuadraticConcSolverBinaryThreePhase.cc index 4574ad3..97dd6f8 100644 --- a/src/QuadraticConcSolverBinaryThreePhase.cc +++ b/src/QuadraticConcSolverBinaryThreePhase.cc @@ -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_; diff --git a/src/QuadraticFreeEnergyFunctionsBinary.cc b/src/QuadraticFreeEnergyFunctionsBinary.cc index 05b2e52..c9349ea 100644 --- a/src/QuadraticFreeEnergyFunctionsBinary.cc +++ b/src/QuadraticFreeEnergyFunctionsBinary.cc @@ -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) { @@ -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_; @@ -338,11 +344,4 @@ void QuadraticFreeEnergyFunctionsBinary::printEnergyVsComposition( } os << std::endl << std::endl; } - -//======================================================================= - -void QuadraticFreeEnergyFunctionsBinary::preRunDiagnostics( - const double T0, const double T1) -{ -} } diff --git a/src/QuadraticFreeEnergyFunctionsBinary.h b/src/QuadraticFreeEnergyFunctionsBinary.h index 91c856f..5d0d4cc 100644 --- a/src/QuadraticFreeEnergyFunctionsBinary.h +++ b/src/QuadraticFreeEnergyFunctionsBinary.h @@ -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, diff --git a/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.cc b/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.cc index 3faa829..295ba0e 100644 --- a/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.cc +++ b/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.cc @@ -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; @@ -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) { @@ -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) @@ -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]); @@ -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] @@ -318,11 +288,4 @@ void QuadraticFreeEnergyFunctionsBinaryThreePhase::printEnergyVsComposition( os << conc << "\t" << e << std::endl; } } - -//======================================================================= - -void QuadraticFreeEnergyFunctionsBinaryThreePhase::preRunDiagnostics( - const double T0, const double T1) -{ -} } diff --git a/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.h b/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.h index 304a41a..22aad0e 100644 --- a/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.h +++ b/src/QuadraticFreeEnergyFunctionsBinaryThreePhase.h @@ -37,27 +37,12 @@ class QuadraticFreeEnergyFunctionsBinaryThreePhase 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); private: double Al_; diff --git a/src/QuadraticFreeEnergyFunctionsTernaryThreePhase.cc b/src/QuadraticFreeEnergyFunctionsTernaryThreePhase.cc index 15bd9a8..85e43af 100644 --- a/src/QuadraticFreeEnergyFunctionsTernaryThreePhase.cc +++ b/src/QuadraticFreeEnergyFunctionsTernaryThreePhase.cc @@ -84,6 +84,8 @@ void QuadraticFreeEnergyFunctionsTernaryThreePhase::computeDerivFreeEnergy( const double temperature, const double* const conc, const PhaseIndex pi, double* deriv) { + (void)temperature; + const double* A; const double* ceq; @@ -115,6 +117,9 @@ void QuadraticFreeEnergyFunctionsTernaryThreePhase:: computeSecondDerivativeFreeEnergy(const double temp, const double* const conc, const PhaseIndex pi, double* d2fdc2) { + (void)temp; + (void)conc; + const double* A; switch (pi) @@ -166,7 +171,7 @@ void QuadraticFreeEnergyFunctionsTernaryThreePhase::computePhasesFreeEnergies( fa = computeFreeEnergy(temperature, &conca[0], PhaseIndex::phaseA, false); double concb[2] = { cauxilliary0[2], cauxilliary1[2] }; - fb = computeFreeEnergy(temperature, &concb[2], PhaseIndex::phaseB, false); + fb = computeFreeEnergy(temperature, &concb[0], PhaseIndex::phaseB, false); } //----------------------------------------------------------------------- @@ -175,6 +180,8 @@ int QuadraticFreeEnergyFunctionsTernaryThreePhase::computePhaseConcentrations( const double temperature, const double* const conc, const double* const hphi, double* x) { + (void)temperature; + // solve two binary problems QuadraticConcSolverBinaryThreePhase solver0; solver0.setup(conc[0], hphi[0], hphi[1], hphi[2], Al_[0], ceql_[0], Aa_[0], diff --git a/src/functions.cc b/src/functions.cc index 2bd27a0..d954ddc 100644 --- a/src/functions.cc +++ b/src/functions.cc @@ -67,7 +67,11 @@ double second_deriv_harmonic_interp_func(const double phi) return 6. * (1. - 2. * phit); } -double second_deriv_linear_interp_func(const double phi) { return 0.; } +double second_deriv_linear_interp_func(const double phi) +{ + (void)phi; + return 0.; +} #ifdef HAVE_OPENMP_OFFLOAD #pragma omp end declare target #endif