@@ -1149,14 +1149,14 @@ namespace aspect
1149
1149
const double pressure_,
1150
1150
const double depth_,
1151
1151
const double pressure_depth_derivative_,
1152
- const unsigned int phase_index_ )
1152
+ const unsigned int phase_transition_index_ )
1153
1153
1154
1154
:
1155
1155
temperature (temperature_),
1156
1156
pressure(pressure_),
1157
1157
depth(depth_),
1158
1158
pressure_depth_derivative(pressure_depth_derivative_),
1159
- phase_index(phase_index_ )
1159
+ phase_transition_index(phase_transition_index_ )
1160
1160
{}
1161
1161
1162
1162
@@ -1208,7 +1208,7 @@ namespace aspect
1208
1208
unsigned int n_comp = 0 ;
1209
1209
for (unsigned int n_relevant_fields = 0 ; n_relevant_fields < this ->introspection ().n_chemical_composition_fields () + 1 ; n_relevant_fields ++)
1210
1210
{
1211
- if (in.phase_index < start_phase_transition_index + n_phase_transitions_per_chemical_composition[n_relevant_fields])
1211
+ if (in.phase_transition_index < start_phase_transition_index + n_phase_transitions_per_chemical_composition[n_relevant_fields])
1212
1212
{
1213
1213
n_comp = n_relevant_fields ;
1214
1214
break ;
@@ -1246,7 +1246,7 @@ namespace aspect
1246
1246
}
1247
1247
1248
1248
// determine the value of phase function to facilitate the exact transition
1249
- if ((matched_phase_transition_index != numbers::invalid_unsigned_int) && in.phase_index <= matched_phase_transition_index)
1249
+ if ((matched_phase_transition_index != numbers::invalid_unsigned_int) && in.phase_transition_index <= matched_phase_transition_index)
1250
1250
function_value = 1.0 ;
1251
1251
else
1252
1252
function_value = 0.0 ;
@@ -1424,13 +1424,13 @@ namespace aspect
1424
1424
double
1425
1425
PhaseFunction<dim>::compute_value (const PhaseFunctionInputs<dim> &in) const
1426
1426
{
1427
- AssertIndexRange (in.phase_index , transition_temperature_lower_limits.size ());
1428
- AssertIndexRange (in.phase_index , transition_temperature_upper_limits.size ());
1427
+ AssertIndexRange (in.phase_transition_index , transition_temperature_lower_limits.size ());
1428
+ AssertIndexRange (in.phase_transition_index , transition_temperature_upper_limits.size ());
1429
1429
1430
1430
// the percentage of material that has undergone the transition
1431
1431
double function_value;
1432
- if (in.temperature < transition_temperature_lower_limits[in.phase_index ] ||
1433
- in.temperature >= transition_temperature_upper_limits[in.phase_index ])
1432
+ if (in.temperature < transition_temperature_lower_limits[in.phase_transition_index ] ||
1433
+ in.temperature >= transition_temperature_upper_limits[in.phase_transition_index ])
1434
1434
{
1435
1435
// assign 0.0 if temperature is out of range
1436
1436
function_value = 0.0 ;
@@ -1439,40 +1439,40 @@ namespace aspect
1439
1439
{
1440
1440
if (use_depth_instead_of_pressure)
1441
1441
{
1442
- AssertIndexRange (in.phase_index , transition_depths.size ());
1442
+ AssertIndexRange (in.phase_transition_index , transition_depths.size ());
1443
1443
1444
1444
// calculate the deviation from the transition point (convert temperature to depth)
1445
- double depth_deviation = in.depth - transition_depths[in.phase_index ];
1445
+ double depth_deviation = in.depth - transition_depths[in.phase_transition_index ];
1446
1446
1447
1447
if (in.pressure_depth_derivative != 0.0 )
1448
1448
{
1449
- AssertIndexRange (in.phase_index , transition_slopes.size ());
1450
- AssertIndexRange (in.phase_index , transition_temperatures.size ());
1449
+ AssertIndexRange (in.phase_transition_index , transition_slopes.size ());
1450
+ AssertIndexRange (in.phase_transition_index , transition_temperatures.size ());
1451
1451
1452
- depth_deviation -= transition_slopes[in.phase_index ] / in.pressure_depth_derivative
1453
- * (in.temperature - transition_temperatures[in.phase_index ]);
1452
+ depth_deviation -= transition_slopes[in.phase_transition_index ] / in.pressure_depth_derivative
1453
+ * (in.temperature - transition_temperatures[in.phase_transition_index ]);
1454
1454
}
1455
1455
1456
1456
// use delta function for width = 0
1457
- AssertIndexRange (in.phase_index , transition_widths.size ());
1458
- if (transition_widths[in.phase_index ] == 0 )
1457
+ AssertIndexRange (in.phase_transition_index , transition_widths.size ());
1458
+ if (transition_widths[in.phase_transition_index ] == 0 )
1459
1459
function_value = (depth_deviation > 0 ) ? 1 . : 0 .;
1460
1460
else
1461
- function_value = 0.5 *(1.0 + std::tanh (depth_deviation / transition_widths[in.phase_index ]));
1461
+ function_value = 0.5 *(1.0 + std::tanh (depth_deviation / transition_widths[in.phase_transition_index ]));
1462
1462
}
1463
1463
else
1464
1464
{
1465
1465
// calculate the deviation from the transition point (convert temperature to pressure)
1466
- AssertIndexRange (in.phase_index , transition_pressures.size ());
1467
- const double pressure_deviation = in.pressure - transition_pressures[in.phase_index ]
1468
- - transition_slopes[in.phase_index ] * (in.temperature - transition_temperatures[in.phase_index ]);
1466
+ AssertIndexRange (in.phase_transition_index , transition_pressures.size ());
1467
+ const double pressure_deviation = in.pressure - transition_pressures[in.phase_transition_index ]
1468
+ - transition_slopes[in.phase_transition_index ] * (in.temperature - transition_temperatures[in.phase_transition_index ]);
1469
1469
1470
1470
// use delta function for width = 0
1471
- AssertIndexRange (in.phase_index , transition_pressure_widths.size ());
1472
- if (transition_pressure_widths[in.phase_index ] == 0 )
1471
+ AssertIndexRange (in.phase_transition_index , transition_pressure_widths.size ());
1472
+ if (transition_pressure_widths[in.phase_transition_index ] == 0 )
1473
1473
function_value = (pressure_deviation > 0 ) ? 1 . : 0 .;
1474
1474
else
1475
- function_value = 0.5 *(1.0 + std::tanh (pressure_deviation / transition_pressure_widths[in.phase_index ]));
1475
+ function_value = 0.5 *(1.0 + std::tanh (pressure_deviation / transition_pressure_widths[in.phase_transition_index ]));
1476
1476
}
1477
1477
}
1478
1478
@@ -1499,30 +1499,30 @@ namespace aspect
1499
1499
// phase transition based on depth
1500
1500
if (use_depth_instead_of_pressure)
1501
1501
{
1502
- const Point<dim,double > transition_point = this ->get_geometry_model ().representative_point (transition_depths[in.phase_index ]);
1503
- const Point<dim,double > transition_plus_width = this ->get_geometry_model ().representative_point (transition_depths[in.phase_index ] + transition_widths[in.phase_index ]);
1504
- const Point<dim,double > transition_minus_width = this ->get_geometry_model ().representative_point (transition_depths[in.phase_index ] - transition_widths[in.phase_index ]);
1502
+ const Point<dim,double > transition_point = this ->get_geometry_model ().representative_point (transition_depths[in.phase_transition_index ]);
1503
+ const Point<dim,double > transition_plus_width = this ->get_geometry_model ().representative_point (transition_depths[in.phase_transition_index ] + transition_widths[in.phase_transition_index ]);
1504
+ const Point<dim,double > transition_minus_width = this ->get_geometry_model ().representative_point (transition_depths[in.phase_transition_index ] - transition_widths[in.phase_transition_index ]);
1505
1505
transition_pressure = this ->get_adiabatic_conditions ().pressure (transition_point);
1506
1506
pressure_width = 0.5 * (this ->get_adiabatic_conditions ().pressure (transition_plus_width)
1507
1507
- this ->get_adiabatic_conditions ().pressure (transition_minus_width));
1508
- width_temp = transition_widths[in.phase_index ];
1508
+ width_temp = transition_widths[in.phase_transition_index ];
1509
1509
}
1510
1510
// using pressure instead of depth to define the phase transition
1511
1511
else
1512
1512
{
1513
- transition_pressure = transition_pressures[in.phase_index ];
1514
- pressure_width = transition_pressure_widths[in.phase_index ];
1515
- width_temp = transition_pressure_widths[in.phase_index ];
1513
+ transition_pressure = transition_pressures[in.phase_transition_index ];
1514
+ pressure_width = transition_pressure_widths[in.phase_transition_index ];
1515
+ width_temp = transition_pressure_widths[in.phase_transition_index ];
1516
1516
}
1517
1517
1518
1518
// calculate the deviation from the transition point
1519
1519
const double pressure_deviation = in.pressure - transition_pressure
1520
- - transition_slopes[in.phase_index ] * (in.temperature - transition_temperatures[in.phase_index ]);
1520
+ - transition_slopes[in.phase_transition_index ] * (in.temperature - transition_temperatures[in.phase_transition_index ]);
1521
1521
1522
1522
// calculate the analytical derivative of the phase function
1523
1523
if (
1524
- (in.temperature < transition_temperature_lower_limits[in.phase_index ]) ||
1525
- (in.temperature >= transition_temperature_upper_limits[in.phase_index ])
1524
+ (in.temperature < transition_temperature_lower_limits[in.phase_transition_index ]) ||
1525
+ (in.temperature >= transition_temperature_upper_limits[in.phase_transition_index ])
1526
1526
)
1527
1527
{
1528
1528
// return 0 if temperature is out of range
@@ -1609,19 +1609,19 @@ namespace aspect
1609
1609
template <int dim>
1610
1610
double
1611
1611
PhaseFunction<dim>::
1612
- get_transition_slope (const unsigned int phase_index ) const
1612
+ get_transition_slope (const unsigned int phase_transition_index ) const
1613
1613
{
1614
- return transition_slopes[phase_index ];
1614
+ return transition_slopes[phase_transition_index ];
1615
1615
}
1616
1616
1617
1617
1618
1618
1619
1619
template <int dim>
1620
1620
double
1621
1621
PhaseFunction<dim>::
1622
- get_transition_depth (const unsigned int phase_index ) const
1622
+ get_transition_depth (const unsigned int phase_transition_index ) const
1623
1623
{
1624
- return transition_depths[phase_index ];
1624
+ return transition_depths[phase_transition_index ];
1625
1625
}
1626
1626
1627
1627
0 commit comments