Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class CParallelDataSorter{
nRecvs; //!< Number of receives

vector<string> fieldNames; //!< Vector with names of all the output fields
vector<string> requiredFieldNames; //!< Vector with names of the required output fields that we write to file

unsigned short nDim; //!< Spatial dimension of the data

Expand Down Expand Up @@ -340,6 +341,22 @@ class CParallelDataSorter{
return fieldNames;
}

/*!
* \brief Get the vector containing the names of the required output fields
* \return Vector of strings containing the required field names
*/
const vector<string>& GetRequiredFieldNames() const{
return requiredFieldNames;
}

/*!
* \brief Set the vector of required output fields.
* \return None.
*/
void SetRequiredFieldNames(const vector<string>& req_field_names) {
requiredFieldNames = req_field_names;
}

/*!
* \brief Get the spatial dimension
* \return The spatial dimension
Expand Down
10 changes: 8 additions & 2 deletions SU2_CFD/src/output/COutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
if (!config->GetWrt_Surface_Overwrite())
filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter);

/*--- If we have compact restarts, we use only the required fields. ---*/
if (config->GetWrt_Restart_Compact())
surfaceDataSorter->SetRequiredFieldNames(requiredVolumeFieldNames);

surfaceDataSorter->SortConnectivity(config, geometry);
surfaceDataSorter->SortOutputData();

Expand All @@ -431,8 +435,9 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form

LogOutputFiles("SU2 ASCII restart");

/*--- If we have compact restarts, we use only the required fields. ---*/
if (config->GetWrt_Restart_Compact()) {
/*--- If we have compact restarts, we use only the required fields. ---*/
volumeDataSorterCompact->SetRequiredFieldNames(requiredVolumeFieldNames);
fileWriter = new CSU2FileWriter(volumeDataSorterCompact);
} else {
fileWriter = new CSU2FileWriter(volumeDataSorter);
Expand All @@ -451,8 +456,9 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form
filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter);

LogOutputFiles("SU2 binary restart");
/*--- If we have compact restarts, we use only the required fields. ---*/
if (config->GetWrt_Restart_Compact()) {
/*--- If we have compact restarts, we use only the required fields. ---*/
volumeDataSorterCompact->SetRequiredFieldNames(requiredVolumeFieldNames);
fileWriter = new CSU2BinaryFileWriter(volumeDataSorterCompact);
} else {
fileWriter = new CSU2BinaryFileWriter(volumeDataSorter);
Expand Down
3 changes: 2 additions & 1 deletion SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
CParallelDataSorter::CParallelDataSorter(CConfig *config, const vector<string> &valFieldNames) :
rank(SU2_MPI::GetRank()),
size(SU2_MPI::GetSize()),
fieldNames(valFieldNames) {
fieldNames(valFieldNames),
requiredFieldNames(valFieldNames) {

GlobalField_Counter = fieldNames.size();

Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void CSU2BinaryFileWriter::WriteData(string val_filename){

unsigned short iVar;

const vector<string>& fieldNames = dataSorter->GetFieldNames();
const vector<string>& fieldNames = dataSorter->GetRequiredFieldNames();
unsigned short nVar = fieldNames.size();
unsigned long nParallel_Poin = dataSorter->GetnPoints();
unsigned long nPoint_Global = dataSorter->GetnPointsGlobal();
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CSU2FileWriter::CSU2FileWriter(CParallelDataSorter *valDataSorter) :
void CSU2FileWriter::WriteData(string val_filename){

ofstream restart_file;
const vector<string>& fieldNames = dataSorter->GetFieldNames();
const vector<string> fieldNames = dataSorter->GetRequiredFieldNames();

/*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/
val_filename.append(fileExt);
Expand Down
17 changes: 0 additions & 17 deletions TestCases/parallel_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -1750,23 +1750,6 @@ def main():
species2_primitiveVenturi.test_vals = [-5.470699, -4.435379, -4.486544, -5.327925, -0.866369, -5.623281, 5.000000, -0.557915, 5.000000, -2.599732, 5.000000, -0.536608, 0.000037, 0.000037, 0.000000, 0.000000]
test_list.append(species2_primitiveVenturi)

# Compact restart check. The case above writes a compact ASCII and binary restart file at
# iteration 49, holding the solution that enters iteration 50. The first iteration of these
# restarted runs must therefore reproduce its iteration 50, so they share its test values.
species2_compact_restart_ascii = TestCase('species2_primitiveVenturi_compact_restart_read_ascii')
species2_compact_restart_ascii.cfg_dir = "species_transport/venturi_primitive_3species"
species2_compact_restart_ascii.cfg_file = "species2_primitiveVenturi_compact_restart_read_ascii.cfg"
species2_compact_restart_ascii.test_iter = 0
species2_compact_restart_ascii.test_vals = species2_primitiveVenturi.test_vals
test_list.append(species2_compact_restart_ascii)

species2_compact_restart_binary = TestCase('species2_primitiveVenturi_compact_restart_read_binary')
species2_compact_restart_binary.cfg_dir = "species_transport/venturi_primitive_3species"
species2_compact_restart_binary.cfg_file = "species2_primitiveVenturi_compact_restart_read_binary.cfg"
species2_compact_restart_binary.test_iter = 0
species2_compact_restart_binary.test_vals = species2_primitiveVenturi.test_vals
test_list.append(species2_compact_restart_binary)

# 2 species (1 eq) primitive venturi mixing with bounded scalar transport
species_primitiveVenturi_boundedscalar = TestCase('species2_primitiveVenturi_bounded_scalar')
species_primitiveVenturi_boundedscalar.cfg_dir = "species_transport/venturi_primitive_3species"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ t
4. Adjoint simulation with 1 timestep, using the primal restart file from simulation in 2nd step. The printed direct residuals are taken for comparison


- `species2_primitiveVenturi_compact_restart_read_ascii.cfg` and `species2_primitiveVenturi_compact_restart_read_binary.cfg` check that compact restart files (`WRT_RESTART_COMPACT= YES`) are written and read correctly.
They restart from the files that `species2_venturiPrimitive.cfg` writes at iteration 49 (`WRT_RESTART_OVERWRITE= NO` with `OUTPUT_WRT_FREQ= 49, 49, 1000`), which hold the solution that enters iteration 50.
Their first iteration must therefore reproduce the residuals of iteration 50 of that case, and the regression test uses its values for all three cases.
`VOLUME_OUTPUT` contains fields outside the compact set, which is the situation in which the compact writers can shift the restart columns.


- `species3_venturiPrimitive_inletFile.cfg` With the `test_inlet_files.sh` a simple sanity check for inlet files is performed.
SU2 writes an `example_inlet_file.dat` when the specified inlet file is not available, with the values of the specified `MARKER_INLET` content.
Therefore comparing a simulation with this example inlet file and without inlet files should result in exactly the same results.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,9 @@ SCREEN_WRT_FREQ_INNER= 10
HISTORY_OUTPUT= RMS_RES FLOW_COEFF LINSOL SPECIES_COEFF SPECIES_COEFF_SURF
MARKER_ANALYZE= outlet gas_inlet air_axial_inlet
%
% The restart files written at iteration 49 hold the solution that enters
% iteration 50 and are the starting point of the compact restart checks in
% species2_primitiveVenturi_compact_restart_read_ascii.cfg and
% species2_primitiveVenturi_compact_restart_read_binary.cfg.
OUTPUT_FILES= RESTART_ASCII, RESTART, PARAVIEW_MULTIBLOCK
OUTPUT_FILES= RESTART_ASCII, PARAVIEW_MULTIBLOCK
VOLUME_OUTPUT= RESIDUAL, PRIMITIVE
WRT_RESTART_COMPACT= YES
WRT_RESTART_OVERWRITE= NO
OUTPUT_WRT_FREQ= 49, 49, 1000
OUTPUT_WRT_FREQ= 1000
%
RESTART_SOL= NO
SOLUTION_FILENAME= solution
Expand Down

This file was deleted.

Loading
Loading