Skip to content
Snippets Groups Projects
Commit 284dba1c authored by Tom Fischer's avatar Tom Fischer
Browse files

[PL/SurfaceFlux] Rm unused method save, cleanup class.

parent 31fc2847
No related branches found
No related tags found
No related merge requests found
\ogs_missing_documentation
......@@ -16,8 +16,6 @@
#include "BaseLib/FileTools.h"
#include "BaseLib/Logging.h"
#include "MeshLib/IO/readMeshFromFile.h"
// TODO used for output, if output classes are ready this has to be changed
#include "MeshLib/IO/writeMeshToFile.h"
#include "ProcessLib/SurfaceFlux/SurfaceFlux.h"
......@@ -28,8 +26,7 @@ struct SurfaceFluxData
SurfaceFluxData(
std::string&& surfaceflux_mesh_name,
std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes,
std::string&& surfaceflux_property_vector_name,
std::string&& surfaceflux_output_mesh_file_name)
std::string&& surfaceflux_property_vector_name)
: surface_mesh(*BaseLib::findElementOrError(
meshes.begin(), meshes.end(),
[&surfaceflux_mesh_name](auto const& m) {
......@@ -38,14 +35,12 @@ struct SurfaceFluxData
"Expected to find a mesh named " + surfaceflux_mesh_name +
" for the surfaceflux calculation.")),
mesh_name(std::move(surfaceflux_mesh_name)),
property_vector_name(std::move(surfaceflux_property_vector_name)),
output_mesh_file_name(std::move(surfaceflux_output_mesh_file_name))
property_vector_name(std::move(surfaceflux_property_vector_name))
{
DBUG(
"read surfaceflux meta data:\n\tsurfaceflux "
"mesh:'{:s}'\n\tproperty "
"name: '{:s}'\n\toutput to: '{:s}'",
mesh_name, property_vector_name, output_mesh_file_name);
"Read surfaceflux meta data:\n\tmesh:'{:s}'\n\tproperty name: "
"'{:s}'\n",
mesh_name, property_vector_name);
}
static std::unique_ptr<ProcessLib::SurfaceFluxData> createSurfaceFluxData(
......@@ -60,20 +55,12 @@ struct SurfaceFluxData
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux__property_name}
calculatesurfaceflux_config.getConfigParameter<std::string>(
"property_name");
auto surfaceflux_out_fname =
//! \ogs_file_param{prj__processes__process__calculatesurfaceflux__output_mesh}
calculatesurfaceflux_config.getConfigParameter<std::string>(
"output_mesh");
if (mesh_name.empty())
{
return nullptr;
}
surfaceflux_out_fname = BaseLib::copyPathToFileName(
surfaceflux_out_fname, output_directory);
return std::make_unique<SurfaceFluxData>(
std::move(mesh_name), meshes, std::move(surfaceflux_pv_name),
std::move(surfaceflux_out_fname));
std::move(mesh_name), meshes, std::move(surfaceflux_pv_name));
}
void integrate(std::vector<GlobalVector*> const& x, double const t,
......@@ -100,20 +87,9 @@ struct SurfaceFluxData
});
}
void save(double const t) const
{
// TODO (TomFischer) output, if output classes are ready this has to be
// changed
std::string const fname =
BaseLib::dropFileExtension(output_mesh_file_name) + "_t_" +
std::to_string(t) + ".vtu";
MeshLib::IO::writeMeshToFile(surface_mesh, fname);
}
private:
MeshLib::Mesh& surface_mesh;
std::string const mesh_name;
std::string const property_vector_name;
std::string const output_mesh_file_name;
};
} // namespace ProcessLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment