From 5916d6a52512cbdb3b09388d845060b89c703f8a Mon Sep 17 00:00:00 2001 From: "V. Ferreira" Date: Thu, 26 Feb 2026 01:58:54 +0100 Subject: [PATCH] corrected gitignore and boundary conditions --- .gitignore | 1 + density.vtk | 2 +- electric_field.vtk | 2 +- nufi_poisson.cc | 19 +---- plotting.ipynb | 199 --------------------------------------------- 5 files changed, 6 insertions(+), 217 deletions(-) delete mode 100644 plotting.ipynb diff --git a/.gitignore b/.gitignore index 4d3d02d..48675b2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ CMakeCache.txt compile_commands.json CMakeFiles/ nufi_poisson +*.ipynb diff --git a/density.vtk b/density.vtk index 80de449..97aae28 100644 --- a/density.vtk +++ b/density.vtk @@ -1,5 +1,5 @@ # vtk DataFile Version 3.0 -#This file was generated by the deal.II library on 2026/2/24 at 3:42:25 +#This file was generated by the deal.II library on 2026/2/26 at 1:54:49 ASCII DATASET UNSTRUCTURED_GRID diff --git a/electric_field.vtk b/electric_field.vtk index cc32d28..f3ae802 100644 --- a/electric_field.vtk +++ b/electric_field.vtk @@ -1,5 +1,5 @@ # vtk DataFile Version 3.0 -#This file was generated by the deal.II library on 2026/2/24 at 3:42:25 +#This file was generated by the deal.II library on 2026/2/26 at 1:54:49 ASCII DATASET UNSTRUCTURED_GRID diff --git a/nufi_poisson.cc b/nufi_poisson.cc index 8d8c5fe..e37e707 100644 --- a/nufi_poisson.cc +++ b/nufi_poisson.cc @@ -119,16 +119,6 @@ private: const unsigned int Nv; }; -template -class BoundaryValues : public Function -{ -public: - virtual double value(const Point &p, - const unsigned int component = 0) const override - { - return 0.; // boundary value at periodic boundary - } -}; // =-=-=-=-= Poisson Solver =-=-=-=-= @@ -215,12 +205,9 @@ void PoissonProblem::setup_system() constraints.clear(); DoFTools::make_hanging_node_constraints(dof_handler, constraints); - // Homogeneous Dirichlet BC - VectorTools::interpolate_boundary_values( - dof_handler, - 0, - Functions::ZeroFunction(), - constraints); + // 'boundary' condition phi(x_0) = 0 + constraints.add_line(0); + constraints.set_inhomogeneity(0, 0.0); constraints.close(); diff --git a/plotting.ipynb b/plotting.ipynb deleted file mode 100644 index 8fb68f7..0000000 --- a/plotting.ipynb +++ /dev/null @@ -1,199 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "7a3ed0a3-d3a2-480b-b709-294d0ef8df12", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 1, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "\n", - "import pyvista as pv\n", - "from pyvista.trame.jupyter import launch_server\n", - "await launch_server().ready\n" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "3da886f4-3d0c-41f9-8a63-b6b6b1603fb0", - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "aa88a047e54c4ea7befbb1b0f6e71ec6", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "Widget(value='