![]() ![]() pt_col : ndarray Coordinates of the colocation point. coords : ndarray, float Coordinates for the nodes. zeros (( nelems, nelems )) for ev_cont, elem1 in enumerate ( elems ): for col_cont, elem2 in enumerate ( elems ): pt_col = mean ( coords, axis = 0 ) if ev_cont = col_cont : L = norm ( coords ] - coords ]) Gmat = - L / ( 2 * pi ) * ( log ( L / 2 ) - 1 ) Fmat = - 0.5 else : Gij, Fij = influence_coeff ( elem1, coords, pt_col ) Gmat = Gij Fmat = Fij return Gmat, Fmat def influence_coeff ( elem, coords, pt_col ): """Compute influence coefficients Parameters - elems : ndarray, int Connectivity for the elements. Fmat : ndarray, float Influence matrix for primary variable. Returns - Gmat : ndarray, float Influence matrix for the flow. elems : ndarray, int Connectivity for the elements. import numpy as np from numpy import log, arctan2, pi, mean, arctan from numpy.linalg import norm, solve import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import meshio def assem ( coords, elems ): """Assembly matrices for the BEM problem Parameters - coords : ndarray, float Coordinates for the nodes. It includes a YML file to create a conda environment with the dependencies You can download the files for this project here. Rearranging to separate known and unknowns in opposite sides of the equation. For mixed Dirichlet-Neumann the influence matrices would need Keep in mind that this code works for purely Dirichlet ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |