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

Method compute_shape_velocity

tools/Wires/Parameters/ParameterManager.cpp:359–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359std::vector<MatrixFr> ParameterManager::compute_shape_velocity(Mesh::Ptr mesh) {
360 std::vector<MatrixFr> velocity;
361 for (auto param : m_thickness_params) {
362 ParameterDerivative::Ptr param_derivative;
363 if (param->get_type() == PatternParameter::VERTEX_THICKNESS) {
364 param_derivative = std::make_shared<
365 VertexThicknessParameterDerivative>(mesh, param);
366 } else if (param->get_type() == PatternParameter::EDGE_THICKNESS) {
367 param_derivative = std::make_shared<
368 EdgeThicknessParameterDerivative>(mesh, param);
369 } else {
370 assert(false);
371 }
372 velocity.push_back(param_derivative->compute());
373 }
374
375 for (auto param : m_offset_params) {
376 ParameterDerivative::Ptr param_derivative;
377 assert(param->get_type() == PatternParameter::VERTEX_OFFSET);
378 param_derivative =
379 std::make_shared<VertexOffsetParameterDerivative>(mesh, param);
380 velocity.push_back(param_derivative->compute());
381 }
382 assert(velocity.size() == get_num_dofs());
383
384 return velocity;
385}
386
387MatrixFr ParameterManager::compute_wire_gradient(size_t i) const {
388 // This is probably not fast, but the number of parameters are typically

Callers 3

TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 3

get_typeMethod · 0.45
computeMethod · 0.45
sizeMethod · 0.45

Tested by 2

TEST_FFunction · 0.64
TEST_FFunction · 0.64