Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
067e2b3
add fields from other domains
nicolemarsaglia Mar 13, 2025
79c5273
conflict
nicolemarsaglia Mar 13, 2025
9c2880a
push before switching
nicolemarsaglia Mar 17, 2025
ead1f45
let's put this here for now
nicolemarsaglia Mar 20, 2025
eda9808
blt_mpi_deps
nicolemarsaglia Mar 20, 2025
c660409
add logic for if vtkm has mpi on
nicolemarsaglia Mar 21, 2025
d147e00
Update SetupMFEM.cmake
nicolemarsaglia Mar 24, 2025
1e4f93f
try it this way?
nicolemarsaglia Mar 24, 2025
9d856da
Merge branch 'task/2025_03_warpx_unit_test' of https://github.com/Alp…
nicolemarsaglia Mar 24, 2025
d64682a
idk this is weird
nicolemarsaglia Mar 24, 2025
f0f43e2
lets see this pass the ci then I'll fix the cmakelists
nicolemarsaglia Mar 28, 2025
f72e4b1
Merge branch 'task/2025_03_warpx_unit_test' of https://github.com/Alp…
nicolemarsaglia Mar 28, 2025
013d572
lets try this cmake flag again for if mpi is not found
nicolemarsaglia Mar 31, 2025
cbed1c1
Merge branch 'task/2025_03_warpx_unit_test' of https://github.com/Alp…
nicolemarsaglia Mar 31, 2025
e5c7d92
t- => t_
nicolemarsaglia Mar 31, 2025
2034ffe
Merge branch 'develop' into task/2025_03_warpx_unit_test
nicolemarsaglia May 15, 2025
9bf1064
Merge branch 'develop' into task/2025_03_warpx_unit_test
nicolemarsaglia May 22, 2025
bf6cfb6
remove comment
nicolemarsaglia May 22, 2025
80c4ac7
Develop anari (#1538)
nicolemarsaglia May 23, 2025
278aa8a
remove cerr statments
nicolemarsaglia May 23, 2025
a0ddd85
Merge branch 'develop' into task/2025_05_develop_anari
nicolemarsaglia May 23, 2025
8581de7
revert this change
nicolemarsaglia May 23, 2025
76f5529
remove print statements
nicolemarsaglia May 23, 2025
2fe2f40
add anari as rendering option
nicolemarsaglia May 23, 2025
9ea2811
remove encoder
nicolemarsaglia May 27, 2025
f2adc76
Merge branch 'develop' into task/2025_05_develop_anari
nicolemarsaglia Jun 11, 2025
fc3ef11
kokkos typo
nicolemarsaglia Jun 11, 2025
eeb820f
remove anari as IsVolume in Scene.cpp
nicolemarsaglia Jun 12, 2025
1c5fabb
add triangle renderer
nicolemarsaglia Jul 2, 2025
256a5c9
start to get color map working
nicolemarsaglia Jul 4, 2025
7d7b944
update
nicolemarsaglia Jul 7, 2025
09c2d54
combine anari to a single renderer
nicolemarsaglia Jul 10, 2025
522b555
move device initializion from constructor to execture so we only do i…
nicolemarsaglia Jul 11, 2025
ff293bb
add anari mapper triangles patch
nicolemarsaglia Jul 14, 2025
264a73c
add ptc to build script
nicolemarsaglia Jul 18, 2025
59b4e62
add build scripts
nicolemarsaglia Jul 29, 2025
a248b33
add tests
nicolemarsaglia Jul 29, 2025
5256a9e
I think I have it working with tmp data. Need to double check and cle…
nicolemarsaglia Oct 10, 2025
37cb8f9
add spacing based off dims
nicolemarsaglia Oct 24, 2025
8a8e63c
start of box
nicolemarsaglia Oct 24, 2025
3006b94
push to change branches, not done
nicolemarsaglia Oct 28, 2025
c070577
wrong branch, gonna revert this
nicolemarsaglia Oct 28, 2025
baeacc5
Revert "wrong branch, gonna revert this"
nicolemarsaglia Oct 28, 2025
b445d96
pusshing for now
nicolemarsaglia Oct 28, 2025
8ec3c3a
need to debug box sample.
nicolemarsaglia Nov 13, 2025
218ff6e
add box sample
nicolemarsaglia Nov 19, 2025
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
180 changes: 179 additions & 1 deletion src/libs/ascent/runtimes/flow_filters/ascent_runtime_vtkh_filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3746,7 +3746,6 @@ VTKHUniformGrid::verify_params(const conduit::Node &params,
res &= check_numeric("origin/y",params, info, false);
res &= check_numeric("origin/z",params, info, false);
res &= check_numeric("spacing/dx",params, info, false);
res &= check_numeric("spacing/dx",params, info, false);
res &= check_numeric("spacing/dy",params, info, false);
res &= check_numeric("spacing/dz",params, info, false);
res &= check_numeric("invalid_value",params, info, false);
Expand Down Expand Up @@ -3858,6 +3857,7 @@ VTKHUniformGrid::execute()
std::string field = field_selection[0];
std::string topo_name = collection->field_topology(field);
vtkh::DataSet &data = collection->dataset_by_topology(topo_name);
vtkm::Id global_cells = data.GetGlobalNumberOfCells();

vtkm::Bounds d_bounds = data.GetGlobalBounds();
vtkm::Float64 x_extents = d_bounds.X.Length() + 1; //add one b/c we are
Expand All @@ -3884,6 +3884,9 @@ VTKHUniformGrid::execute()
v_dims[0] = (v_dims[0] > 0) ? (v_dims[0]) : 1;
v_dims[1] = (v_dims[1] > 0) ? (v_dims[1]) : 1;
v_dims[2] = (v_dims[2] > 0) ? (v_dims[2]) : 1;
v_spacing[0] = x_extents/v_dims[0];
v_spacing[1] = y_extents/v_dims[1];
v_spacing[2] = z_extents/v_dims[2];
}
if(params().has_path("origin"))
{
Expand All @@ -3904,6 +3907,10 @@ VTKHUniformGrid::execute()
v_spacing[1] = get_float64(n_spacing["dy"], data_object);
if(n_spacing.has_path("dz"))
v_spacing[2] = get_float64(n_spacing["dz"], data_object);

v_spacing[0] = (v_spacing[0] > 0) ? (v_spacing[0]) : 1;
v_spacing[1] = (v_spacing[1] > 0) ? (v_spacing[1]) : 1;
v_spacing[2] = (v_spacing[2] > 0) ? (v_spacing[2]) : 1;
}
if(params().has_path("invalid_value"))
{
Expand Down Expand Up @@ -3977,6 +3984,22 @@ VTKHSample::verify_params(const conduit::Node &params,
res &= check_numeric("points/y",params, info, false);
res &= check_numeric("points/z",params, info, false);

res &= check_numeric("box/dims/x",params, info, false);
res &= check_numeric("box/dims/y",params, info, false);
res &= check_numeric("box/dims/z",params, info, false);
res &= (check_numeric("box/min/x",params, info, false)
|| check_string("box/min/x",params, info, false));
res &= (check_numeric("box/min/y",params, info, false)
|| check_string("box/min/y",params, info, false));
res &= (check_numeric("box/min/z",params, info, false)
|| check_string("box/min/z",params, info, false));
res &= (check_numeric("box/max/x",params, info, false)
|| check_string("box/max/x",params, info, false));
res &= (check_numeric("box/max/y",params, info, false)
|| check_string("box/max/y",params, info, false));
res &= (check_numeric("box/max/z",params, info, false)
|| check_string("box/max/z",params, info, false));


if(!params.has_child("field") && !params.has_child("fields"))
{
Expand Down Expand Up @@ -4007,6 +4030,16 @@ VTKHSample::verify_params(const conduit::Node &params,
valid_paths.push_back("points/y");
valid_paths.push_back("points/z");

valid_paths.push_back("box/dims/i");
valid_paths.push_back("box/dims/j");
valid_paths.push_back("box/dims/k");
valid_paths.push_back("box/min/x");
valid_paths.push_back("box/min/y");
valid_paths.push_back("box/min/z");
valid_paths.push_back("box/max/x");
valid_paths.push_back("box/max/y");
valid_paths.push_back("box/max/z");

std::string surprises = "";

std::vector<std::string> ignore_paths;
Expand Down Expand Up @@ -4142,6 +4175,151 @@ VTKHSample::execute()

sampler.Points(x_hnd, y_hnd, z_hnd);

}
else if(params().has_path("box"))
{
params().print();

int dims[3];
vtkm::Float64 x_min, x_max, y_min, y_max, z_min, z_max;
vtkm::Bounds g_bounds = data.GetGlobalBounds();
const Node &dims_b = params()["box/dims"];
const Node &min_b = params()["box/min"];
const Node &max_b = params()["box/max"];
dims_b.print();

if(dims_b.has_child("i"))
{
dims[0] = dims_b["i"].to_int();
}
else
dims[0] = 1;

if(dims_b.has_child("j"))
{
dims[1] = dims_b["j"].to_int();
}
else
dims[1] = 1;

if(dims_b.has_child("k"))
{
dims[2] = dims_b["k"].to_int();
}
else
dims[2] = 1;

if(min_b.has_child("x"))
{
if(min_b["x"].dtype().is_string())
{
if(min_b["x"].as_string() != "min")
ASCENT_ERROR("minimum value for x must be the string `min` or a scalar double");
x_min = g_bounds.X.Min;
}
else
{
x_min = min_b["x"].as_float64();
}
}
else //not set; default (max-min)/2
{
x_min = (g_bounds.X.Max - g_bounds.X.Min)/2.0;
}

if(min_b.has_child("y"))
{
if(min_b["y"].dtype().is_string())
{
if(min_b["y"].as_string() != "min")
ASCENT_ERROR("minimum value for y must be the string `min` or a scalar double");
y_min = g_bounds.Y.Min;
}
else
{
y_min = min_b["y"].as_float64();
}
}
else //not set; default (max-min)/2
{
y_min = (g_bounds.Y.Max - g_bounds.Y.Min)/2.0;
}

if(min_b.has_child("z"))
{
if(min_b["z"].dtype().is_string())
{
if(min_b["z"].as_string() != "min")
ASCENT_ERROR("minimum value for z must be the string `min` or a scalar double");
z_min = g_bounds.Z.Min;
}
else
{
z_min = min_b["z"].as_float64();
}
}
else //not set; default (max-min)/2
{
z_min = (g_bounds.Z.Max - g_bounds.Z.Min)/2.0;
}

if(max_b.has_child("x"))
{
if(max_b["x"].dtype().is_string())
{
if(max_b["x"].as_string() != "max")
ASCENT_ERROR("maximum value for x must be the string `max` or a scalar double");
x_max = g_bounds.X.Max;
}
else
{
x_max = max_b["x"].as_float64();
}
}
else //not set; default (max-min)/2
{
x_max = (g_bounds.X.Max - g_bounds.X.Min)/2.0;
}

if(max_b.has_child("y"))
{
if(max_b["y"].dtype().is_string())
{
if(max_b["y"].as_string() != "max")
ASCENT_ERROR("maximum value for y must be the string `max` or a scalar double");
y_max = g_bounds.Y.Max;
}
else
{
y_max = max_b["y"].as_float64();
}
}
else //not set; default (max-min)/2
{
y_max = (g_bounds.Y.Max - g_bounds.Y.Min)/2.0;
}

if(max_b.has_child("z"))
{
if(max_b["z"].dtype().is_string())
{
if(max_b["z"].as_string() != "max")
ASCENT_ERROR("maximum value for z must be the string `max` or a scalar double");
z_max = g_bounds.Z.Max;
}
else
{
z_max = max_b["z"].as_float64();
}
}
else //not set; default (max-min)/2
{
z_max = (g_bounds.Z.Max - g_bounds.Z.Min)/2.0;
}


sampler.Box(dims, x_min, y_min, z_min, x_max, y_max, z_max);

}

double invalid_value = 0.0;
Expand Down
66 changes: 62 additions & 4 deletions src/libs/vtkh/filters/Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,6 @@ Sample::DoExecute()
const int num_domains = domain_ids.size();

#if _DEBUG
std::cerr << "m_dims: " << m_dims[0] << " " << m_dims[1] << " " << m_dims[2] << std::endl;
std::cerr << "m_origin: " << m_origin[0] << " " << m_origin[1] << " " << m_origin[2] << std::endl;
std::cerr << "m_spacing: " << m_spacing[0] << " " << m_spacing[1] << " " << m_spacing[2] << std::endl;
std::cerr << "input num cells: " << m_input->GetGlobalNumberOfCells() << std::endl;
#ifdef VTKH_PARALLEL
std::cerr << "par rank " << par_rank << " num domains: " << num_domains << std::endl;
#endif
Expand Down Expand Up @@ -952,6 +948,68 @@ Sample::Line(int num_samples,
}
}

//---------------------------------------------------------------------------//
void
Sample::Box(int *dims,
double x_start,
double y_start,
double z_start,
double x_end,
double y_end,
double z_end)

{
int num_samples = dims[0]*dims[1]*dims[2];

// alloc array handles to hold num_samples
// alloc xs, ys, zs
m_points_xs.Allocate(num_samples);
m_points_ys.Allocate(num_samples);
m_points_zs.Allocate(num_samples);

auto x_portal = m_points_xs.WritePortal();
auto y_portal = m_points_ys.WritePortal();
auto z_portal = m_points_zs.WritePortal();

const int Nx = dims[0];
const int Ny = dims[1];
const int Nz = dims[2];
//unset *_start&*_end are both set to (max-min)/2
const double dx = (Nx > 1) ? (x_end - x_start) / double(Nx - 1) : 0.0;
const double dy = (Ny > 1) ? (y_end - y_start) / double(Ny - 1) : 0.0;
const double dz = (Nz > 1) ? (z_end - z_start) / double(Nz - 1) : 0.0;

#if _DEBUG
std::cerr << "Nx: " << Nx << " Ny: " << Ny << " Nz: " << Nz << std::endl;

std::cerr << "x_start: " << x_start << " x_end: " << x_end << std::endl;
std::cerr << "y_start: " << y_start << " y_end: " << y_end << std::endl;
std::cerr << "z_start: " << z_start << " z_end: " << z_end << std::endl;
std::cerr << "dx: " << dx << " dy: " << dy << " dz: " << dz << std::endl;
#endif

int idx = 0;
for (int i = 0; i < Nx; ++i)
{
double x = (Nx > 1) ? (x_start + i * dx) : x_start;
for (int j = 0; j < Ny; ++j)
{
double y = (Ny > 1) ? (y_start + j * dy) : y_start;
for (int k = 0; k < Nz; ++k)
{
double z = (Nz > 1) ? (z_start + k * dz) : z_start;
x_portal.Set(idx, x);
y_portal.Set(idx, y);
z_portal.Set(idx, z);
#if _DEBUG
std::cerr << "i: " << i << " j: " << j << " k: " << k << " x: " << x << " y: " << y << " z: " << z << std::endl;
std::cerr << "idx: " << idx << std::endl;
#endif
idx++;
}
}
}
}
//---------------------------------------------------------------------------//
void
Sample::Points(vtkm::cont::ArrayHandle<vtkm::Float64> xs,
Expand Down
8 changes: 8 additions & 0 deletions src/libs/vtkh/filters/Sample.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ class VTKH_API Sample : public Filter
double y_end,
double z_end);

void Box(int * dims,
double x_start,
double y_start,
double z_start,
double x_end,
double y_end,
double z_end);

void Points(vtkm::cont::ArrayHandle<vtkm::Float64> xs,
vtkm::cont::ArrayHandle<vtkm::Float64> ys,
vtkm::cont::ArrayHandle<vtkm::Float64> zs);
Expand Down
Loading
Loading