Options
All
  • Public
  • Public/Protected
  • All
Menu

A surface, or surface discontinuity, is an active object which will pertubed displacement, strain and stress field around it. Surface discontinuities can represent different type of geological objects such as faults, diapirs or magma chambers.

To access computed values on Surface, see the Solution class, or use the method Surface.displ

A Surface is part of a Arch Model.

If you want to switch from the Okada to Poly3D convention, you will have to use the BurgerFilter class.

Hierarchy

  • Surface

Index

Constructors

  • brief

    Create a Surface discontinuity given an array representing the flat positions of the vertices and an array representing the indices of the triangles.

    example
    const arch = require('./arch')

    // Create a surface made of one triangle
    const surface = new arch.Surface([0,0,0, 1,0,0, 1,1,0], [0,1,2])



    If you have access to the YouWol library @youwol/io, then it is possible to load Gocad surfaces directly from files.

    example
    const fs = require('fs') // 'filesystem' from node.js
    const io = require('@youwol/io')
    const arch = require('./arch')

    const model = new arch.Model()

    const objects = io.decodeGocadTS( fs.readFileSync(filename, 'utf8') )
    objects.forEach( object => {
    const vertices = object.positions
    const triangles = object.indices
    const surface = new arch.Surface(vertices, triangles)
    model.addSurface(surface)
    })

    Parameters

    • position: FlatVectors

      The vertices coordinates in flat array

    • index: FlatVectors

      The triangles indices in flat array

    Returns Surface

Methods

  • brief

    Add a pre-defined or a user-defined constraint to this surface

    default

    None There's no constraint

    see

    Constraint

    Parameters

    Returns void

  • Change the geometry of the discontinuities

    Parameters

    • position: FlatVectors

      The new position of the vertices making the discontinuities

    Returns any

  • displ(local: boolean, atTriangles: boolean): FlatVectors
  • brief

    Get the imposed or the computed (after solving the model) displacement vectors on this Surface as a flat array (also called Burger's vectors). Note that this attribute is provided at triangles, not at vertices. This is why you have the second parameter atTriangles

    see

    Solution.burgers

    example
    // Get the displacement field at nodes in global coordinate system
    const displ = surface.displ(false, false)

    // Iterating first way
    for (let i=0; i<displ.length; i+=3) { // notice the increment since the array is flat
    console.log(displ[i], displ[i+1], displ[i+2])
    }

    // Iterating second way
    for (let i=0; i<displ.length/3; i++) {
    console.log(displ[3*i], displ[3*i+1], displ[3*i+2])
    }

    Parameters

    • local: boolean

      True if you want displacement vectors in local coordinate system (e.g., to display iso-contours on the surface), false for the global coordinate system (e.g., if you want to deform the surface according to the displacement field)

    • atTriangles: boolean

      True if you want the returned displacement field to be at triangles, otherwise it will be defined (interpolated) at vertices (e.g., if you want to deform the surface according to the displacement field)

    Returns FlatVectors

    A flat array of displacement vectors

  • displMinus(local: boolean, atTriangles: boolean, delta: number): FlatVectors
  • brief

    Get the computed displacement discontinuity on the negative side of the triangles. If you do the substraction of displPlus and displMinus, you should retrieve displ

    see

    displPlus

    see

    Solution.burgersMinus

    Parameters

    • local: boolean

      Local or global coordinate system (default true)

    • atTriangles: boolean

      Compute at triangle center, at vertices otherwise (default true)

    • delta: number

      A small value called epsilon (default 1e-7)

    Returns FlatVectors

    A flat vector

  • displPlus(local: boolean, atTriangles: boolean, delta: number): FlatVectors
  • brief

    Get the computed displacement discontinuity on the positive side of the triangles. If you do the substraction of displPlus and displMinus, you should retrieve displ

    see

    displMinus

    see

    Solution.burgersPlus

    Parameters

    • local: boolean

      Local or global coordinate system (default true)

    • atTriangles: boolean

      Compute at triangle center, at vertices otherwise (default true)

    • delta: number

      A small value call epsilon (default 1e-7)

    Returns FlatVectors

    A flat vector

  • forEachTriangle(cb: (t: Triangle, i: number) => void): void
  • Iterate over all Triangle making this Surface.

    Example:

    surface.forEachTriangle( t => {
    console.log('area', t->area())
    console.log('displ', t->displ())
    })

    Parameters

    Returns void

  • forEachVertex(cb: (v: { index: number; position: number[] }, i: number) => void): void
  • Iterate over all vertices making this Surface.

    Example:

    surface.forEachVertex( v => {
    console.log(`vertex index ${v.index} has position ${v.position}`)
    })

    Parameters

    • cb: (v: { index: number; position: number[] }, i: number) => void
        • (v: { index: number; position: number[] }, i: number): void
        • Parameters

          • v: { index: number; position: number[] }
            • index: number
            • position: number[]
          • i: number

          Returns void

    Returns void

  • nbTriangles(): number
  • Returns number

  • nbVertices(): number
  • Returns number

  • brief

    Get the normals as a FlatArray

    Returns FlatVectors

  • resetDispl(): any
  • Reset displacement to zero

    Returns any

  • seismicMoment(): number
  • Compute the seismic moment of this surface, i.e., M0 = μ.S.Δu, with μ the shear modulus, S the area of the surface and Δu the mean displacement. The shear modulus is computed form the model Young's modulus and the Poisson's ratio.

    Returns number

  • setBC(axis: string | number, type: string, value: number | Function | Vectord): void
  • brief

    Set the boundary type and value for each axis of the triangles making a surface discontinuity.

    For instance, in Okada convention, setting, for the x-axis, the boundary condition type to traction and its value > 0 is equivalent to applying a "pressure".

    default

    Normal axis: type = locked and value = 0

    default

    Strike axis: type = free and value = 0

    default

    Dip axis: type = free and value = 0

    example
    const rho = 2100
    const g = 9.81

    // Make the surface to slip along the dip-direction only and allow opening
    // with internal pressure gradient
    surface.setBC("dip" , "free" , 0)
    surface.setBC("strike", "locked", 0)
    surface.setBC("normal", "free" , (x,y,z) => 1e3 + rho*g*z)

    Parameters

    • axis: string | number

      The axis index or the axis name. For axis index it can be either 0 for the normal direction, 1 for the strike direction or 2 for the dip direction. For the string value, it can be either x or normal, y or strike, z or dip.

    • type: string

      The type of boundary condition for the considered axis. For traction condition, value can be either t, 0, free, traction, neumann or unknown. All these values have the same meaning. For displacement condition, value can be either b, 1, displ, displacement, fixed, dirichlet, locked or imposed. All these values have the same meaning. When an axis is free, it means that the provided boundary value will a traction component (along the axis) since the displacement is unknown. Similarly, when the boundary condition is locked, the provided value is an imposed displacement along the axis.

    • value: number | Function | Vectord

      The boundary value for the considered axis. It can be either a number, a callback or an array of values for which the length shoud be equal to the number of triangles making the Surface. If, for a given axis, the condition is traction, then this initial value corrsponds to a traction value (i.e., pressure). On the other hand, if the condition id displacement, then this value corresponds to an imposed displacement.

      If the value is a callbak, then the signature is

      cb(x: number, y: number, z: number): number
      

      and for which (x,y,z) represents the center of the considered triangle.

    Returns void

  • setBCValues(value: number | number[]): void
  • brief

    Convenient method to set the boundary values directly using a FlatVectors. As we set the values for the 3 axis at the same time, it is obvious that the size of the array should be equal to the number of triangles, t, times 3: value.length === 3*t. If a number is provided, all axis of all the triangles will be set to this number.

    Parameters

    • value: number | number[]

    Returns void

  • setDisplFromTriangles(burgers: number[]): void
  • Set the slip vectors defined at triangles (no interpolation)

    Parameters

    • burgers: number[]

    Returns void

  • setDisplFromVertices(burgers: number[]): void
  • Set the slip vectors defined at vertices (interpolate)

    Parameters

    • burgers: number[]

    Returns void