Skip to content

Commit

Permalink
turn tubes off by default for warpx streamlines
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolemarsaglia committed Dec 21, 2023
1 parent 80cc765 commit 996c964
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/docs/sphinx/Actions/Pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,14 @@ Streamlines with Charged Particles (WarpX)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The streamlines with charged particles filter behaves similarly to the streamline filter, but instead utilizes charged particles, which are particles with physical attributes (``charge``, ``mass``, ``momentum``, ``weighting``), that are advected using magnetic (``b_field``) and electric (``e_field``) vector fields.
The resulting streamlines are rendered using tubes, which transform the streamline data into a 3D surface.
Otherwise, the resulting streamlines can be saved via an extract.
Note: the tube functionality is not behaving correctly, currently this functionality is OFF by default.
Otherwise, the resulting streamlines, sans tubes, can be saved via an extract.

.. code-block:: c++

conduit::Node pipelines;
// pipeline 1
pipelines["pl1/f1/type"] = "streamline";
pipelines["pl1/f1/type"] = "warpx_streamline";
// filter knobs (all these are optional)
conduit::Node &params = pipelines["pl1/f1/params"];
//vector fields
Expand All @@ -687,7 +688,7 @@ Otherwise, the resulting streamlines can be saved via an extract.
params["momentum_field"] = "momentum_field"; //default: Momentum
params["weighting_field"] = "weighting_field"; //default: Weighting
//tubing params
params["enable_tubes"] = "true"; //default: true
params["enable_tubes"] = "true"; //default: false
params["tube_size"] = 0.2; //default: 0.1
params["tube_sides"] = 4; //default: 3
params["tube_val"] = 1.0; //default: 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4098,7 +4098,7 @@ VTKHWarpXStreamline::execute()
int numSteps = get_int32(params()["num_steps"], data_object);
float stepSize = get_float32(params()["step_size"], data_object);
//tube params
bool draw_tubes = true;
bool draw_tubes = false;
bool tube_capping = true;
int tube_sides = 3;
double tube_value = 0.0;
Expand All @@ -4107,9 +4107,9 @@ VTKHWarpXStreamline::execute()

if(params().has_path("enable_tubes"))
{
if(params()["enable_tubes"].as_string() == "false")
if(params()["enable_tubes"].as_string() == "true")
{
draw_tubes = false;
draw_tubes = true;
}
}
if(draw_tubes)
Expand Down
3 changes: 2 additions & 1 deletion src/libs/vtkh/filters/WarpXStreamline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ WarpXStreamline::WarpXStreamline()
m_charge_field_name("Charge"),
m_mass_field_name("Mass"),
m_momentum_field_name("Momentum"),
m_weighting_field_name("Weighting")
m_weighting_field_name("Weighting"),
m_tubes(false)
{

}
Expand Down
6 changes: 3 additions & 3 deletions src/tests/vtkh/t_vtk-h_particle_advection_par.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ void checkValidity(vtkh::DataSet *data, const int maxSteps, bool isSL)
auto cs = currentDomain.GetCellSet();
if (isSL)
{
auto cellSet = cs.AsCellSet<vtkm::cont::CellSetExplicit<>>();
//Ensure that streamlines took <= to the max number of steps
for(int j = 0; j < cellSet.GetNumberOfCells(); j++)
for(int j = 0; j < cs.GetNumberOfCells(); j++)
{
EXPECT_LE(cellSet.GetNumberOfPointsInCell(j), maxSteps);
EXPECT_LE(cs.GetNumberOfPointsInCell(j), maxSteps);
}
}
else
Expand Down Expand Up @@ -154,6 +153,7 @@ TEST(vtkh_particle_advection, vtkh_serial_particle_advection)
outSL = streamline.GetOutput();
//outSL = RunFilter<vtkh::Streamline>(data_set, "vector_data_Float64", seeds, maxAdvSteps, 0.1);
checkValidity(outSL, maxAdvSteps+1, true);
outSL->PrintSummary(std::cerr);

writeDataSet(outSL, "advection_SeedsRandomWhole", rank);

Expand Down

0 comments on commit 996c964

Please sign in to comment.