Skip to content
Snippets Groups Projects
Select Git revision
  • ce07aaf8147cb5781f79efdc01e4b045693b5360
  • master default protected
  • overlaps_tags_and_distributed_export
  • overlaps_tags_and_distributed_export_rebased
  • relaying
  • alphashapes
  • patches-4.14
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

Camera.cpp

Blame
  • updater.cpp 1.71 KiB
    #include "updater.h"
    #include "../wave/updater.h"
    
    template<Physic T_Physic>
    void DataUpdater<T_Physic>::update(Type type, const ModelStateEvaluator& m)
    {
        if(_ds._isUpToDate[type]){return;}
    
        std::array<bool,4> waveNeedToBeUpToDate = {false,false,false,false};
        switch (type)
        {
            case Type::F:
                waveNeedToBeUpToDate[Type::F] = true;
                for (unsigned int f = 0; f < _nf; f++)
                {
                    _ds._state[type].value(f, (_wu[f].get(waveNeedToBeUpToDate,m)).state(type) );
                }
                break;
            case Type::A: case Type::D:
                update(Type::F,m);
                _ds._state[type] = _objective->update(type,_ds);
                break;
            case Type::PF:
                waveNeedToBeUpToDate[Type::PF] = true;
                for (unsigned int f = 0; f < _nf; f++)
                {
                    _ds._state[type].value(f, (_wu[f].get(waveNeedToBeUpToDate,m)).state(type) );
                }
                break;
            case Type::PA:
                update(Type::F,m);
                update(Type::PF,m);
                _ds._state[type] = _objective->update(type,_ds);
                break;
        }
    
        _ds._isUpToDate[type] = true;
    }
    
    template<Physic T_Physic>
    const DataStateEvaluator<T_Physic>& DataUpdater<T_Physic>::get(std::array<bool,5> needToBeUpToDate, const ModelStateEvaluator& m)
    {
        for (unsigned int t = 0; t < 5; t++)
        {
            Type type = ((Type) t);
            if(needToBeUpToDate[type]){update(type,m);}
        }
        return _ds;
    }
    
    template<Physic T_Physic>
    void DataUpdater<T_Physic>::isObsolete(std::array<bool,5> NoMoreUpToDate)
    {
        for (unsigned int t = 0; t < 5; t++)
        {
            if(NoMoreUpToDate[t]){_ds._isUpToDate[t] = false;}
        }
    }
    
    template class DataUpdater<Physic::acoustic>;