Commit 0ca9eca2 authored by Benoît LÉ's avatar Benoît LÉ

Modifications to take into account modifications in xFastMarching

Corresponding to commit 362685b2ca in Xfiles.
parent 045ec045
......@@ -85,14 +85,14 @@ void FastMarchingReinit(std::function<double (AOMD::mVertex*)> get_val,
xfastmarching::entitystorage<xfastmarching::meshinterfacexRegion, AOMD::mVertex, xfastmarching::vector3d<double> > gls(mi);
for(auto it=known_begin; it!=known_end; ++it) {
auto v=static_cast<AOMD::mVertex*>(*it);
ls.set(*v, get_val(v));
ls.setData(*v) = get_val(v);
}
for(auto it=known_volatil_begin; it!=known_volatil_end; ++it) {
auto v=static_cast<AOMD::mVertex*>(*it);
ls.set(*v, get_val(v));
ls.setData(*v) = get_val(v);
}
for(auto it=tofind_begin; it!=tofind_end; ++it) {
ls.set(*static_cast<AOMD::mVertex*>(*it), std::numeric_limits<double>::max());
ls.setData(*static_cast<AOMD::mVertex*>(*it)) = std::numeric_limits<double>::max();
}
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_begin(known_begin);
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> trial_known_conv_end(known_end);
......@@ -102,9 +102,8 @@ void FastMarchingReinit(std::function<double (AOMD::mVertex*)> get_val,
xfastmarching::fmeik<datamanagerFM_t>(mi, ls, trial_known_conv_begin, trial_known_conv_end,trial_known_volatil_conv_begin, trial_known_volatil_conv_end, known_conv_it, f_func, epsilon_ratio, gls);
for(auto it=region.begin(0); it!=region.end(0); ++it) {
auto v=static_cast<AOMD::mVertex*>(*it);
double val;
ls.get(*v, val);
set_val(v, val);
double * val = ls.getData(*v);
set_val(v, *val);
}
#endif
}
......@@ -132,13 +131,13 @@ void FastMarchingModeExtension(std::function<double (AOMD::mVertex*)> get_val,
int i=0;
for(auto it=known_begin; it!=known_end; ++it, ++i) {
auto v=static_cast<AOMD::mVertex*>(*it);
ls.set(*v, get_val(v));
ls.setData(*v) = get_val(v);
modesValues mv(nb_modes, 0.);
mv[i]=1.;
vn.set(*v, mv);
vn.setData(*v) = mv;
}
for(auto it=tofind_begin; it!=tofind_end; ++it) {
ls.set(*static_cast<AOMD::mVertex*>(*it), std::numeric_limits<double>::max());
ls.setData(*static_cast<AOMD::mVertex*>(*it)) = std::numeric_limits<double>::max();
}
const std::set<const AOMD::mVertex*> empty;
xfastmarching::entitytovertexiteratorconvertor<ITERKNOWN> known_conv_begin(known_begin);
......@@ -152,13 +151,11 @@ void FastMarchingModeExtension(std::function<double (AOMD::mVertex*)> get_val,
int j=0;
for(auto it=region.begin(0); it!=region.end(0); ++it, ++j) {
auto v=static_cast<AOMD::mVertex*>(*it);
double val;
ls.get(*v, val);
set_val(v, val);
modesValues mv;
vn.get(*v, mv);
double * val = ls.getData(*v);
set_val(v, *val);
modesValues * mv = vn.getData(*v);
for(int i=0; i<nb_modes; ++i) {
coeffs(i,j)=mv[i];
coeffs(i,j)=(*mv)[i];
}
}
#endif
......
......@@ -341,7 +341,7 @@ void QSFormulRemeshAniso::buildLSAdaptationField(){
tls_solver.getField().getVals(v, vals);
//ls.set(*static_cast<AOMD::mVertex*>(v), vals[0]);
ls.set(*static_cast<AOMD::mVertex*>(v), 0);
ls.setData(*static_cast<AOMD::mVertex*>(v)) = 0;
//v->print();
// double val_;
......@@ -362,15 +362,13 @@ void QSFormulRemeshAniso::buildLSAdaptationField(){
for(xIter it = geom.begin(0, "local"); it != geom.end(0, "local"); ++it){
auto v=*it;
double val;
ls.get(*static_cast<AOMD::mVertex*>(v), val);
lsetAdapt(v) = -val;
double * val = ls.getData(*static_cast<AOMD::mVertex*>(v));
lsetAdapt(v) = -*val;
}
for(xIter it = geom.begin(0, "int_nonlocal"); it != geom.end(0, "int_nonlocal"); ++it){
auto v=*it;
double val;
ls.get(*static_cast<AOMD::mVertex*>(v), val);
lsetAdapt(v) = val;
double * val = ls.getData(*static_cast<AOMD::mVertex*>(v));
lsetAdapt(v) = *val;
}
post_pro.exportOnSpace("lsAdapt",Observer::tell<int>("step"),lsetAdapt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment