首页 > > 详细

data讲解、C++编程设计调试、讲解C++语言、辅导program解析C/C++编程|解析Java程序

NS_ass_5_June_2020.docx 1
Numerical solutions assessment 5, June 2020
This is the fifth and final Numerical Solutions assessment. It is worth 40% of the total mark available for this
module. The deadline for submission is Sunday 28th June 2020 by 23:59. Please submit a .pdf and a .zip to
BlackBoard. This assessment is an individual assessment.
Solving the Poisson equation on a non-rectangular grid
Let Ω ⊆ ℝ
2 be a connected subset of ℝ
2 with boundary Γ = 𝜕Ω. The 2-dimensional Poisson equation takes
the form
is the Laplace operator, 𝑓 ∶ Ω → ℝ is a source term, 𝑐 ∶ Ω → ℝ is the function to be
determined, and a boundary condition on Γ is supplied. The C++ application PDE_Poisson_FD_v5 solves
the 2-dimensional Poisson equation numerically on a rectangular domain Ω with either Dirichlet or Neumann
boundary conditions.
For the assessment you must write and test an application that can solve the 2-dimensional Poisson
equation for general domains Ω ⊆ ℝ
2 with Dirichlet boundary conditions. You may if you choose base your
code on PDE_Poisson_FD_v5, adapting it to the requirements of this assessment.
You may assume that
i) Ω is a compact subset of ℝ
2 with a single component.
ii) For every 𝑥 ∈ Ω ∃ an open ball 𝐶𝑥 ⊆ Ω with 𝑥 ∈ 𝐶𝑥, the closure of 𝐶𝑥 in ℝ2.
Condition (ii) means that ‘Ω is everywhere two dimensional,’ that is, every point in Ω is either an internal
point or is ‘next to’ an internal point: Ω contains no isolated 1-dimensional line segments.
Let 𝑑1 be the final digit in your JNU ID and 𝑑2
the penultimate digit. Let 𝑟𝑖 = (𝑑𝑖 + 1)/3 and 𝑠𝑖 =
(𝑑𝑖 + 3)/4. Use your code to value the PDEs with:
domain Ω𝑖, 𝑖 = 1,2,3, each ofi) Ω1. The area enclosed by the points
𝑃1 = {(2,4), (4,4), (4,3), (5,3), (5,2), (4,2), (4,1), (2,1), (1,2), (1,3)}.
See Figure 1. This is a fish shape.
ii) Ω2. The area enclosed by the points
𝑃2 = {(1,5), (5,5), (5,1), (1,1), (2,4), (4,4), (4,2), (2,2)}.
See Figure 2. This is a hollow square having a square hole in the middle.
iii) Ω3 = {(𝑥, 𝑦) ∈ ℝ2| (𝑥 − 1)2 + (𝑦 − 1)2 ≤ 1}, a disk of radius 1 centred at (1,1);
source term 𝑓𝑖, 𝑖 = 1,2, each ofa) 𝑓1(𝑥, 𝑦) = 𝑟1 + 𝑥 sin 𝑦;b) 𝑓2
(𝑥, 𝑦) = 𝑟2 + 𝑥𝑒
𝑦;
and Dirichlet boundary condition 𝑏𝑖∶ Γ → ℝ, 𝑖 = 1,2, each of1) 𝑏1(𝑥, 𝑦) = sin(𝑥𝑦) − 𝑠1;2) 𝑏2(𝑥, 𝑦) = 𝑦𝑒𝑥 − 𝑠2;
yielding 12 combinations in all.
Figure 2. Ω2
NS_ass_5_June_2020.docx 2
For the discretization you may assume if you wish a grid composed of rectangular elements. It may be
helpful to form a gird on a rectangle enclosing Ω𝑖
, then discard points that are not required
In each case comment on the accuracy of your numerical solution. You should apply your code with different
mesh sizes to explore the convergence properties. Comment on any difficulties that you encounter with
particular combinations.
You will be assessed on
a) The degree to which your code has the required functionality.
b) Your assessment and discussion of the accuracy of your numerical solutions.
c) The quality of your code in terms of functionality, readability, maintainability, clarity,
efficiency, sophistication, generalizability, and general presentation.
d) The presentational quality of the report as a whole.
The submission
You must submit two files: (a) a report in .pdf format and (b) a .zip file containing code.
The report, as a single pdf file, must contain:
i) A brief description of your implementation
ii) The results of your valuations.
iii) An assessment of the accuracy of your numerical solutions.
iv) A code listing.
For parts(ii) and (iii) you may wish to include graphical or tabular representations. Between them, parts (i),
(ii), and (iii) should be less than five sides excluding plots, tables, and displayed equations.
If you base your code on PDE_Poisson_FD_v5 you need list only (a) code that you have ‘touched’
for example the new objects you have written, and objects of mine that you have altered, and (b) sufficient
other application code so that I can understand the programme flow through your application. If in doubt as
to what you should or should not include in your listing, please contact me. The code listing must follow the
module guidelines.
The zip file must contain your C++ code according to the module guidelines. Your application code must be
object oriented with a clear client interface. The code you submit must be the complete application, able to
run without addition or modification with DevCpp on my standard Windows laptop. The .zip must contain
only the .cpp, .h, and .dev files (plus, if used, any I/O files).
Nick Webber
June 2020

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!