コード例 #1
0
ファイル: innblobs.cpp プロジェクト: rkube/feltor
void drawScene( const Solver& solver, target t, draw::RenderHostData& rend)
{
    ParticleDensity particle( solver.getField( TL_IMPURITIES), solver.blueprint());
    double max;
    const typename Solver::Matrix_Type * field;

    if( t == TL_ALL)
    {
        rend.set_multiplot(2,2);
        { //draw electrons
        field = &solver.getField( TL_ELECTRONS);
        visual = field->copy(); 
        map.scale() = fabs(*std::max_element(visual.begin(), visual.end()));
        rend.renderQuad( visual, field->cols(), field->rows(), map);
        window_str << scientific;
        window_str <<"ne / "<<map.scale()<<"\t";
        }

        { //draw Ions
        typename Solver::Matrix_Type ions = solver.getField( TL_IONS);
        particle.linear( ions, solver.getField( TL_POTENTIAL), ions, 0 );
        visual = ions.copy();
        rend.renderQuad( visual, field->cols(), field->rows(), map);
        window_str <<" ni / "<<map.scale()<<"\t";
        }

        if( solver.blueprint().isEnabled( TL_IMPURITY))
        {
            typename Solver::Matrix_Type impurities = solver.getField( TL_IMPURITIES);
            particle.linear( impurities, solver.getField(TL_POTENTIAL), impurities, 0 );
            visual = impurities.copy(); 
            map.scale() = fabs(*std::max_element(visual.begin(), visual.end()));
            rend.renderQuad( visual, field->cols(), field->rows(), map);
            window_str <<" nz / "<<max<<"\t";
        }
        else
            rend.renderEmptyQuad();

        { //draw potential
        typename Solver::Matrix_Type phi = solver.getField( TL_POTENTIAL);
        particle.laplace( phi );
        visual = phi.copy(); 
        map.scale() = fabs(*std::max_element(visual.begin(), visual.end()));
        rend.renderQuad( visual, field->cols(), field->rows(), map);
        window_str <<" phi / "<<max<<"\t";
        }
    }
    else
    {
        rend.set_multiplot(1,1);
        field = &solver.getField( t);
        visual = field->copy(); 
        map.scale() = fabs(*std::max_element(visual.begin(), visual.end()));
        rend.renderQuad( visual, field->cols(), field->rows(), map);
        window_str << scientific;
        window_str <<"Max "<<max<<"\t";
    }

        
}
コード例 #2
0
ファイル: interactive.cpp プロジェクト: Gregor1981/feltor
void drawScene( const Solver& solver, draw::RenderHostData& rend)
{
    const typename Solver::Matrix_Type * field;
    
    { //draw electrons
    field = &solver.getField( toefl::ELECTRONS);
    visual = field->copy(); 
    map.scale() = fabs(*std::max_element(visual.begin(), visual.end()));
    rend.renderQuad( visual, field->cols(), field->rows(), map);
    window_str << std::scientific;
    window_str <<"ne / "<<map.scale()<<"\t";
    }

    { //draw Ions
    field = &solver.getField( toefl::IONS);
    visual = field->copy();
    //upper right
    rend.renderQuad( visual, field->cols(), field->rows(), map);
    window_str <<" ni / "<<map.scale()<<"\t";
    }

    if( solver.blueprint().imp)
    {
        field = &solver.getField( toefl::IMPURITIES); 
        visual = field->copy();
        map.scale() = fabs(*std::max_element(visual.begin(), visual.end()));
        //lower left
        rend.renderQuad( visual, field->cols(), field->rows(), map);
        window_str <<" nz / "<<map.scale()<<"\t";
    }
    else
        rend.renderEmptyQuad( );

    { //draw potential
    field = &solver.getField( toefl::POTENTIAL); 
    visual = field->copy(); 
    map.scale() = fabs(*std::max_element(visual.begin(), visual.end()));
    rend.renderQuad( visual, field->cols(), field->rows(), map);
    window_str <<" phi / "<<map.scale()<<"\t";
    }
        
}