Skip to content
Snippets Groups Projects
Commit 1e1a0e99 authored by Xavier Adriaens's avatar Xavier Adriaens
Browse files

up sequential,flooding and surface acuqi

parent 4d1fe2b3
No related branches found
No related tags found
No related merge requests found
...@@ -207,7 +207,7 @@ namespace surface_acquisition ...@@ -207,7 +207,7 @@ namespace surface_acquisition
} }
gmsh::merge(path+suffix+".pos"); gmsh::merge(path+suffix+".pos");
ScalarFunction<std::complex<double>> mpos = probeScalarView<std::complex<double>>(0); ScalarFunction<std::complex<double>> mpos = probeScalarView<std::complex<double>>(c);
m0.addFunction(mpos,_subsurface[Support::BLK] | _subsurface[Support::BND] ); m0.addFunction(mpos,_subsurface[Support::BLK] | _subsurface[Support::BND] );
} }
......
...@@ -24,6 +24,11 @@ namespace flooding ...@@ -24,6 +24,11 @@ namespace flooding
{ {
throw Exception("Regularization order could not be found."); throw Exception("Regularization order could not be found.");
} }
if(_p<0.5)
{
throw Exception("Flooding regularization parameter p could not be smaller than 0.5.");
}
}; };
double Regularization::performance(const ModelField& m) double Regularization::performance(const ModelField& m)
...@@ -33,7 +38,7 @@ namespace flooding ...@@ -33,7 +38,7 @@ namespace flooding
{ {
ScalarFunction<std::complex<double>> mz = yComp(grad(m[c])); ScalarFunction<std::complex<double>> mz = yComp(grad(m[c]));
ScalarFunction<std::complex<double>> f = (abs(mz) - mz) / 2.; ScalarFunction<std::complex<double>> f = (abs(mz) - mz) / 2.;
out += _lambda[c] * integrate( pow(f,2*_p) / 2. / _p, _config->model_unknown(Support::BLK), integrationType(_integrationDegreeBlk) ); out += _lambda[c] * integrate( pow(f,2.*_p) / 2. / _p, _config->model_unknown(Support::BLK), integrationType(_integrationDegreeBlk) );
} }
return std::real(out); return std::real(out);
} }
...@@ -46,7 +51,15 @@ namespace flooding ...@@ -46,7 +51,15 @@ namespace flooding
ScalarFunction<std::complex<double>> f = (abs(mz) - mz) / 2.; ScalarFunction<std::complex<double>> f = (abs(mz) - mz) / 2.;
ScalarFunction<std::complex<double>> partition = heaviside< std::complex< double > >( -mz ); ScalarFunction<std::complex<double>> partition = heaviside< std::complex< double > >( -mz );
VectorFunction< std::complex< double > > integrand = vector< std::complex< double > >(0.,-partition * pow(f,2*_p-1),0.); VectorFunction< std::complex< double > > integrand;
if(_p==0.5)
{
integrand = vector< std::complex< double > >(0.,-partition,0.);
}
else
{
integrand = vector< std::complex< double > >(0.,-partition * pow(f,2.*_p-1.),0.);
}
switch (support) switch (support)
{ {
......
...@@ -162,8 +162,11 @@ namespace sequential ...@@ -162,8 +162,11 @@ namespace sequential
for (sq = 0; sq < _n_seq; sq++) for (sq = 0; sq < _n_seq; sq++)
{ {
std::string suffix1 = std::to_string(sq); std::string suffix1 = std::to_string(sq);
if (_type != "none")
{
msg::print << "--- Sequence #" << suffix1 << ": " << _seq_parameters[sq] << " --- " << msg::endl; msg::print << "--- Sequence #" << suffix1 << ": " << _seq_parameters[sq] << " --- " << msg::endl;
msg::indent(); msg::indent();
}
if (_type == "none"){} if (_type == "none"){}
else if(_type=="innerproduct_strength") else if(_type=="innerproduct_strength")
...@@ -185,7 +188,7 @@ namespace sequential ...@@ -185,7 +188,7 @@ namespace sequential
rel_djs = 2. * (js_1-js) / (js_1+js); rel_djs = 2. * (js_1-js) / (js_1+js);
msg::print << "relative decrease = " << rel_djs << msg::endl; msg::print << "relative decrease = " << rel_djs << msg::endl;
historyline.emplace_back(js,rel_djs,_seq_parameters[sq],statefunctional->performance_objective(),statefunctional->performance_regularization()); historyline.emplace_back(js,rel_djs,_seq_parameters[sq],statefunctional->performance_objective(),statefunctional->performance_regularization());
msg::unindent(); if (_type != "none"){msg::unindent();}
} }
success=true; success=true;
_history->emplace_back(success,sq,historyline); _history->emplace_back(success,sq,historyline);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment