Options
All
  • Public
  • Public/Protected
  • All
Menu

Arch js library API - v0.0.1

Index

Math Type aliases

FlatTensors: number[]
brief

A flat array of Tensor, meaning the array is represented as [xx, xy, xz, yy, yz, zz ... xx, xy, xz, yy, yz, zz]



The number of Tensor is given by

const n = tensors.length/6

There's multiple ways to iterate over all Tensor:

for (let i=0; i<tensors.length; i += 6) {
const xx = vectors[i ]
const xy = vectors[i+1]
const xz = vectors[i+2]
const yy = vectors[i+3]
const yz = vectors[i+4]
const zz = vectors[i+5]
}

or

for (let i=0; i<tensors.length/6; i++) {
const xx = vectors[6*i ]
const xy = vectors[6*i+1]
const xz = vectors[6*i+2]
const yy = vectors[6*i+3]
const yz = vectors[6*i+4]
const zz = vectors[6*i+5]
}
FlatVectors: number[]
brief

A flat array of Vector, meaning the array is represented as [x, y, z ... x, y, z]



The number of Vector is given by

const n = vectors.length/3

There's multiple ways to iterate over all Vector:

for (let i=0; i<vectors.length; i += 3) {
const x = vectors[i ]
const y = vectors[i+1]
const z = vectors[i+2]
}

or

for (let i=0; i<vectors.length/3; i++) {
const x = vectors[3*i ]
const y = vectors[3*i+1]
const z = vectors[3*i+2]
}
FullTensor: [number, number, number, number, number, number, number, number, number]
brief

Represent a rank 2 non-symmetric tensor of size 3 (mostly to represent traction or displscement influence matrices). It is represented as a flat array of components with the orders [xx, xy, xz, yx, yy, yz, zx, zy, zz]

The representation is

Tensor: [number, number, number, number, number, number]
brief

Represent a rank 2 symmetric tensor of size 3 (mostly to represent stress and strain). It is represented as a flat array of components with the orders [xx, xy, xz, yy, yz, zz]

The representation is

Tensors: Tensor[]
brief

An array of Tensor, i.e., [[xx, xy, xz, yy, yz, zz] ... [xx, xy, xz, yy, yz, zz]]

Vector: [number, number, number]
brief

Represent a vector size 3. It is represented as a flat array of components with the orders [x, y, z]

Vectorb: [boolean, boolean, boolean]
brief

Represent a vector size 3 of boolean.

Vectord: number[]
brief

An array of number of any size

Vectors: Vector[]
brief

An array of Vector, i.e., [[x,y,z] ... [x,y,z]]

Other Type aliases

ConstraintFct: (t: number[], id: number) => number[]

Type declaration

    • (t: number[], id: number): number[]
    • Contraint Function signature

      Parameters

      • t: number[]

        an array of length 3 representing either the traction or the displacement vector

      • id: number

        The id of the triangle for the considered triangulated discontinuity (surface)

      Returns number[]

      an array of length 3 representing either the modified traction or displacement vector

FullTensor3: [[number, number, number, number, number, number, number, number, number], [number, number, number, number, number, number, number, number, number], [number, number, number, number, number, number, number, number, number]]
brief

Represent a rank 3 non-symmetric tensor of size 3 (mostly to represent traction or displasment influence matrices). It is represented as a flat array of components with the orders [xx, xy, xz, yx, yy, yz, zx, zy, zz]

@category Math

Remotes Type aliases

UserRemoteCB: (x: number, y: number, z: number) => Tensor

Type declaration

Solvers Type aliases

SolutionProgressCB: (position: number, value: number) => void

Type declaration

    • (position: number, value: number): void
    • Function callback for the onProgress method on Solution

      Parameters

      • position: number

        The current index

      • value: number

        The current percentage

        solver.run()
        const solution = new arch.Solution(model)
        solution.onProgress( (i,p) => {
        console.log(`nb-pts so far: ${i}, realized: ${p.toFixed(0)}%`))
        }
        solution.displ(positions)

      Returns void

SolverProgressCB: (position: number, value: number, context: number) => void

Type declaration

    • (position: number, value: number, context: number): void
    • Function callback for the onProgress method on Forward

      example
      const solver = new arch.Forward(model, 'seidel', 1e-9, 2000)
      solver.onMessage( c => console.log(c) )
      solver.onProgress( (i, c, context) => {
      if (context === 1) {
      console.log(`building system: ${c.toFixed(0)}%`)
      }
      else {
      console.log(`iter ${i}: residual ${c}`)
      }
      })

      Parameters

      • position: number

        The current iteration

      • value: number

        The current residual

      • context: number

        The context. 1 is for the matrix building. 2 is for the system solving.

      Returns void

Functions

  • license(): number
  • Get the remaining months for the arch library before to be obsolete and useless. We make the library obsolete after few months in order to force the user to use a more recent version. Therefore, sometime it can be necessary to purge the cache of the web-browser, or replace the node.js arch-library by a new one.

    Returns number

    The number of valid months