Skip to content

Commit

Permalink
Add tool to plot E vs. c for 3 phases (#16)
Browse files Browse the repository at this point in the history
Make plotEnergyVsCompositionThreePhase more flexible
  • Loading branch information
jeanlucf22 authored Apr 5, 2022
1 parent 388620a commit 2c7b7c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/plotEnergyVsCompositionThreePhase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ namespace pt = boost::property_tree;

int main(int argc, char* argv[])
{
std::string databasename(argv[1]);

Thermo4PFM::EnergyInterpolationType energy_interp_func_type
= Thermo4PFM::EnergyInterpolationType::PBG;
Thermo4PFM::ConcInterpolationType conc_interp_func_type
Expand All @@ -18,11 +20,11 @@ int main(int argc, char* argv[])
// Cannot be 0 as it would trigger nans in f(T) evaluations
double temperature = 1.e-8;

std::cout << " Read CALPHAD database..." << std::endl;
std::cout << " Read CALPHAD database " << databasename << std::endl;
pt::ptree calphad_db;
try
{
pt::read_json("../thermodynamic_data/calphad3phases.json", calphad_db);
pt::read_json(databasename, calphad_db);
}
catch (std::exception& e)
{
Expand Down
12 changes: 12 additions & 0 deletions utils/FvsCbinaryThreePhases.plt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set terminal png
set pointsize 2
set size 0.7,0.7

set output "FvsC.png"
set xlabel "Composition"
set ylabel "Energy (J/mol)"

plot 'FvsC.dat' i 0 u 1:2 t 'phase 1' w lines lw 2, \
'FvsC.dat' i 1 u 1:2 t 'phase 2' w lines lw 2, \
'FvsC.dat' i 2 u 1:2 t 'phase 3' w lines lw 2

0 comments on commit 2c7b7c1

Please sign in to comment.