⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multiadaptivepreconditioner.cpp

📁 Dolfin provide a high-performance linear algebra library
💻 CPP
字号:
// Copyright (C) 2005-2006 Anders Logg.// Licensed under the GNU LGPL Version 2.1.//// First added:  2005-01-27// Last changed: 2006-07-07#include <dolfin/uBlasVector.h>#include <dolfin/Method.h>#include <dolfin/MultiAdaptiveTimeSlab.h>#include <dolfin/MultiAdaptivePreconditioner.h>using namespace dolfin;//-----------------------------------------------------------------------------MultiAdaptivePreconditioner::MultiAdaptivePreconditioner(MultiAdaptiveTimeSlab& timeslab, const Method& method) : ts(timeslab), method(method){  // Do nothing}//-----------------------------------------------------------------------------MultiAdaptivePreconditioner::~MultiAdaptivePreconditioner(){  // Do nothing}//-----------------------------------------------------------------------------void MultiAdaptivePreconditioner::solve(uBlasVector& x,					const uBlasVector& b) const{  // Reset dof  uint j = 0;  // Iterate over all elements  for (uint e = 0; e < ts.ne; e++)  {    // Get initial value for element    const int ep = ts.ee[e];    const real x0 = ( ep != -1 ? x(ep*method.nsize() + method.nsize() - 1) : 0.0 );    // Propagate value on element    for (uint n = 0; n < method.nsize(); n++)      x(j + n) = x0 + b(j + n);    // Update dof    j += method.nsize();  }}//-----------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -