diff --git a/input/Bones1D/common.txt b/input/Bones1D/common.txt index 5c8ac5b0a4b31c21ef0cf22ca969c05740c78d49..90195d391fc3d37b84cfa697108d1e790d22246a 100644 --- a/input/Bones1D/common.txt +++ b/input/Bones1D/common.txt @@ -6,7 +6,8 @@ configuration = line_acquisition parametrization = natural model_reference_frequency = 1. # -receiver_on_emitter = 1 +reflection = 1 +transmission = 0 xer = 0.5 L = 6. # diff --git a/input/Bones1D/synthetic.txt b/input/Bones1D/synthetic.txt index 19445a64bcdb4a4ab423946b02a86061fb6f6e09..b7f962f2e998b706ebf1f39cfe18e9add9da8454 100644 --- a/input/Bones1D/synthetic.txt +++ b/input/Bones1D/synthetic.txt @@ -19,6 +19,6 @@ Re(mi2c0) = 1.3 Im(mi2c0) = 0. # #Output -write_model_fields = 0 +write_model_fields = 1 write_wave_fields = 0 write_data_fields = 0 diff --git a/inversion.cpp b/inversion.cpp index c900fb633ef624bc09244a3e1e2712b5b86e3ea7..54b18e1a50b921585fa69a852e8e47e80c85202c 100644 --- a/inversion.cpp +++ b/inversion.cpp @@ -104,6 +104,7 @@ int inversion(const GmshFem& gmshFem) } else { + freq_idx.resize(n_freq); for (unsigned int f = 0; f < n_freq; f++) { std::string suffix_f = std::to_string(f); diff --git a/specific/configuration/line_acquisition.cpp b/specific/configuration/line_acquisition.cpp index abd673245418716fd9355cc4c25219ee3c0927a1..37d0386a34bb74ce9cb8efdae495d0b45beb2f05 100644 --- a/specific/configuration/line_acquisition.cpp +++ b/specific/configuration/line_acquisition.cpp @@ -86,9 +86,12 @@ namespace line_acquisition } } - unsigned int r_on_e = 0; - gmshFem.userDefinedParameter(r_on_e, "receiver_on_emitter"); - _receiver_on_emitter = ((bool) r_on_e); + unsigned int reflec = 1; + unsigned int trans = 1; + gmshFem.userDefinedParameter(reflec, "reflection"); + gmshFem.userDefinedParameter(trans, "transmission"); + _reflection = ((bool) reflec); + _transmission = ((bool) trans); mesh(); @@ -135,16 +138,25 @@ namespace line_acquisition _ns = 2; _emitter.push_back({0}); _emitter.push_back({1}); - if(_receiver_on_emitter) + if(_reflection && _transmission) { _receiver.push_back({0,1}); - _receiver.push_back({0,1}); + _receiver.push_back({1,0}); } - else + else if(_reflection) + { + _receiver.push_back({0}); + _receiver.push_back({1}); + } + else if (_transmission) { _receiver.push_back({1}); _receiver.push_back({0}); } + else + { + throw common::Exception("Acquisistion must at least be transmission or reflection"); + } /* * Reference model function @@ -302,14 +314,22 @@ namespace line_acquisition template<Physic T_Physic> ModelMonoFunction green0_preconditioner(const Data<T_Physic>& dd, const WaveMultiField<T_Physic>& g, const Configuration* const config) { - if (config->receiver_on_emitter()) + if (config->transmission() && config->reflection()) { return pow(autocorrelate<T_Physic>(g,{0,1}),2); } - else + else if(config->reflection()) + { + return pow(autocorrelate<T_Physic>(g,{0}),2) + pow(autocorrelate<T_Physic>(g,{1}),2); + } + else if(config->transmission()) { return 2. * autocorrelate<T_Physic>(g,{0}) * autocorrelate<T_Physic>(g,{1}); } + else + { + throw common::Exception("Acquisistion must at least be transmission or reflection"); + } } template ModelMonoFunction green0_preconditioner<Physic::acoustic>(const Data<Physic::acoustic>&, const WaveMultiField<Physic::acoustic>&, const Configuration* const); diff --git a/specific/configuration/line_acquisition.h b/specific/configuration/line_acquisition.h index d0dfd76bf5da813d87798ba1242cf487a86be0f2..bc92e09e0323ab77da8f6f230ecb20b228898e8d 100644 --- a/specific/configuration/line_acquisition.h +++ b/specific/configuration/line_acquisition.h @@ -28,7 +28,8 @@ namespace line_acquisition { private: double _xer; - bool _receiver_on_emitter; + bool _reflection; + bool _transmission; double _L; @@ -51,7 +52,8 @@ namespace line_acquisition public: Configuration(std::string name, const ParametrizationInterface* const parametrization, const gmshfem::common::GmshFem& gmshFem); - bool receiver_on_emitter() const {return _receiver_on_emitter;}; + bool reflection() const {return _reflection;}; + bool transmission() const {return _transmission;}; virtual void mesh() const;