using namespace std;
using namespace gismo;
int main(
int argc,
char *argv[])
{
bool plot = false;
gsCmdLine cmd(
"Example for solving a convection-diffusion problem.");
cmd.addSwitch("plot", "Create a ParaView visualization file with the solution", plot);
try { cmd.getValues(argc,argv); } catch (int rv) { return rv; }
gsInfo<<
"Source function " << rhs <<
"\n";
gsInfo<<
"Dirichlet boundary conditions " << g <<
"\n\n";
string fileSrc( "planar/lshape2d_3patches_thb.xml" );
gsInfo <<
"The domain is a "<< patches <<
"\n";
patches.computeTopology();
bit = patches.bBegin(); bit != patches.bEnd(); ++bit)
{
}
int numInitUniformRefine = 2;
for (int i = 0; i < numInitUniformRefine; ++i)
bases.uniformRefine();
int numRefinementLoops = 3;
MarkingStrategy adaptRefCrit = PUCA;
const real_t adaptRefParam = 0.7;
cdrAss.options().setInt("DirichletValues",dirichlet::l2Projection);
for( int refLoop = 0; refLoop <= numRefinementLoops; refLoop++)
{
gsInfo <<
"====== Loop " << refLoop <<
" of "
<<numRefinementLoops<< " ======" << "\n";
cdrAss.assemble();
gsSparseSolver<>::BiCGSTABILUT( cdrAss.matrix() ).solve( cdrAss.rhs() );
solField = cdrAss.constructSolution(solVector);
gsExprEvaluator<>::geometryMap Gm = ev.
getMap(patches);
const std::vector<real_t> & eltErrs = ev.
elementwise();
std::vector<bool> elMarked( eltErrs.size() );
gsInfo <<
"Marked "<< std::count(elMarked.begin(), elMarked.end(),
true) <<
" elements.\n";
cdrAss.multiBasis().repairInterfaces( patches.interfaces() );
cdrAss.refresh();
if( plot && refLoop == numRefinementLoops )
{
gsWriteParaview<>( solField, "adaptRef", 1000, true);
}
}
if( plot )
{
}
else
{
gsInfo<<
"Done. No output created, re-run with --plot to get a ParaView "
"file containing Plotting image data.\n";
}
return EXIT_SUCCESS;
}