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
2 changes: 1 addition & 1 deletion doc/source/tutorials/lbs/first/first_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
"source": [
"fflist = phys.GetScalarFieldFunctionList(only_scalar_flux=False)\n",
"vtk_basename = \"first_example\"\n",
"FieldFunctionGridBased.ExportMultipleToVTK(\n",
"FieldFunctionGridBased.ExportMultipleToPVTU(\n",
" [fflist[0][0]], # export only the flux of group 0 (first []), moment 0 (second [])\n",
" vtk_basename\n",
")"
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tutorials/lbs/mg_keigen/pincell_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@
"source": [
"fflist = phys.GetScalarFieldFunctionList()\n",
"vtk_basename = \"pin_cell\"\n",
"FieldFunctionGridBased.ExportMultipleToVTK([fflist[g] for g in range(num_groups)], vtk_basename)"
"FieldFunctionGridBased.ExportMultipleToPVTU([fflist[g] for g in range(num_groups)], vtk_basename)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tutorials/lbs/mg_src_driven/hdpe_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
"source": [
"fflist = phys.GetScalarFieldFunctionList(only_scalar_flux=True)\n",
"vtk_basename = \"hdpe_ex\"\n",
"FieldFunctionGridBased.ExportMultipleToVTK([fflist[g] for g in range(num_groups)], vtk_basename)"
"FieldFunctionGridBased.ExportMultipleToPVTU([fflist[g] for g in range(num_groups)], vtk_basename)"
]
},
{
Expand Down
9 changes: 0 additions & 9 deletions framework/field_functions/field_function_grid_based.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ FieldFunctionGridBased::ExportMultipleToPVTU(
auto ugrid = PrepareVtkUnstructuredGrid(grid);

// Upload cell/point data
auto cell_data = ugrid->GetCellData();
auto point_data = ugrid->GetPointData();
for (const auto& ff_ptr : ff_list)
{
Expand All @@ -264,10 +263,8 @@ FieldFunctionGridBased::ExportMultipleToPVTU(
component_name += unknown.component_names[c];

vtkNew<vtkDoubleArray> point_array;
vtkNew<vtkDoubleArray> cell_array;

point_array->SetName(component_name.c_str());
cell_array->SetName(component_name.c_str());

// Populate the array here
for (const auto& cell : grid->local_cells)
Expand All @@ -276,18 +273,14 @@ FieldFunctionGridBased::ExportMultipleToPVTU(

if (num_nodes == cell.vertex_ids.size())
{
double node_average = 0.0;
for (int n = 0; n < num_nodes; ++n)
{
const int64_t nmap = sdm->MapDOFLocal(cell, n, uk_man, 0, c);

const double field_value = field_vector[nmap];

point_array->InsertNextValue(field_value);
node_average += field_value;
} // for node
node_average /= static_cast<double>(num_nodes);
cell_array->InsertNextValue(node_average);
}
else
{
Expand All @@ -300,7 +293,6 @@ FieldFunctionGridBased::ExportMultipleToPVTU(
node_average += field_value;
} // for node
node_average /= static_cast<double>(num_nodes);
cell_array->InsertNextValue(node_average);
for (int n = 0; n < cell.vertex_ids.size(); ++n)
{
point_array->InsertNextValue(node_average);
Expand All @@ -310,7 +302,6 @@ FieldFunctionGridBased::ExportMultipleToPVTU(
} // for cell

point_data->AddArray(point_array);
cell_data->AddArray(cell_array);
} // for component
} // for ff_ptr

Expand Down
2 changes: 1 addition & 1 deletion python/lib/fieldfunc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ WrapFieldFunctionGridBased(py::module& ffunc)
)"
);
field_func_grid_based.def_static(
"ExportMultipleToVTK",
"ExportMultipleToPVTU",
[](py::list& ff_list, const std::string& base_name)
{
std::vector<std::shared_ptr<const FieldFunctionGridBased>> cpp_ff_list;
Expand Down
2 changes: 1 addition & 1 deletion test/python/framework/tutorials/tutorial_93_raytracing.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.