private void Initialize() { StartMeasuringTaskTime("Initialization"); var rectangle = new Rectangle(0, 1, 0, 1); mesh = new Mesh(127, 127, rectangle); interiorNodesCount = mesh.InteriorNodes.Count(); var boundaryNodesCount = mesh.BoundaryNodes.Count(); A = new Matrix(interiorNodesCount, interiorNodesCount); Ag = new Matrix(interiorNodesCount, boundaryNodesCount); var cg = new double[boundaryNodesCount]; { int i = 0; foreach (var boundaryNode in mesh.BoundaryNodes) { cg[i] = g(boundaryNode.Position); i++; } } boundary = new Vector(cg); ShowMeshParameters(mesh); StopAndShowTaskTime("Initialization"); }
private void ShowMeshParameters(Mesh mesh) { Console.WriteLine($"Number of interior vertices: {mesh.InteriorNodes.Count()}"); Console.WriteLine($"Number of boundary vertices: {mesh.BoundaryNodes.Count()}"); Console.WriteLine($"Number of finite elements: {mesh.FiniteElements.Count()}"); }