new Field()
Field
Parameters:
| Type | Description |
|---|---|
| module:field.FieldInitOption |
Methods
-
_bop(other, bopFn, bopName) → {Field}
-
Returns a new field that holds the result of binary operation.
Parameters:
Name Type Description otherNumber | Field | Array A number, a field of same nfens and dim or an array of length this.dim(). bopFnField~bopFn binary operation function. bopNameString binary operation name, which will make better error message. 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 otherNumber | Field | Array A number, a field of same nfens and dim or an array of length this.dim(). Returns:
- Sum of this and other.- Type
- Field
-
at(idx) → {Vector:this.dim()}
-
Get value at index.
Parameters:
Name Type Description idxNumber index, 0-based Returns:
- Type
- Vector:this.dim()
-
bop(other, bopFn) → {Field}
-
Returns a new field that holds the result of binary operation.
Parameters:
Name Type Description otherNumber | Field | Array A number, a field of same nfens and dim or an array of length this.dim(). bopFnField~bopFn binary operation function. Returns:
Result field.- Type
- Field
-
clone() → {Feild}
-
Returns an identical copy, preserves boundary conditions.
Returns:
- Type
- Feild
-
dim() → {Number}
-
Returns dimension of the field.
Returns:
- Type
- Number
-
div(other) → {Field}
-
Returns a new field of the point-wise division. No boudary conditions are preserved.
Parameters:
Name Type Description otherNumber | Field | Array A number, a field of same nfens and dim or an array of length this.dim(). 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 indexNumber integer index of the node, 0-based. directionNumber dimension index, 0-based. Returns:
- equation number, 0-based.- Type
- Number
-
gatherEqnumsVector(conn) → {Array}
-
Returns gathered eqnum numbers in an js array.
Parameters:
Name Type Description connArray connectiviy vector. 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 connArray connectiviy vector. 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 connArray connectiviy vector. 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 indexNumber integer index of the node, 0-based. directionNumber dimension index, 0-based. Returns:
- Type
- Boolean
-
map(fn) → {Field}
-
Returns a new transformed field by given mapping. No boudary conditions are preserved.
Parameters:
Name Type Description fnField~mapCallback The mapping function that maps a vector to another vector. Returns:
- Type
- Field
-
mul(other) → {Field}
-
Returns a new field of the point-wise multiplication. No boudary conditions are preserved.
Parameters:
Name Type Description otherNumber | Field | Array A number, a field of same nfens and dim or an array of length this.dim(). Returns:
- muliplication of this and other.- Type
- Field
-
neqns() → {Number}
-
Returns number of equations
Returns:
- Type
- Number
-
nfens()
-
Returns number of nodes in the field.
Returns:
-
pointset() → {PointSet}
-
Returns pointset object for visualization.
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 indexNumber integer index of the node, 0-based. directionNumber dimension index, 0-based. Returns:
- Type
- Number
-
scatterSystemVector_(vec) → {Field}
-
Scatter values to field. Returns updated field.
Parameters:
Name Type Description vecArray js array of length this.neqns(); 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 indexNumber integer index of the node, 0-based. dirNumber dimension index. 0-based. valNumber value. -
sub(other) → {Field}
-
Returns a new field of the point-wise substraction. No boudary conditions are preserved.
Parameters:
Name Type Description otherNumber | Field | Array A number, a field of same nfens and dim or an array of length this.dim(). Returns:
- substraction of this and other.- Type
- Field
-
values() → {Array}
-
Returns the values as 2d js array.
Returns:
- Type
- Array