Ejemplo n.º 1
0
Archivo: ns.hpp Proyecto: LANTZT/feelpp
void
Navierstokes::exportResults( double time, element_type& U )
{
    auto u = U.element<0>();
    auto p = U.element<1>();

    auto v = V.element<0>();
    auto q = V.element<1>();
#if defined( FEELPP_USE_LM )
    auto lambda = U.element<2>();
    auto nu = V.element<2>();
    LOG(INFO) << "value of the Lagrange multiplier lambda= " << lambda( 0 ) << "\n";

#endif

    double div_u_error_L2 = normL2( _range=elements( u.mesh() ), _expr=divv( u ) );
    LOG(INFO) << "[navierstokes] ||div(u)||_2=" << div_u_error_L2 << "\n";

    if ( exporter->doExport() )
    {
        exporter->step( time )->setMesh( U.functionSpace()->mesh() );
        exporter->step( time )->addRegions();
        exporter->step( time )->add( {"u","p","l"}, U );
        exporter->save();
    }

} // NavierStokes::export
Ejemplo n.º 2
0
void
AdvectionDiffusion::exportResults( element_type& U , parameter_type const& mu )
{

    if ( M_do_export )
    {
        LOG(INFO) << "exportResults starts\n";

        std::string exp_name;
        export_ptrtype exporter;
        std::string mu_str;

        for ( int i=0; i<mu.size(); i++ )
        {
            mu_str= mu_str + ( boost::format( "_%1%" ) %mu[i] ).str() ;
        }

        exp_name = "solution_with_parameters_" + mu_str;

        exporter = export_ptrtype( Exporter<mesh_type>::New( "ensight", exp_name  ) );
        exporter->step( 0 )->setMesh( U.functionSpace()->mesh() );
        exporter->step( 0 )->add( "u", U );
        exporter->save();
    }
} // AdvectionDiffusion::export
Ejemplo n.º 3
0
void
ConvectionCrb::solve( sparse_matrix_ptrtype& D,
              element_type& u,
              vector_ptrtype& F )
{

    vector_ptrtype U( M_backend->newVector( u.functionSpace() ) );
    M_backend->solve( D, D, U, F );
    u = *U;
}
Ejemplo n.º 4
0
void
Beam<nDim,nOrder>::exportResults( double time, element_type const& u, element_type const &v  )
{
    timers["export"].first.restart();

    exporter->step( time )->setMesh( u.functionSpace()->mesh() );
    exporter->step( time )->add( "displ", u );
    exporter->step( time )->add( "P", v );
    exporter->save();
    timers["export"].second = timers["export"].first.elapsed();
} // Beam::export
Ejemplo n.º 5
0
void
Microphone::exportResults( element_type& U )
{
    if ( M_do_export )
    {
        LOG(INFO) << "exportResults starts\n";

        exporter->step( 0 )->setMesh( U.functionSpace()->mesh() );

        exporter->step( 0 )->add( "u", U );

        exporter->save();
    }
} // Microphone::export
Ejemplo n.º 6
0
void
AnisotropicWavespeed::exportResults( element_type& U )
{
    if ( M_do_export )
    {
        LOG(INFO) << "exportResults starts\n";

        exporter->step( 0 )->setMesh( U.functionSpace()->mesh() );

        exporter->step( 0 )->add( "u", U );

        exporter->save();
    }
} // AnisotropicWavespeed::export
Ejemplo n.º 7
0
void DrivenCavity<Dim>::exportResults( element_type const& U )
{
    auto uex=unitX();
    auto u_exact=vf::project(Vh->template functionSpace<0>(), markedfaces(mesh, "wall2"), uex );

    if ( exporter->doExport() )
    {
        exporter->step( 0 )->setMesh( U.functionSpace()->mesh() );
        exporter->step( 0 )->addRegions();
        exporter->step( 0 )->add( "u", U.template element<0>() );
        exporter->step( 0 )->add( "p", U.template element<1>() );
        exporter->step( 0 )->add( "uex", u_exact);
        exporter->save();
    }

}