Skip to content

Commit

Permalink
STK: Snapshot 04-18-24 06:15 from Sierra 5.19.2-769-ge072c461
Browse files Browse the repository at this point in the history
  • Loading branch information
alanw0 committed Apr 18, 2024
1 parent 32ed068 commit 742740e
Show file tree
Hide file tree
Showing 314 changed files with 11,826 additions and 3,719 deletions.
5 changes: 5 additions & 0 deletions packages/stk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# CHANGELOG

5.19.2 (STK_VERSION 5190200) 4/17/2024
Initial creation of STK_VERSION macro

24 changes: 24 additions & 0 deletions packages/stk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

cmake_minimum_required(VERSION 3.16 FATAL_ERROR)

message("starting STK cmake configuration, CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}")

IF(COMMAND TRIBITS_PACKAGE_DECL)
SET(HAVE_STK_Trilinos ON)
TRIBITS_PACKAGE_DECL(STK)
Expand Down Expand Up @@ -123,6 +125,28 @@ ELSE()
ENDIF()
ENDIF()

find_package(ArborX)
if(TARGET ArborX::ArborX)
MESSAGE("found ArborX")
SET(STK_HAS_ARBORX ON)
else()
MESSAGE("did not find ArborX. If stk_search is enabled, ArborX will not be a valid option.")
endif()

find_package(SEACAS)
if(SEACAS_ENABLE_SEACASIoss)
message("found SEACASIoss")
SET(STK_HAS_SEACAS_IOSS ON)
endif()
if(SEACAS_ENABLE_SEACASExodus)
message("found SEACASExodus")
SET(STK_HAS_SEACAS_EXODUS ON)
endif()
if(SEACAS_ENABLE_SEACASNemesis)
message("found SEACASNemesis")
SET(STK_HAS_SEACAS_NEMESIS ON)
endif()

if(NOT HAVE_STK_Trilinos)
stk_process_enables()
endif()
Expand Down
41 changes: 21 additions & 20 deletions packages/stk/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
# the order of the packages below is important. Stk packages can
# depend on packages listed above them, and not below them.
SET(SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS
Util stk_util PT OPTIONAL
Coupling stk_coupling PT OPTIONAL
Math stk_math PT OPTIONAL
Simd stk_simd PT OPTIONAL
NGP_TEST stk_ngp_test PT OPTIONAL
ExprEval stk_expreval PT OPTIONAL
Topology stk_topology PT OPTIONAL
Search stk_search PT OPTIONAL
Middle_mesh stk_middle_mesh EX OPTIONAL
Transfer stk_transfer PT OPTIONAL
Mesh stk_mesh PT OPTIONAL
SearchUtil stk_search_util EX OPTIONAL
TransferUtil stk_transfer_util EX OPTIONAL
IO stk_io PT OPTIONAL
Tools stk_tools PT OPTIONAL
Balance stk_balance PT OPTIONAL
Unit_test_utils stk_unit_test_utils PT OPTIONAL
Unit_tests stk_unit_tests PT OPTIONAL
Doc_tests stk_doc_tests PT OPTIONAL
Emend stk_emend PT OPTIONAL
Util stk_util PT OPTIONAL
Coupling stk_coupling PT OPTIONAL
Math stk_math PT OPTIONAL
Simd stk_simd PT OPTIONAL
NGP_TEST stk_ngp_test PT OPTIONAL
ExprEval stk_expreval PT OPTIONAL
Topology stk_topology PT OPTIONAL
Search stk_search PT OPTIONAL
Middle_mesh stk_middle_mesh EX OPTIONAL
Transfer stk_transfer PT OPTIONAL
Mesh stk_mesh PT OPTIONAL
Middle_mesh_util stk_middle_mesh_util EX OPTIONAL
SearchUtil stk_search_util EX OPTIONAL
TransferUtil stk_transfer_util EX OPTIONAL
IO stk_io PT OPTIONAL
Tools stk_tools PT OPTIONAL
Balance stk_balance PT OPTIONAL
Unit_test_utils stk_unit_test_utils PT OPTIONAL
Unit_tests stk_unit_tests PT OPTIONAL
Doc_tests stk_doc_tests PT OPTIONAL
Emend stk_emend PT OPTIONAL
)

SET(LIB_REQUIRED_DEP_PACKAGES)
Expand Down
8 changes: 8 additions & 0 deletions packages/stk/cmake/STK_Trilinos_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,16 @@

#cmakedefine STK_HAS_MPI

#cmakedefine STK_HAS_ARBORX

#cmakedefine STK_VOLATILE_SIMD

#cmakedefine STK_HAS_SEACAS_IOSS

#cmakedefine STK_HAS_SEACAS_EXODUS

#cmakedefine STK_HAS_SEACAS_NEMESIS

/* Non-typical "not" macro for optional dependence on SEACASAprepro_lib (See
* STK #17354) */
#ifndef NOT_HAVE_STK_SEACASAPREPRO_LIB
Expand Down
20 changes: 19 additions & 1 deletion packages/stk/cmake/stk_wrappers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ function(stk_process_enables)
set(STK_ENABLE_STKMiddle_mesh ON CACHE BOOL "")
endif()

if (DEFINED STK_ENABLE_STKMiddle_mesh_util AND NOT STK_ENABLE_STKMiddle_mesh_util)
message("STKMiddle_mesh_util explicitly disabled.")
elseif(NOT STK_ENABLE_STKMiddle_mesh)
message("STKMiddle_mesh_util disabled because STKMiddle_mesh not enabled.")
else()
set(STK_ENABLE_STKMiddle_mesh_util ON CACHE BOOL "")
endif()

if (DEFINED STK_ENABLE_STKTransfer AND NOT STK_ENABLE_STKTransfer)
message("STKTransfer explicitly disabled.")
elseif(NOT STK_ENABLE_STKSearch)
Expand Down Expand Up @@ -114,7 +122,11 @@ function(stk_process_enables)
elseif(NOT STK_ENABLE_STKMesh)
message("STKIO disabled because STKMesh not enabled.")
else()
set(STK_ENABLE_STKIO ON CACHE BOOL "")
if (STK_HAS_SEACAS_IOSS)
set(STK_ENABLE_STKIO ON CACHE BOOL "")
else()
message("STKIO disabled because SEACASIoss not available.")
endif()
endif()

if (DEFINED STK_ENABLE_STKTools AND NOT STK_ENABLE_STKTools)
Expand Down Expand Up @@ -150,6 +162,7 @@ macro(STK_SUBPACKAGES)

if(STK_ENABLE_STKCoupling)
add_subdirectory(stk_coupling)
message("STKCoupling is enabled.")
endif()

if(STK_ENABLE_STKMath)
Expand Down Expand Up @@ -187,6 +200,11 @@ macro(STK_SUBPACKAGES)
message("STKMiddle_mesh is enabled.")
endif()

if(STK_ENABLE_STKMiddle_mesh_util)
add_subdirectory(stk_middle_mesh_util)
message("STKMiddle_mesh_util is enabled.")
endif()

if(STK_ENABLE_STKTransfer)
add_subdirectory(stk_transfer)
message("STKTransfer is enabled.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ NodeBalancer::exchangeLocalSizes(const std::set<int>& neighborProcessors,
}

std::vector<MPI_Status> receiveStati(receiveRequests.size());
MPI_Waitall(receiveRequests.size(), &receiveRequests[0], &receiveStati[0]);
MPI_Waitall(receiveRequests.size(), receiveRequests.data(), receiveStati.data());

std::vector<MPI_Status> sendStati(sendRequests.size());
MPI_Waitall(sendRequests.size(), &sendRequests[0], &sendStati[0]);
MPI_Waitall(sendRequests.size(), sendRequests.data(), sendStati.data());

int i = 0;
for (int p : neighborProcessors) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void fillFaceBoxesWithIds(stk::mesh::BulkData &stkMeshBulkData, const BalanceSet
sidesetSide, sideNodes);
const double eps = balanceSettings.getToleranceForFaceSearch(stkMeshBulkData, *coord,
sideNodes.data(), sideNodes.size());
addBoxForNodes(stkMeshBulkData, sideNodes.size(), &sideNodes[0], coord, eps,
addBoxForNodes(stkMeshBulkData, sideNodes.size(), sideNodes.data(), coord, eps,
stkMeshBulkData.identifier(sidesetElement), faceBoxes);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/stk/stk_coupling/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ exe stk_coupling_utest
[ glob $(stk_coupling-root)/../stk_unit_tests/stk_coupling/*.cpp ]
/sierra/stk_coupling//stk_coupling
/sierra/stk_unit_test_utils//stk_unit_main
/tpl/gtest//gtest
/tpl/googletest//gtest

: <tag>@sierra-exec-tag
;
Expand Down
35 changes: 13 additions & 22 deletions packages/stk/stk_doc_tests/stk_io/handleMissingFieldOnRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#include <iomanip> // for operator<<
#include <stk_io/StkMeshIoBroker.hpp> // for StkMeshIoBroker
#include <stk_mesh/base/Field.hpp> // for Field
#include <stk_mesh/base/GetEntities.hpp> // for get_entities
#include <stk_mesh/base/FieldBLAS.hpp>
#include <stk_mesh/base/ForEachEntity.hpp>
#include <stk_mesh/base/MetaData.hpp> // for MetaData, put_field
#include <string> // for string
#include <vector> // for vector
Expand Down Expand Up @@ -82,24 +83,17 @@ namespace {

//+ The name of the field on the database will be "temp"
stkIo.add_field(fh, temperature, "temp");

std::vector<stk::mesh::Entity> nodes;
stk::mesh::get_entities(stkIo.bulk_data(),
stk::topology::NODE_RANK, nodes);

// Add three steps to the database
// For each step, the value of the field is the value 'time'
for (size_t i=0; i < 3; i++) {
double time = i;
double time = i;

for(size_t inode=0; inode<nodes.size(); inode++) {
double *fieldDataForNode = stk::mesh::field_data(temperature, nodes[inode]);
*fieldDataForNode = time;
}
stk::mesh::field_fill(time, temperature);

stkIo.begin_output_step(fh, time);
stkIo.write_defined_output_fields(fh);
stkIo.end_output_step(fh);
stkIo.begin_output_step(fh, time);
stkIo.write_defined_output_fields(fh);
stkIo.end_output_step(fh);
}
}

Expand Down Expand Up @@ -151,16 +145,13 @@ namespace {
EXPECT_EQ("displacement", missing_fields[0].field()->name());
EXPECT_EQ("disp", missing_fields[1].db_name());
EXPECT_EQ("displacement_STKFS_N", missing_fields[1].field()->name());

// The value of the "temperature" field at all nodes should be 2.0
std::vector<stk::mesh::Entity> nodes;
stk::mesh::get_entities(stkIo.bulk_data(), stk::topology::NODE_RANK,
nodes);
for(size_t i=0; i<nodes.size(); i++) {
double *fieldDataForNode =
stk::mesh::field_data(temperature, nodes[i]);
EXPECT_DOUBLE_EQ(2.0, *fieldDataForNode);
}
stk::mesh::for_each_entity_run(stkIo.bulk_data(), stk::topology::NODE_RANK,
[&](const stk::mesh::BulkData& bulk, stk::mesh::Entity node) {
double *fieldDataForNode = stk::mesh::field_data(temperature, node);
EXPECT_DOUBLE_EQ(2.0, *fieldDataForNode);
});
//-END
}
// ============================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,8 @@ void verify_field_is_valid(const stk::mesh::MetaData &meta,
stk::topology::rank_t rank = meta.mesh_bulk_data().entity_rank(entity);
stk::mesh::FieldBase* field = meta.get_field(rank, fieldName);
ASSERT_TRUE(field != nullptr);
double* fieldDataForEntity = static_cast<double*>(stk::mesh::field_data(*field, entity) );
unsigned numScalars = stk::mesh::field_scalars_per_entity(*field, entity);
ASSERT_EQ(fieldLength, numScalars);
const double* fieldDataForEntity = static_cast<double*>(stk::mesh::field_data(*field, entity) );
ASSERT_EQ(fieldLength, stk::mesh::field_scalars_per_entity(*field, entity));
ASSERT_EQ(initialValue[0], fieldDataForEntity[0]);
}

Expand Down
4 changes: 3 additions & 1 deletion packages/stk/stk_doc_tests/stk_io/howToWriteMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ TEST(StkIoHowTo, WriteMesh)
unlink(filename.c_str());
}

TEST(StkIoHowTo, generateHugeMesh)
TEST(StkIoHowTo, generateMeshWith64BitIds)
{
std::string meshSpec = stk::unit_test_util::simple_fields::get_option("-i", "1x1x4");
std::string fullMeshSpec = "generated:"+meshSpec;

std::string filename = "output.exo";
stk::io::StkMeshIoBroker inputBroker;
inputBroker.use_simple_fields();

//+ Set properties to ensure that 64-bit integers will be used
inputBroker.property_add(Ioss::Property("INTEGER_SIZE_API" , 8));
inputBroker.property_add(Ioss::Property("INTEGER_SIZE_DB" , 8));
std::shared_ptr<stk::mesh::BulkData> bulk = stk::mesh::MeshBuilder(MPI_COMM_WORLD).create();
Expand Down
24 changes: 8 additions & 16 deletions packages/stk/stk_doc_tests/stk_io/interpolateFieldCyclic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
#include <stk_io/InputFile.hpp> // for InputFile, etc
#include <stk_io/StkMeshIoBroker.hpp> // for StkMeshIoBroker
#include <stk_mesh/base/Field.hpp> // for Field
#include <stk_mesh/base/GetEntities.hpp> // for get_entities
#include <stk_mesh/base/FieldBLAS.hpp>
#include <stk_mesh/base/ForEachEntity.hpp>
#include <stk_mesh/base/MetaData.hpp> // for MetaData, put_field
#include <string> // for string
#include <vector> // for vector
Expand Down Expand Up @@ -84,20 +85,12 @@ TEST(StkMeshIoBrokerHowTo, interpolateFieldCyclic)
//+ The name of the field on the database will be "temp"
stkIo.add_field(fh, temperature, "temp");

std::vector<stk::mesh::Entity> nodes;
stk::mesh::get_entities(stkIo.bulk_data(),
stk::topology::NODE_RANK, nodes);

// Add three steps to the database
// For each step, the value of the field is the value 'time'
for (size_t i=0; i < 3; i++) {
double time = i * 10.0;

for(size_t inode=0; inode<nodes.size(); inode++) {
double *fieldData =
stk::mesh::field_data(temperature, nodes[inode]);
*fieldData = time;
}
stk::mesh::field_fill(time, temperature);

stkIo.begin_output_step(fh, time);
stkIo.write_defined_output_fields(fh);
Expand Down Expand Up @@ -138,9 +131,6 @@ TEST(StkMeshIoBrokerHowTo, interpolateFieldCyclic)

stkIo.populate_bulk_data();

std::vector<stk::mesh::Entity> nodes;
stk::mesh::get_entities(stkIo.bulk_data(), stk::topology::NODE_RANK, nodes);

// The name of the field on the database is "temp"
stkIo.add_input_field(stk::io::MeshField(temperature, "temp",
stk::io::MeshField::LINEAR_INTERPOLATION));
Expand All @@ -167,10 +157,12 @@ TEST(StkMeshIoBrokerHowTo, interpolateFieldCyclic)
// ============================================================
//+ VERIFICATION
// The value of the "temperature" field at all nodes should be 'expected'
for(size_t i=0; i<nodes.size(); i++) {
double *fieldData = stk::mesh::field_data(temperature, nodes[i]);
stk::mesh::for_each_entity_run(stkIo.bulk_data(), stk::topology::NODE_RANK,
[&](const stk::mesh::BulkData& bulk, stk::mesh::Entity node) {
double *fieldData = stk::mesh::field_data(temperature, node);
EXPECT_DOUBLE_EQ(expected, *fieldData);
}
});

time += delta_time;
expected += exp_inc;
if (expected >= 20.0 || expected <= 0.0) {
Expand Down
25 changes: 8 additions & 17 deletions packages/stk/stk_doc_tests/stk_io/interpolateFieldNegativeTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
#include <iomanip> // for operator<<
#include <stk_io/StkMeshIoBroker.hpp> // for StkMeshIoBroker
#include <stk_mesh/base/Field.hpp> // for Field
#include <stk_mesh/base/GetEntities.hpp> // for get_entities
#include <stk_mesh/base/FieldBLAS.hpp>
#include <stk_mesh/base/ForEachEntity.hpp>
#include <stk_mesh/base/MetaData.hpp> // for MetaData, put_field
#include <string> // for string
#include <vector> // for vector
Expand Down Expand Up @@ -84,20 +85,12 @@ TEST(StkMeshIoBrokerHowTo, interpolateFieldNegativeTime)
//+ The name of the field on the database will be "temp"
stkIo.add_field(fh, temperature, "temp");

std::vector<stk::mesh::Entity> nodes;
stk::mesh::get_entities(stkIo.bulk_data(),
stk::topology::NODE_RANK, nodes);

// Add three steps to the database
// For each step, the value of the field is the value 'time'
for (int i=-2; i <= 0; i++) {
double time = i;

for(size_t inode=0; inode<nodes.size(); inode++) {
double *fieldData =
stk::mesh::field_data(temperature, nodes[inode]);
*fieldData = time;
}
stk::mesh::field_fill(time, temperature);

stkIo.begin_output_step(fh, time);
stkIo.write_defined_output_fields(fh);
Expand Down Expand Up @@ -125,9 +118,6 @@ TEST(StkMeshIoBrokerHowTo, interpolateFieldNegativeTime)

stkIo.populate_bulk_data();

std::vector<stk::mesh::Entity> nodes;
stk::mesh::get_entities(stkIo.bulk_data(), stk::topology::NODE_RANK, nodes);

// The name of the field on the database is "temp"
stkIo.add_input_field(stk::io::MeshField(temperature, "temp",
stk::io::MeshField::LINEAR_INTERPOLATION));
Expand All @@ -141,10 +131,11 @@ TEST(StkMeshIoBrokerHowTo, interpolateFieldNegativeTime)
// ============================================================
//+ VERIFICATION
// The value of the "temperature" field at all nodes should be 'time'
for(size_t j=0; j<nodes.size(); j++) {
double *fieldData = stk::mesh::field_data(temperature, nodes[j]);
EXPECT_DOUBLE_EQ(time, *fieldData);
}
stk::mesh::for_each_entity_run(stkIo.bulk_data(), stk::topology::NODE_RANK,
[&](const stk::mesh::BulkData& bulk, stk::mesh::Entity node) {
double *fieldData = stk::mesh::field_data(temperature, node);
EXPECT_DOUBLE_EQ(time, *fieldData);
});
}
//-END
}
Expand Down
Loading

0 comments on commit 742740e

Please sign in to comment.