The project aims to use Finite Element Method (FEM) to find numeric solutions for the 2D non-linear Poisson equation defined in the rectangle
i.e.
where
Note that
Neumann Boundary Condition is not considered in this project.
No dependencies other than your C++ compiler is needed.
To compile the code, go to the cloned directory and compile every .cpp file in the directory.
However, if you use a windows or mac operating system, there are releases.
The command may vary for different compilers. Here's the command for g++:
$ g++ -O3 -Wa,-mbig-obj -o your_executable *.cpp
Since the program requires intense calculation, you should always compile with the highest optimization level.
When you run the executable, give the directory of the configuration file as a command-line argument.
$ ./your_executable /path/to/your_config.xml
If you just want to use the template file datas.xml, use the command
$ ./your_executable datas.xml
At this point, you might be curious about how to configure the program to let it solve the equation you want. However, if you just want to play around with the program, skip this part.
The boundary conditions are specified through four lines, with line name="u_XY" and value="AAA-BBB,VAL1;CCC-DDD,VAL2". The first part "AAA-BBB,VAL1" representing the interval of the percentage AAA-BBB of nodes from X to Y set to VAL1.
The initial guess function
The absolute tolerance of error and relative tolerance of error are specified.
The directory of output file is given at the end.
The result must be stored as a vtk file, so that the output file directory must end with ".vtk".
Download ParaView to draw a diagram of the result. Simply load the output vtk file, and apply it. You will see a colored rectangle representing the result.