A CPP code developed to solve 1D pure-diffusion problem in FEM using continuous Galerkin method.
void Gauss(int N, double a, double * qp, double * wq)
assigns values to qp
and wq
.
double Polybasis(const int °ree, int i, int der, double &x)
returns specific value of Lagrange-shape function.
double Func_source(const double &x)
returns value of
double Func_exact(const double &x)
returns value of exact solution but not used.
double Func_exact_x(const double &x)
returns value of 1st derivative of exact solution but not used.
- Run
mkdir build
underFEM-1D_CG_CPP/
to create a new directory. - Run
cd build
to step in the new directory. - Run
cmake ..
to createmakefile
usingCMakeLists.txt
from upper directory. - Run
make
to create an executable file named1D_CG_CPP
. - Run
./1D_CG_CPP
.