Skip to content
Snippets Groups Projects

Issue/mesh data

3 files
+ 20
20
Compare changes
  • Side-by-side
  • Inline

Files

  • f38904e3
    Fix MeshData and MeshDataManager · f38904e3
    Stéphane Del Pino authored
    MeshData constructor can now only be called by MeshDataManager! This
    ensures only one construction of the data storage for each mesh
    
    Also fix following issues
    - volume calculation and checking was dangerously nested
    - few iterators were poorly named (due to copy/paste in MeshDataManager)
@@ -116,7 +116,7 @@ struct GlaceScheme
UnknownsType unknowns(*m_mesh);
{
MeshDataType mesh_data(*m_mesh);
MeshDataType& mesh_data = MeshDataManager::instance().getMeshData(*m_mesh);
unknowns.rhoj() =
InterpolateItemValue<double(TinyVector<Dimension>)>::template interpolate<ItemType::cell>(rho_id,
@@ -152,7 +152,7 @@ struct GlaceScheme
block_eos.updateEandCFromRhoP();
{
MeshDataType mesh_data(*m_mesh);
MeshDataType& mesh_data = MeshDataManager::instance().getMeshData(*m_mesh);
const CellValue<const double> Vj = mesh_data.Vj();
@@ -169,7 +169,7 @@ struct GlaceScheme
VTKWriter vtk_writer("mesh_" + std::to_string(Dimension), 0.01);
while ((t < tmax) and (iteration < itermax)) {
MeshDataType mesh_data(*m_mesh);
MeshDataType& mesh_data = MeshDataManager::instance().getMeshData(*m_mesh);
vtk_writer.write(m_mesh,
{NamedItemValue{"density", rhoj}, NamedItemValue{"velocity", unknowns.uj()},
@@ -198,7 +198,7 @@ struct GlaceScheme
<< rang::fgB::cyan << iteration << rang::style::reset << rang::style::bold << " iterations"
<< rang::style::reset << '\n';
{
MeshDataType mesh_data(*m_mesh);
MeshDataType& mesh_data = MeshDataManager::instance().getMeshData(*m_mesh);
vtk_writer.write(m_mesh,
{NamedItemValue{"density", rhoj}, NamedItemValue{"velocity", unknowns.uj()},
Loading