- Author
- Feel++ Consortium
feelpp_doc_laplacian_dg
solves for the Laplacian in a square using a modal basis (Dubiner) using a DG formulation.
LaplacianDG_Implementation
the implementation is available in doc/manual/laplacian/laplacian_dg.cpp
using namespace Feel;
Environment env( _argc=argc, _argv=argv,
_about=about(_name="laplacian_dg",
_author="Feel++ Consortium",
_email="feelpp-devel@feelpp.org"));
auto Vh = Odh<1>( mesh );
auto Xh = Pch<1>( mesh );
auto u = Vh->element();
auto v = Vh->element();
auto l = form1( _test=Vh );
_expr=id(v));
auto a = form2( _trial=Vh, _test=Vh,
_expr=gradt(u)*trans(grad(v)) );
-averaget( gradt( u ) )*jump( id( v ) )
-average( grad( v ) )*jumpt( idt( u ) )
+ 50* ( trans( jumpt( idt( u ) ) )*jump( id( v ) ) )/hFace() );
( - trans( id( v ) )*( gradt( u )*N() )
- trans( idt( u ) )*( grad( v )*N() )
+ 50*trans( idt( u ) )*id( v )/hFace() ) );
a.solve(_rhs=l,_solution=u);
auto p = opProjection( _domainSpace=Xh, _imageSpace=Xh, _type=L2 );
auto uc = p->project( idv(u) );
auto e = exporter( _mesh=mesh );
e->add( "u", u );
e->add( "uc", uc );
e->save();