Skip to content

Commit

Permalink
SLICE: Preliminary support for 1d models
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Jul 17, 2024
1 parent c564837 commit ccc5d55
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/seacas/applications/slice/SL_Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

static const std::array<std::string, 3> qainfo{
"slice",
"2024/06/10",
"2.3.00",
"2024/07/17",
"2.3.01",
};
22 changes: 17 additions & 5 deletions packages/seacas/applications/slice/Slice.C
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,8 @@ namespace {
size_t proc_size)
{
progress(__func__);
size_t spatial_dimension = region.get_property("spatial_dimension").get_int();

std::vector<double> glob_coord_x;
std::vector<double> glob_coord_y;
std::vector<double> glob_coord_z;
Expand Down Expand Up @@ -968,8 +970,12 @@ namespace {
}
else {
gnb->get_field_data("mesh_model_coordinates_x", glob_coord_x);
gnb->get_field_data("mesh_model_coordinates_y", glob_coord_y);
gnb->get_field_data("mesh_model_coordinates_z", glob_coord_z);
if (spatial_dimension > 1) {
gnb->get_field_data("mesh_model_coordinates_y", glob_coord_y);
}
if (spatial_dimension > 2) {
gnb->get_field_data("mesh_model_coordinates_z", glob_coord_z);
}
progress("\tRead global mesh_model_coordinates");

for (size_t i = 0; i < node_count; i++) {
Expand All @@ -993,8 +999,12 @@ namespace {
for (size_t p = proc_begin; p < proc_begin + proc_size; p++) {
Ioss::NodeBlock *nb = proc_region[p]->get_node_blocks()[0];
nb->put_field_data("mesh_model_coordinates_x", coordinates_x[p]);
nb->put_field_data("mesh_model_coordinates_y", coordinates_y[p]);
nb->put_field_data("mesh_model_coordinates_z", coordinates_z[p]);
if (spatial_dimension > 1) {
nb->put_field_data("mesh_model_coordinates_y", coordinates_y[p]);
}
if (spatial_dimension > 2) {
nb->put_field_data("mesh_model_coordinates_z", coordinates_z[p]);
}
proc_progress(p, processor_count);
}
progress("\tOutput processor coordinate vectors");
Expand Down Expand Up @@ -1028,7 +1038,9 @@ namespace {
}
progress("\tReserve processor coordinate vectors");

for (size_t comp = 0; comp < 3; comp++) {
size_t spatial_dimension = region.get_property("spatial_dimension").get_int();

for (size_t comp = 0; comp < spatial_dimension; comp++) {
for (size_t p = proc_begin; p < proc_begin + proc_size; p++) {
coordinates[p].resize(0);
}
Expand Down

0 comments on commit ccc5d55

Please sign in to comment.