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

Method get_offset_dof_map

tools/Wires/Parameters/ParameterManager.cpp:435–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435MatrixIr ParameterManager::get_offset_dof_map() const {
436 if (m_dof_type == ISOTROPIC) {
437 throw RuntimeError("Offset DOF map does not support isotropic dofs!");
438 }
439
440 const size_t num_thickness_dofs = get_num_thickness_dofs();
441 const size_t domain_size = m_wire_network->get_num_vertices();
442 const size_t dim = m_wire_network->get_dim();
443 MatrixIr dof_map = MatrixIr::Ones(domain_size, dim) * -1;
444
445 size_t dof_counter = num_thickness_dofs;
446 for (const auto& param : m_offset_params) {
447 VectorI roi = param->get_roi();
448 const size_t roi_size = roi.size();
449
450 const VertexOffsetParameter* param_ptr =
451 dynamic_cast<const VertexOffsetParameter*>(param.get());
452 size_t axis = param_ptr->get_axis();
453
454 for (size_t i=0; i<roi_size; i++) {
455 dof_map(roi[i], axis) = dof_counter;
456 }
457 dof_counter++;
458 }
459 return dof_map;
460}
461
462void ParameterManager::save_dofs(const std::string& dof_file) const {
463 PTree dof_config;

Callers 1

TEST_FFunction · 0.80

Calls 7

RuntimeErrorClass · 0.85
get_roiMethod · 0.80
get_axisMethod · 0.80
get_num_verticesMethod · 0.45
get_dimMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by 1

TEST_FFunction · 0.64