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

https://github.com/chunleili/nonNewtonCode
22 December 2023, 13:46:53 UTC
  • Code
  • Branches (2)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/cmake-fix
    • refs/heads/main
    No releases to show
  • a715a39
  • /
  • Tools
  • /
  • FoamGenerator
  • /
  • FoamKernel.h
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

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
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:30b289ebff2cbd39ad542addf1ebfe5745b8801e
origin badgedirectory badge Iframe embedding
swh:1:dir:99f3585d88d7f11119e8739f2b64a8a4f7030e18
origin badgerevision badge
swh:1:rev:645503d647115a39bb73e84b424a72611e535fa2
origin badgesnapshot badge
swh:1:snp:8d20debb81c7f94e8fdd49c807a95451a3476519

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
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 645503d647115a39bb73e84b424a72611e535fa2 authored by chunleili on 08 December 2023, 02:41:15 UTC
Add files via upload
Tip revision: 645503d
FoamKernel.h
#ifndef FOAMKERNEL_H
#define FOAMKERNEL_H

#define _USE_MATH_DEFINES
#include <math.h>
#include "SPlisHSPlasH/Common.h"

namespace SPH
{
	class FoamKernel
	{
	protected:
		static Real m_radius;
		static Real m_W_zero;
		static Real m_norm_fac;
	public:
		static Real getRadius() { return m_radius; }
		static void setRadius(Real val)
		{
			m_radius = val;
			//// The normalization factor is 1 divided by the integral over the kernel function.
			//// WolframAlpha code for 3D integral over kernel in spherical coordinates: int_0^(2pi) int_0^pi int_0^h ((1-r/h) r^2 sin(theta)) dr dtheta dphi
			//// r^2 sin(theta) is the Jacobian determinant, necessary for the transformation of the volume integral from Cartesian into spherical coordinates.
			//m_norm_fac = 1.0 / ((1.0 / 3.0) * M_PI * val * val * val);
			//m_W_zero = m_norm_fac;
			m_W_zero = 1.0;
		}

	public:
		static Real W(const Real r)
		{
			Real res = 0.0;
			const Real q = r / m_radius;
			if (q <= 1.0)
				//res = m_norm_fac * (1.0 - q);
				res = (static_cast<Real>(1.0) - q);
			return res;
		}

		static Real W(const Vector3r& r)
		{
			return W(r.norm());
		}

		static Real W_zero()
		{
			return m_W_zero;
		}
	};
}

#endif

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— Content policy— Contact— JavaScript license information— Web API