Class: Field

field. Field

new Field()

Field
Parameters:
Type Description
module:field.FieldInitOption
Source:

Methods

_bop(other, bopFn, bopName) → {Field}

Returns a new field that holds the result of binary operation.
Parameters:
Name Type Description
other Number | Field | Array A number, a field of same nfens and dim or an array of length this.dim().
bopFn Field~bopFn binary operation function.
bopName String binary operation name, which will make better error message.
Source:
Returns:
Result field.
Type
Field

add(other) → {Field}

Returns a new field of the point-wise sumation. No boudary conditions are preserved.
Parameters:
Name Type Description
other Number | Field | Array A number, a field of same nfens and dim or an array of length this.dim().
Source:
Returns:
- Sum of this and other.
Type
Field

at(idx) → {Vector:this.dim()}

Get value at index.
Parameters:
Name Type Description
idx Number index, 0-based
Source:
Returns:
Type
Vector:this.dim()

bop(other, bopFn) → {Field}

Returns a new field that holds the result of binary operation.
Parameters:
Name Type Description
other Number | Field | Array A number, a field of same nfens and dim or an array of length this.dim().
bopFn Field~bopFn binary operation function.
Source:
Returns:
Result field.
Type
Field

clone() → {Feild}

Returns an identical copy, preserves boundary conditions.
Source:
Returns:
Type
Feild

dim() → {Number}

Returns dimension of the field.
Source:
Returns:
Type
Number

div(other) → {Field}

Returns a new field of the point-wise division. No boudary conditions are preserved.
Parameters:
Name Type Description
other Number | Field | Array A number, a field of same nfens and dim or an array of length this.dim().
Source:
Returns:
- division of this and other.
Type
Field

eqnum(index, direction) → {Number}

Returns the eqnum number at node with given direction.
Parameters:
Name Type Description
index Number integer index of the node, 0-based.
direction Number dimension index, 0-based.
Source:
Returns:
- equation number, 0-based.
Type
Number

gatherEqnumsVector(conn) → {Array}

Returns gathered eqnum numbers in an js array.
Parameters:
Name Type Description
conn Array connectiviy vector.
Source:
Returns:
- an array of equation numbers of length this.dim()*conn.length.
Type
Array

gatherPrescirbedValues(conn) → {Array}

Returns gathered values in an 2d js array.
Parameters:
Name Type Description
conn Array connectiviy vector.
Source:
Returns:
- a 2d js array of values of dimension conn.length by this.dim().
Type
Array

gatherValuesMatrix(conn) → {Array}

Returns gathered values in an 2d js array.
Parameters:
Name Type Description
conn Array connectiviy vector.
Source:
Returns:
- a 2d js array of values of dimension conn.length by this.dim().
Type
Array

isPrescribed(index, direction) → {Boolean}

Returns whether node at given direction is prescribed.
Parameters:
Name Type Description
index Number integer index of the node, 0-based.
direction Number dimension index, 0-based.
Source:
Returns:
Type
Boolean

map(fn) → {Field}

Returns a new transformed field by given mapping. No boudary conditions are preserved.
Parameters:
Name Type Description
fn Field~mapCallback The mapping function that maps a vector to another vector.
Source:
Returns:
Type
Field

mul(other) → {Field}

Returns a new field of the point-wise multiplication. No boudary conditions are preserved.
Parameters:
Name Type Description
other Number | Field | Array A number, a field of same nfens and dim or an array of length this.dim().
Source:
Returns:
- muliplication of this and other.
Type
Field

neqns() → {Number}

Returns number of equations
Source:
Returns:
Type
Number

nfens()

Returns number of nodes in the field.
Source:
Returns:

pointset() → {PointSet}

Returns pointset object for visualization.
Source:
Returns:
Type
PointSet

prescribedValue(index, direction) → {Number}

Returns prescribed value of the node at given direction. Return 0 if the dof is not prescribed.
Parameters:
Name Type Description
index Number integer index of the node, 0-based.
direction Number dimension index, 0-based.
Source:
Returns:
Type
Number

scatterSystemVector_(vec) → {Field}

Scatter values to field. Returns updated field.
Parameters:
Name Type Description
vec Array js array of length this.neqns();
Source:
Returns:
- updated field.
Type
Field

setPrescribedValue_(index, dir, val)

Set prescribed value of the node at given direction. if the dof is not prescribed.
Parameters:
Name Type Description
index Number integer index of the node, 0-based.
dir Number dimension index. 0-based.
val Number value.
Source:

sub(other) → {Field}

Returns a new field of the point-wise substraction. No boudary conditions are preserved.
Parameters:
Name Type Description
other Number | Field | Array A number, a field of same nfens and dim or an array of length this.dim().
Source:
Returns:
- substraction of this and other.
Type
Field

values() → {Array}

Returns the values as 2d js array.
Source:
Returns:
Type
Array