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

Revision e1145574dc02ebe9e0d96419755e4702aef85172 authored by Karline Soetaert on 16 September 2010, 00:00:00 UTC, committed by Gabor Csardi on 16 September 2010, 00:00:00 UTC
version 1.3
1 parent 722dbd9
  • Files
  • Changes
  • a4433a4
  • /
  • 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.

  • revision
  • directory
  • content
revision badge
swh:1:rev:e1145574dc02ebe9e0d96419755e4702aef85172
directory badge
swh:1:dir:2eca10361e3e926cd8b6b743f141f7a1d200fdd8
content badge
swh:1:cnt:9f636279c408ba8d60c4e75e5961b6ce15c69366

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.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(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)
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, 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