This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from types import SimpleNamespace as SN | |
from scipy.sparse import csr_matrix as sparse | |
from scipy.sparse.linalg import spsolve | |
import meshio | |
def Mesh(npoints, a=0, b=1): | |
grid = np.linspace(a, b, npoints) | |
points = np.pad(grid[:, None], ((0, 0), (0, 2))) | |
cells = np.arange(npoints).repeat(2)[1:-1].reshape(-1, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from types import SimpleNamespace as SN | |
from scipy.sparse import csr_matrix | |
from scipy.sparse.linalg import spsolve | |
import matplotlib.pyplot as plt | |
def Cube(a=(0, 0, 0), b=(1, 1, 1), n=(2, 2, 2)): | |
grid = np.linspace(a[0], b[0], n[0]) | |
points = np.pad(grid[:, None], ((0, 0), (0, 2))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from types import SimpleNamespace as SN | |
from scipy.sparse import csr_matrix as sparse | |
from scipy.sparse.linalg import spsolve | |
import meshio | |
def Mesh(npoints, a=0, b=1): | |
grid = np.linspace(a, b, npoints) | |
points = np.pad(grid[:, None], ((0, 0), (0, 2))) | |
cells = np.arange(npoints).repeat(2)[1:-1].reshape(-1, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from types import SimpleNamespace as SN | |
from scipy.sparse import csr_array as sparray | |
from scipy.sparse.linalg import spsolve | |
import matplotlib.pyplot as plt | |
def Mesh(npoints): | |
points = np.linspace(0, 1, npoints) | |
cells = np.arange(len(points)).repeat(2)[1:-1].reshape(-1, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ | |
BEGIN BULK | |
$ | |
$ ELEMENT CONNECTIVITY ========================================================= | |
$ | |
CQUAD4 1 1 5 1 478 477 | |
CQUAD4 2 1 477 478 72 57 | |
CQUAD4 3 1 57 72 480 479 | |
CQUAD4 4 1 479 480 73 58 | |
CQUAD4 5 1 58 73 482 481 |