Mesh¶
-
mozart.mesh.rectangle.interval(a, b, M, degree)[source]¶ Generates mesh information on an interval [a,b].
- Parameters
a(float) : coordinate of left-end point of the intervalb(float) : coordinate of right-end point of the intervalM(int) : the number of elementsdegree(int) : polynomial degree for the approximate solution
- Returns
c4n(float array) : coordinates for nodesn4e(int array) : nodes for elementsn4db(int array) : nodes for Dirichlet boundaryind4e(int array) : indices for elements
- Example
>>> c4n, n4e, n4db, ind4e = interval(0,1,4,2) >>> c4n array([ 0. , 0.125, 0.25 , 0.375, 0.5 , 0.625, 0.75 , 0.875, 1. ]) >>> n4e array([[0, 2], [2, 4], [4, 6], [6, 8]]) >>> n4db array([0, 8]) >>> ind4e array([[0, 1, 2], [2, 3, 4], [4, 5, 6], [6, 7, 8]])
-
mozart.mesh.rectangle.unit_interval(N)[source]¶ Computes the coordinates of nodes and elements.
- Parameters
N(int) : Number of nodes
- Returns
c4n(float array) : coordinates of nodesn4e(int array) : elements
- Example
>>> c4n, n4e = unit_interval(4) >>> c4n array([ 0. , 0.33333333, 0.66666667, 1. ]) >>> n4e array([[0, 1], [1, 2], [2, 3]])