Cover both density mass and EOS source in closure quadrature

This commit is contained in:
2026-09-19 10:47:58 -04:00
parent d6554cae6b
commit dd955abca5
8 changed files with 98 additions and 14 deletions

View File

@@ -238,12 +238,19 @@ inline NegativeDensityProjectionReport MeasureNegativeDensityProjection(
const mfem::IntegrationRule* rule = nullptr;
int resolvedOrder = control.quadratureOrder;
if (control.productionQuadrature) {
// PreparedBarotropicClosureOperator uses this source query for
// both rho*q and rho(h)*q, not the separate legacy mass query.
// Reproduce the shared production rule, including the density
// mass degree when it exceeds the nonlinear source degree.
const auto query = field::Field<field::Enthalpy>::make_query<field::Enthalpy::Form::EosClosureSource>(
quadrature::QuadratureRole::discretization, transformation->OrderW(), std::array<int, 1>{extraOrder},
utils::DOMAINS::STELLAR, quadrature::MappingKind::general);
const auto resolution = fem.quadratureFactory->get(query, transformation->GetGeometryType());
const auto sourceResolution = fem.quadratureFactory->get(query, transformation->GetGeometryType());
const auto massQuery = field::Field<field::Density>::make_query<field::Density::Form::EosClosureMass>(
quadrature::QuadratureRole::discretization, transformation->OrderW(), {},
utils::DOMAINS::STELLAR, quadrature::MappingKind::general);
const auto massResolution = fem.quadratureFactory->get(massQuery, transformation->GetGeometryType());
const auto &resolution = sourceResolution.resolution.order >= massResolution.resolution.order
? sourceResolution
: massResolution;
rule = resolution.integration_rule;
resolvedOrder = resolution.resolution.order;
} else {