void FeatureVolumeFraction::execute() { Real volume = 0.0; //sum the values in the vector to get total volume for (const auto & feature_volume : _feature_volumes) volume += feature_volume; mooseAssert(!MooseUtils::absoluteFuzzyEqual(_mesh_volume, 0.0), "Mesh volume is zero"); _volume_fraction = volume / _mesh_volume; _avrami_value = calculateAvramiValue(); }
void FeatureVolumeFraction::finalize() { FeatureFloodCount::finalize(); mooseAssert(!_all_feature_volumes.empty(), "All feature volumes should not be empty()"); calculateBubbleFraction(); // Now calculate the Avrami data if requested if (_pars.isParamValid("Avrami_file")) { // Output the headers during the first timestep if (_fe_problem.timeStep() == 0) { std::vector<std::string> data = {"timestep", "time", "log_time", "Avrami"}; writeCSVFile(getParam<FileName>("Avrami_file"), data); } else { std::vector<Real> data = {Real(_fe_problem.timeStep()), _fe_problem.time(), std::log(_fe_problem.time()), calculateAvramiValue()}; writeCSVFile(getParam<FileName>("Avrami_file"), data); } } }