Options
All
  • Public
  • Public/Protected
  • All
Menu

Allows to access to triangle features.

Example using the Model

let area = 0
model.forEachTriangle( (t) => {
area += y.area()
})

Example using the Surface

let area = 0
surface.forEachTriangle( (t) => {
area += y.area()
})

Hierarchy

  • Triangle

Index

Constructors

Methods

  • area(i: number): number
  • area(): number
  • Get the area of a triangle

    Parameters

    • i: number

    Returns number

  • Returns number

  • Get the boundary condition values of a triangle

    Parameters

    • i: number

    Returns Vector

  • Returns Vector

  • Get the boundary condition types of a triangle

    Parameters

    • i: number

    Returns Vector

  • Returns Vector

  • Get the center at triangle with id i. If no argument, get the center for the current triangle

    Parameters

    • i: number

    Returns Vector

  • Returns Vector

  • Get the current Burger's vector (imposed or computed) in local coordinate system. Useful for plotting iso-contours of a Burger's component

    Parameters

    • i: number

    Returns Vector

  • Returns Vector

  • Get the current Burger's vector (imposed or computed) in global coordinate system Useful for plotting streamlines or vectors

    Parameters

    • i: number

    Returns Vector

  • Returns Vector

  • dof(): number
  • Get the degree of freedom, i.e., the number of tractions.

    Returns number

  • hasSlipped(i: number): boolean
  • hasSlipped(): boolean
  • Check if a triangle has slipped

    example
    let nbSlipped = 0
    model.forEachTriangle( t => t.hasSlipped() ? nbSlipped++ : 0 )
    console.log('Nb slipped triangles', nbSlipped)

    Parameters

    • i: number

    Returns boolean

  • Returns boolean

  • Get the normal of a triangle

    Parameters

    • i: number

    Returns Vector

  • Returns Vector

  • setBc(axis: string, type: string, value: number): void
  • brief

    Set the boundary type and value.

    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
    model.forEachTriangle( t => t.setBc("dip", "free", 0) )
    

    Parameters

    • axis: string

      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

      The boundary value for the considered axis,

    Returns void

  • setDispl(axis: string, value: number): void
  • Set the displacement.

    Parameters

    • axis: string

      See setBc for the axis format

    • value: number

    Returns void

  • Transform a vector v in global coordinate system of the considered triangle

    Parameters

    Returns Vector

  • Parameters

    Returns Vector

  • Transform a vector v in local coordinate system of the considered triangle

    Parameters

    Returns Vector

  • Parameters

    Returns Vector