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

  • c9cdf94
  • /
  • R
  • /
  • setup.compaction.1D.R
Raw File Download

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
swh:1:cnt:9f636279c408ba8d60c4e75e5961b6ce15c69366
directory badge
swh:1:dir:ea81c1bd99d45a5de927f2a33db1e3540a6d20a0

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 ...
setup.compaction.1D.R

##==============================================================================
## Calculates the advective velocities assuming steady state compaction
##==============================================================================

setup.compaction.1D <- function(v.0 = NULL, v.inf = NULL,
	 por.0, por.inf, por.grid) {

## check input
  gn <- names(por.grid)
  if (! "mid"  %in% gn)
    stop("error in setup.prop: porosity should be a list that contains mid")
  if (! "int"  %in% gn)
    stop("error in setup.prop: porosity should be a list that contains int")

  if (is.null(v.0) && is.null(v.inf))
    stop("error in setup.advection: either the sedimentation velocity <v.0> or the burial velocity <v.inf> should be specified")

## calculate velocities at infinity

  if (is.null(v.inf)) { # sedimentation velocity is specified
  	v.factor <-  v.0*(1-por.0)
  	v.inf <- v.factor/(1-por.inf)
  	u.inf <- v.inf
  	u.factor <-  u.inf*por.inf
  } else { # burial velocity is specified
  	v.factor <-  v.inf*(1-por.inf)
	  v.0 <- v.factor/(1-por.0)
  	u.inf <- v.inf
	  u.factor <-  u.inf*por.inf
	}

  v.mid <- v.factor/(1-por.grid$mid)
  v.int <- v.factor/(1-por.grid$int)

  u.mid <- u.factor/por.grid$mid
  u.int <- u.factor/por.grid$int

  Res <- list(u = list(mid=u.mid,int=u.int), v=list(mid=v.mid,int=v.int))
  class(Res) <- "compaction.1D"
  return(Res)
}

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