Skip to content

Commit

Permalink
Merge Pull Request #3463 from prwolfe/Trilinos/new_stk_development
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: Import of stk development from the sierra stream
PR Author: prwolfe
  • Loading branch information
trilinos-autotester authored Sep 19, 2018
2 parents 41fca95 + c09331e commit 3ed4379
Show file tree
Hide file tree
Showing 6 changed files with 1,121 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/stk/stk_search/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SET(LIB_REQUIRED_DEP_PACKAGES ThreadPool STKUtil Kokkos STKMath)
SET(LIB_REQUIRED_DEP_PACKAGES STKUtil Kokkos STKMath)
SET(LIB_OPTIONAL_DEP_PACKAGES)
SET(TEST_REQUIRED_DEP_PACKAGES STKUnit_test_utils Gtest)
SET(TEST_OPTIONAL_DEP_PACKAGES)
Expand Down
33 changes: 33 additions & 0 deletions packages/stk/stk_tools/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ alias install-targets
: stk_block_extractor
stk_tools_utest
stk_tools_integration_tester
stk_tools_pmesh_unit_tester
;

#
Expand Down Expand Up @@ -151,3 +152,35 @@ lib stk_tools_lib
<file>$(stk_tools-root)/lib/libstk_tools_lib.a
]
;

lib stk_pmesh_lib
:
[ ifdevbuild
$(stk_tools-root)/stk_tools/pmesh_lib/makeparfiles.C
]
/sierra/stk_io//stk_io
/sierra/stk_io//stk_io_util
/sierra/seacas//nemesis
:
[ ifuserbuild
<file>$(stk_tools-root)/lib/libpmesh_lib.a
]
[ ifdevbuild
<include>$(stk_tools-root-inc)/stk_tools/pmesh_lib
]
:
:
<include>$(stk_tools-root-inc)/stk_tools/pmesh_lib
;

exe stk_tools_pmesh_unit_tester
:
[ glob
$(stk_tools-root)/stk_tools/pmesh_lib/UnitTest/*.C
]
stk_pmesh_lib
/tpl/gtest//gtest
:
<tag>@sierra-exec-tag
;

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ####################### Start Clang Header Tool Managed Headers ########################
// clang-format off
#include <gtest/gtest.h>
#include <mpi.h> // for MPI_Finalize, MPI_Init
// clang-format on
// ####################### End Clang Header Tool Managed Headers ########################

int main(int argc, char **argv)
{
MPI_Init( &argc , &argv );
testing::InitGoogleTest(&argc, argv);
int returnVal = RUN_ALL_TESTS();
MPI_Finalize();

return returnVal;
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// ####################### Start Clang Header Tool Managed Headers ########################
// clang-format off
#include <gtest/gtest.h>
#include <mpi.h> // for MPI_Comm_rank, MPI_Comm_size
#include <stddef.h> // for size_t
#include <makeparfiles.H> // for MakeParFile
#include <string> // for string
#include "stk_io/FillMesh.hpp" // for fill_mesh
#include "stk_mesh/base/BulkData.hpp" // for BulkData
#include "stk_mesh/base/GetEntities.hpp" // for count_selected_entities
#include "stk_mesh/base/MetaData.hpp" // for MetaData
#include "stk_topology/topology.hpp" // for topology, topology::rank_t:...
// clang-format on
// ####################### End Clang Header Tool Managed Headers ########################

namespace
{

TEST(PMESH, a)
{
MPI_Comm comm = MPI_COMM_WORLD;

int num_procs = -1, my_proc_id = -1;
MPI_Comm_rank(comm, &my_proc_id);
MPI_Comm_size(comm, &num_procs);

// ncut_x * ncuts_y * ncuts_z is number of processor
int ncuts_x = 1, ncuts_y = 1, ncuts_z = 1;
size_t num_elem_per_edge = 10;
double lenx = 1.0, leny = 1.0, lenzi = 1.0;
int numraid = 1;
const std::string rootdir="";
const std::string subdir="";

stk_tools::MakeParFile(my_proc_id, num_procs, ncuts_x, ncuts_y, ncuts_z, num_elem_per_edge, lenx, leny, lenzi, numraid, rootdir.c_str(), subdir.c_str());;

stk::mesh::MetaData meta;
stk::mesh::BulkData bulk(meta, comm);
stk::io::fill_mesh("1/cube.par.1.0", bulk);

size_t numElements = stk::mesh::count_selected_entities(meta.locally_owned_part(), bulk.buckets(stk::topology::ELEM_RANK));
EXPECT_EQ(num_elem_per_edge*num_elem_per_edge*num_elem_per_edge, numElements);
}

}
Loading

0 comments on commit 3ed4379

Please sign in to comment.