C++ code for 3D solar cell