1 #include <stk_io/util/IO_Fixture.hpp> 3 #include <stk_util/unit_test_support/stk_utest_macros.hpp> 4 #include <stk_mesh/base/GetEntities.hpp> 5 #include <stk_mesh/base/BulkData.hpp> 20 stk_classic::mesh::EntityRank elem_rank = meta.
element_rank();
26 for ( stk_classic::mesh::PartVector::const_iterator
27 ip = all_parts.begin(); ip != all_parts.end(); ++ip ) {
32 std::vector<stk_classic::mesh::Entity*> entities;
35 for (
size_t i=0; i < entities.size(); i++) {
36 if (rand() > (RAND_MAX/4)*3)
46 STKUNIT_UNIT_TEST( IOFixture, iofixture )
54 std::string input_base_filename =
"unit_test.g";
68 std::string output_base_filename =
"unit_test_output.e";
72 const double time_step = 0;
79 STKUNIT_UNIT_TEST( IOFixture, active_only )
86 std::string input_base_filename =
"unit_test.g";
101 activate_entities(fixture, active);
105 fixture.mesh_data().m_anded_selector = &active_selector;
108 std::string output_base_filename =
"unit_test_output_filtered.e";
112 const double time_step = 0;
120 STKUNIT_UNIT_TEST( IOFixture, active_and_all )
126 std::string input_base_filename =
"unit_test.g";
141 activate_entities(fixture, active);
145 fixture.mesh_data().m_anded_selector = &active_selector;
148 std::string filtered_output_base_filename =
"unit_test_output_first_of_two.e";
152 double time_step = 0;
156 Teuchos::RCP<Ioss::Region> active_output_ioss_region = fixture.output_ioss_region();
160 fixture.mesh_data().m_anded_selector = &universal_selector;
163 std::string unfiltered_output_base_filename =
"unit_test_output_second_of_two.e";
167 Teuchos::RCP<Ioss::Region> universal_output_ioss_region = fixture.output_ioss_region();
171 fixture.output_ioss_region(active_output_ioss_region);
172 fixture.mesh_data().m_anded_selector = &active_selector;
175 fixture.output_ioss_region(universal_output_ioss_region);
176 fixture.mesh_data().m_anded_selector = &universal_selector;
181 fixture.output_ioss_region(active_output_ioss_region);
182 fixture.mesh_data().m_anded_selector = &active_selector;
185 fixture.output_ioss_region(universal_output_ioss_region);
186 fixture.mesh_data().m_anded_selector = &universal_selector;
192 STKUNIT_UNIT_TEST( IOFixture, large_mesh_test )
198 std::string input_base_filename =
"1mCube_20x20x20.g";
211 const std::vector< stk_classic::mesh::Bucket * > & element_buckets
215 for ( std::vector<stk_classic::mesh::Bucket*>::const_iterator ib = element_buckets.begin() ;
216 ib != element_buckets.end() ; ++ib ) {
218 const int length = b.
size();
219 for (
int k = 0 ; k < length ; ++k ) {
223 STKUNIT_EXPECT_EQ( 8u, elem_node_rels.size());
void add_timestep_to_output_mesh(double time)
void initialize_bulk_data()
void initialize_meta_data(const std::string &base_filename, const std::string &type="exodusii")
This is a class for selecting buckets based on a set of meshparts and set logic.
void create_output_mesh(const std::string &base_exodus_filename, bool add_transient=true, bool add_all_fields=false)
const std::vector< Bucket * > & buckets(EntityRank rank) const
Query all buckets of a given entity rank.
unsigned primary_entity_rank() const
The primary entity type for this part.
An application-defined subset of a problem domain.
void get_selected_entities(const Selector &selector, const std::vector< Bucket * > &input_buckets, std::vector< Entity * > &entities)
Get entities in selected buckets (selected by the given selector instance), and sorted by ID...
void change_entity_parts(Entity &entity, const PartVector &add_parts, const PartVector &remove_parts=PartVector())
Change the parallel-locally-owned entity's part membership by adding and/or removing parts...
size_t size() const
Number of entities associated with this bucket.
bool modification_end()
Parallel synchronization of modifications and transition to the guaranteed parallel consistent state...
bool modification_begin()
Begin a modification phase during which the mesh bulk data could become parallel inconsistent. This is a parallel synchronous call. The first time this method is called the mesh meta data is verified to be committed and parallel consistent. An exception is thrown if this verification fails.
bool is_part_io_part(stk_classic::mesh::Part &part)
PairIterRelation relations() const
All Entity relations for which this entity is a member. The relations are ordered from lowest entity-...
Manager for an integrated collection of entities, entity relations, and buckets of field data...
A fundamental unit within the discretization of a problem domain, including but not limited to nodes...
std::vector< Part *> PartVector
Collections of parts are frequently maintained as a vector of Part pointers.
A container for the field data of a homogeneous collection of entities.