MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / TEST_F

Function TEST_F

tests/tools/Wires/Inflator/PhantomMeshGeneratorTest.h:14–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12};
13
14TEST_F(PhantomMeshGeneratorTest, creation) {
15 const Vector3F half_size(2.5, 2.5, 2.5);
16 WireNetwork::Ptr network = load_wire_shared("brick5.wire");
17 network->scale_fit(-half_size, half_size);
18
19 WireProfile::Ptr profile = WireProfile::create("square");
20
21 ParameterManager::Ptr manager = ParameterManager::create(network);
22
23 PhantomMeshGenerator generator(network, manager, profile);
24 generator.with_shape_velocities();
25 generator.generate();
26
27 Mesh::Ptr mesh = form_mesh(
28 generator.get_vertices(), generator.get_faces());
29
30 const size_t num_vertices = mesh->get_num_vertices();
31 const size_t dim = mesh->get_dim();
32 size_t count=0;
33 std::vector<std::string> attr_names;
34 const auto& shape_velocities = generator.get_shape_velocities();
35 for (const auto& shape_velocity : shape_velocities) {
36 VectorF velocity(num_vertices * dim);
37 std::copy(shape_velocity.data(),
38 shape_velocity.data() + num_vertices * dim,
39 velocity.data());
40 std::stringstream attr_name;
41 attr_name << "velocity_" << count;
42 mesh->add_attribute(attr_name.str());
43 mesh->set_attribute(attr_name.str(), velocity);
44 attr_names.push_back(attr_name.str());
45 count++;
46 }
47
48 save_mesh("phantom_brick5.msh", mesh, attr_names);
49}

Callers

nothing calls this directly

Calls 13

form_meshFunction · 0.85
scale_fitMethod · 0.80
generateMethod · 0.80
save_meshFunction · 0.50
with_shape_velocitiesMethod · 0.45
get_verticesMethod · 0.45
get_facesMethod · 0.45
get_num_verticesMethod · 0.45
get_dimMethod · 0.45
get_shape_velocitiesMethod · 0.45
add_attributeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected