Пример #1
0
MeshLib::Mesh* constructMesh(MeshLib::Mesh const& mesh)
{
    INFO("Splitting nodes...");
    std::vector<MeshLib::Element*> const& elems = mesh.getElements();
    std::vector<MeshLib::Node*> new_nodes;
    std::vector<MeshLib::Element*> new_elems;
    std::vector<std::vector<std::size_t>> node_map;
    node_map.resize(mesh.getNumberOfNodes());
    for (MeshLib::Element* elem : elems)
    {
        if (elem->getGeomType() == MeshLib::MeshElemType::LINE)
            new_elems.push_back(createElement<MeshLib::Line>(*elem, new_nodes, node_map));
        else if (elem->getGeomType() == MeshLib::MeshElemType::TRIANGLE)
            new_elems.push_back(createElement<MeshLib::Tri>(*elem, new_nodes, node_map));
        else if (elem->getGeomType() == MeshLib::MeshElemType::QUAD)
            new_elems.push_back(createElement<MeshLib::Quad>(*elem, new_nodes, node_map));
        else if (elem->getGeomType() == MeshLib::MeshElemType::TETRAHEDRON)
            new_elems.push_back(createElement<MeshLib::Tet>(*elem, new_nodes, node_map));
        else if (elem->getGeomType() == MeshLib::MeshElemType::HEXAHEDRON)
            new_elems.push_back(createElement<MeshLib::Hex>(*elem, new_nodes, node_map));
        else if (elem->getGeomType() == MeshLib::MeshElemType::PYRAMID)
            new_elems.push_back(createElement<MeshLib::Pyramid>(*elem, new_nodes, node_map));
        else if (elem->getGeomType() == MeshLib::MeshElemType::PRISM)
            new_elems.push_back(createElement<MeshLib::Prism>(*elem, new_nodes, node_map));
        else
        {
            ERR("Error: Unknown element type.");
            return nullptr;
        }
    }

    MeshLib::Properties new_props =
        constructProperties(mesh.getProperties(), new_elems, node_map, new_nodes.size());
    return new MeshLib::Mesh("Unity conform mesh", new_nodes, new_elems, new_props);
}
Пример #2
0
// Constructor specifying material properties.
HuntCrossleyForce::ContactParameters::ContactParameters
   (double stiffness, double dissipation, double staticFriction, 
    double dynamicFriction, double viscousFriction)
{
    constructProperties();
    set_stiffness(stiffness);
    set_dissipation(dissipation);
    set_static_friction(staticFriction);
    set_dynamic_friction(dynamicFriction);
    set_viscous_friction(viscousFriction);
}
Пример #3
0
//_____________________________________________________________________________
// Convienience constructor.
ContactGeometry::ContactGeometry(const Vec3& location, const Vec3& orientation, 
    PhysicalFrame& body) : ModelComponent()
{
    setNull();
    constructProperties();

    _body = &body;
    set_body_name(body.getName());
    set_location(location);
    set_orientation(orientation);
}
Пример #4
0
ContactMesh::ContactMesh(const std::string& filename,
                         const SimTK::Vec3& location,
                         const SimTK::Vec3& orientation,
                         const PhysicalFrame& frame) :
    ContactGeometry(location, orientation, frame)
{
    setNull();
    constructProperties();
    setFilename(filename);
    if (filename != ""){
        std::ifstream file;
        file.open(filename.c_str());
        if (file.fail())
            throw Exception("Error loading mesh file: "+filename+". The file should exist in same folder with model.\n Model loading is aborted.");
        file.close();
        SimTK::PolygonalMesh mesh;
        mesh.loadFile(filename);
        _geometry.reset(new SimTK::ContactGeometry::TriangleMesh(mesh));
    }
}
Пример #5
0
ContactMesh::ContactMesh() 
{
    setNull();
    constructProperties();
}
Пример #6
0
// Take over ownership of supplied object.
HuntCrossleyForce::HuntCrossleyForce(ContactParameters* params)
{
    constructProperties();
    addContactParameters(params);
}
Пример #7
0
// Default constructor.
HuntCrossleyForce::HuntCrossleyForce()
{
    constructProperties();
}
Пример #8
0
// Default constructor.
HuntCrossleyForce::ContactParameters::ContactParameters()
{
    constructProperties();
}
Пример #9
0
//_____________________________________________________________________________
// Default constructor.
ContactGeometry::ContactGeometry() : ModelComponent()
{
    setNull();
    constructProperties();
}
Пример #10
0
//=============================================================================
// CONSTRUCTOR(S) AND DESTRUCTOR
//=============================================================================
//_____________________________________________________________________________
// Default constructor.
Force::Force()
{
    setNull();
    constructProperties();
}
// Construct with supplied contact parameters.
ElasticFoundationForce::ElasticFoundationForce(ContactParameters* params)
{
	constructProperties();
    addContactParameters(params);
}
// Default constructor.
ElasticFoundationForce::ElasticFoundationForce()
{
	constructProperties();
}
// Default constructor.
ElasticFoundationForce::ContactParameters::ContactParameters()
{
    constructProperties();
}
Пример #14
0
MarkersReference::MarkersReference() : Reference_<SimTK::Vec3>()
{
    constructProperties();
    setAuthors("Ajay Seth");
}