本文整理汇总了C++中GridFunction::GetFESpace方法的典型用法代码示例。如果您正苦于以下问题:C++ GridFunction::GetFESpace方法的具体用法?C++ GridFunction::GetFESpace怎么用?C++ GridFunction::GetFESpace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GridFunction
的用法示例。
在下文中一共展示了GridFunction::GetFESpace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Do
void NumProcEnergyCalc :: Do(LocalHeap & lh)
{
double result = 0;
double potential = 0;
double conversion = 1.602176565e-19 * 6.02214129e23 * 0.5 / 1000.0;
const BilinearFormIntegrator & bfi = (bfa) ? *bfa->GetIntegrator(0) : *gfu->GetFESpace().GetIntegrator();
const BilinearFormIntegrator & bfi2 = (bfa) ? *bfa->GetIntegrator(0) : *gfu->GetFESpace().GetIntegrator();
cout.precision(dbl::digits10);
for(unsigned int kk=0; kk<molecule.size(); kk++)
{
Atom currentAtom = molecule.at(kk);
point(0) = currentAtom.x;
point(1) = currentAtom.y;
point(2) = currentAtom.z;
FlatVector<double> pflux(bfi.DimFlux(), lh);
CalcPointFlux (ma, *gfu, point, domains,
pflux, bfi, applyd, lh, component);
result = pflux(0);
if (showsteps)
cout << "(" << pflux(0)*conversion;
CalcPointFlux (ma, *gfu0, point, domains,
pflux, bfi2, applyd, lh, component);
result -= pflux(0);
if (showsteps)
cout << " - " << pflux(0)*conversion << ")*" << currentAtom.charge << " = " << currentAtom.charge * result*conversion << endl;
potential += currentAtom.charge * result;
}
double energy;
energy = (1.602176565e-19 * 6.02214129e23 * 0.5 * potential)/1000;
if (MyMPI_GetNTasks() == 1 || MyMPI_GetId() != 0){
ofstream resultFile;
resultFile.open("result.out");
resultFile << "The energy difference is " << energy << " [kJ/mol].\n";
resultFile.close();
cout << "The energy difference is " << setprecision(12) << energy << " [kJ/mol].\n";
}
pde.GetVariable(variablename,true) = result;
}