Python Program for IMT#
Environment setup#
The setup of FEniCS with Python is easier than for C++, you can follow the official installation guide here.
Run the code#
python xxx.py
mpirun -n 4 python xxx.py # running the code on 4 cores in parallel
Brief explanation of the code#
File VO2_GSBlockATP.py#
For the block gauss seidel preconditioner code, we group the variables in the Allen-Cahn equation, and the variables in the PNP equations. We then give the following order: the Allen-Cahn equation, temperature equation and the PNP equation. The Gauss Seidel block preconditioner uses the lower triangular blocks of the three system of equations.
Non-linear Solver: Newton solver
Linear solver: Preconditioner GMRES, the block preconditioner is inverted using a direct solver at this stage.
The code allows the following automation:
Choose adaptive time stepping by setting the varibale: adaptive_time = True
User can input time schedule using the list variable: time_schedule_custom
User can load time schedule from file: load_schedule, time_schedule_file - the time_schedule_file is read by the function read_in_time_schedule(filename)
Initialize solution with read-in solutions: load_initialization
File VO2_Nit_EfficAdap.py#
1. An efficient adaptive time-stepping scheme is used
Results Visualization#
The program generates solutions in pvd format that can be read and plot by ParaView. The solution files are:
Name |
Explanation |
---|---|
|
Time-dependent structural order parameter field |
|
Time-dependent electronic order parameter field |
|
Time-dependent electric potential |
|
Time-dependent temperature field |
|
Time-dependent electron density field |
|
Time-dependent hole density field |
|
Time-dependent transformed variable that corresponds to energy level of electrons |
|
Time-dependent transformed variable that corresponds to energy level of holes |
Each solution file listed above links to data at different moments. The data at a moment in turn links to data parallelly computed on distributed processors. The user can just use ParaView to read the .pvd
files and then follow the guide of ParaView to plot spatiotemporal fields.