Expose Solid summary interfaces
This commit is contained in:
@@ -63,6 +63,9 @@ int main(void)
|
||||
double explosive_release_mass_values[4] = {0.0, 0.0, 0.0, 0.0};
|
||||
double explosive_release_energy_values[2] = {0.0, 0.0};
|
||||
double explosive_release_momentum_values[3] = {0.0, 0.0, 0.0};
|
||||
int solid_active_count = 0;
|
||||
int solid_failed_count = 0;
|
||||
double solid_values[SPHLITE_SOLID_SUMMARY_VALUE_COUNT] = {0.0};
|
||||
|
||||
if (SPHLITE_PHASE_SOLID != 4 || SPHLITE_PHASE_GAS != 2 ||
|
||||
SPHLITE_STATUS_ACTIVE != 0) {
|
||||
@@ -138,10 +141,26 @@ int main(void)
|
||||
explosive_release_energy_values, NULL) != -1) {
|
||||
return fail("null explosive release momentum pointer did not return -1");
|
||||
}
|
||||
if (sphlite_get_solid_summary(NULL, &solid_failed_count, solid_values,
|
||||
SPHLITE_SOLID_SUMMARY_VALUE_COUNT) != -1) {
|
||||
return fail("null Solid active-count pointer did not return -1");
|
||||
}
|
||||
if (sphlite_get_solid_summary(&solid_active_count, &solid_failed_count, NULL,
|
||||
SPHLITE_SOLID_SUMMARY_VALUE_COUNT) != -1) {
|
||||
return fail("null Solid summary values pointer did not return -1");
|
||||
}
|
||||
if (sphlite_get_solid_summary(&solid_active_count, &solid_failed_count,
|
||||
solid_values, SPHLITE_SOLID_SUMMARY_VALUE_COUNT - 1) != -1) {
|
||||
return fail("small Solid summary capacity did not return -1");
|
||||
}
|
||||
if (sphlite_get_gas_summary(&gas_volume, gas_center, &gas_mean_pressure,
|
||||
&gas_max_pressure) != 2) {
|
||||
return fail("uninitialized gas summary did not return Fortran state error");
|
||||
}
|
||||
if (sphlite_get_solid_summary(&solid_active_count, &solid_failed_count,
|
||||
solid_values, SPHLITE_SOLID_SUMMARY_VALUE_COUNT) != 2) {
|
||||
return fail("uninitialized Solid summary did not return Fortran state error");
|
||||
}
|
||||
|
||||
ierr = sphlite_initialize();
|
||||
if (ierr != 0) return fail("initialize failed");
|
||||
@@ -154,6 +173,9 @@ int main(void)
|
||||
if (ierr != 2) return fail("unbuilt gas summary did not return Fortran state error");
|
||||
ierr = sphlite_get_gas_dt_limits(&dt_cfl, &dt_accel, &gas_dtcrit);
|
||||
if (ierr != 2) return fail("unbuilt gas dt did not return Fortran state error");
|
||||
ierr = sphlite_get_solid_summary(&solid_active_count, &solid_failed_count,
|
||||
solid_values, SPHLITE_SOLID_SUMMARY_VALUE_COUNT);
|
||||
if (ierr != 2) return fail("unbuilt Solid summary did not return Fortran state error");
|
||||
|
||||
ierr = sphlite_get_version(&major, &minor, &patch);
|
||||
if (ierr != 0) return fail("get_version failed");
|
||||
@@ -184,6 +206,17 @@ int main(void)
|
||||
return fail("particle state content mismatch");
|
||||
}
|
||||
|
||||
ierr = sphlite_get_solid_summary(&solid_active_count, &solid_failed_count,
|
||||
solid_values, SPHLITE_SOLID_SUMMARY_VALUE_COUNT);
|
||||
if (ierr != 0) return fail("Solid summary query failed");
|
||||
if (solid_active_count != 4 || solid_failed_count != 0 ||
|
||||
solid_values[0] <= 0.0) {
|
||||
return fail("Solid summary content mismatch");
|
||||
}
|
||||
if (solid_values[13] <= 0.0 || solid_values[15] <= 0.0) {
|
||||
return fail("Solid dt summary content mismatch");
|
||||
}
|
||||
|
||||
if (sphlite_get_particle_state(4, NULL, phase, status, material_id, section_id,
|
||||
x, v, a, rho, pressure, internal_energy, temperature, h, &count) != -1) {
|
||||
return fail("null particle-state array did not return -1");
|
||||
|
||||
Reference in New Issue
Block a user