Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 9d1ee36
  • /
  • pySPlisHSPlasH
  • /
  • VorticityModule.cpp
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:4d24bd523338ed510979c186c1349e51eed3d746
directory badge Iframe embedding
swh:1:dir:39b20ac81eeac3e59492345b4b824b0a458280c6
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
VorticityModule.cpp
//
// Created by sjeske on 1/28/20.
//
#include "common.h"

#include <pybind11/pybind11.h>
#include <pybind11/eigen.h>

#include <SPlisHSPlasH/Common.h>
#include <SPlisHSPlasH/NonPressureForceBase.h>
#include <SPlisHSPlasH/Vorticity/VorticityBase.h>
#include <SPlisHSPlasH/Viscosity/Viscosity_Bender2017.h>
#include <SPlisHSPlasH/Vorticity/MicropolarModel_Bender2017.h>
#include <SPlisHSPlasH/Vorticity/VorticityConfinement.h>

namespace py = pybind11;

void VorticityModule(py::module m_sub) {
    // ---------------------------------------
    // Vorticity Base
    // ---------------------------------------
    py::class_<SPH::VorticityBase, SPH::NonPressureForceBase>(m_sub, "VorticityBase")
            .def_readwrite_static("VORTICITY_COEFFICIENT", &SPH::VorticityBase::VORTICITY_COEFFICIENT);

    // ---------------------------------------
    // Vorticity Bender 2017
    // ---------------------------------------
    py::class_<SPH::MicropolarModel_Bender2017, SPH::VorticityBase>(m_sub, "MicropolarModel_Bender2017")
            .def_readwrite_static("VISCOSITY_OMEGA", &SPH::MicropolarModel_Bender2017::VISCOSITY_OMEGA)
            .def_readwrite_static("INERTIA_INVERSE", &SPH::MicropolarModel_Bender2017::INERTIA_INVERSE)

            .def(py::init<SPH::FluidModel*>())
            .def("getAngularAcceleration", (const Vector3r& (SPH::MicropolarModel_Bender2017::*)(const unsigned int)const)&SPH::MicropolarModel_Bender2017::getAngularAcceleration)
            // .def("getAngularAcceleration", (Vector3r& (SPH::MicropolarModel_Bender2017::*)(const unsigned int))&SPH::MicropolarModel_Bender2017::getAngularAcceleration) // TODO: wont work by reference
            .def("setAngularAcceleration", &SPH::MicropolarModel_Bender2017::setAngularAcceleration)
            .def("getAngularVelocity", (const Vector3r& (SPH::MicropolarModel_Bender2017::*)(const unsigned int)const)&SPH::MicropolarModel_Bender2017::getAngularVelocity)
            // .def("getAngularVelocity", (Vector3r& (SPH::MicropolarModel_Bender2017::*)(const unsigned int))&SPH::MicropolarModel_Bender2017::getAngularVelocity) // TODO: wont work by reference
            .def("setAngularVelocity", &SPH::MicropolarModel_Bender2017::setAngularVelocity);

    // ---------------------------------------
    // Vorticity Bender 2017
    // ---------------------------------------
    py::class_<SPH::VorticityConfinement, SPH::VorticityBase>(m_sub, "VorticityConfinement")
            .def(py::init<SPH::FluidModel*>())
            .def("getAngularVelocity", (const Vector3r& (SPH::VorticityConfinement::*)(const unsigned int)const)&SPH::VorticityConfinement::getAngularVelocity)
            // .def("getAngularVelocity", (Vector3r& (SPH::VorticityConfinement::*)(const unsigned int))&SPH::VorticityConfinement::getAngularVelocity) // TODO: wont work by reference
            .def("setAngularVelocity", &SPH::VorticityConfinement::setAngularVelocity);
}

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API