brainstorm-tools / bst-duneuro

Brainstorm-Duneuro integration
GNU General Public License v3.0
5 stars 2 forks source link

Error: geometry adaption needs dune-subgrid? #3

Open ftadel opened 4 years ago

ftadel commented 4 years ago

Input files: tmp.zip

Error message:

DUNEURO> Installation path: C:\Users\franc\.brainstorm\bst_duneuro\bin\bst_duneuro_meeg_win64.exe
DUNEURO> Writing temporary files to: C:\Users\franc\.brainstorm\tmp
DUNEURO> Detected parameter: GeometryAdapted=true
DUNEURO> System call: "C:\Users\franc\.brainstorm\bst_duneuro\bin\bst_duneuro_meeg_win64.exe" "C:\Users\franc\.brainstorm\tmp\duneuro_minifile.mini"
DUNEURO> Error log:
Dune reported error: Dune::Exception [make_meeg_driver:/home/juan/bst-duneuro/src/duneuro/duneuro/meeg/meeg_driver_factory_impl.hh:203]: geometry adaption needs dune-subgrid
ftadel commented 4 years ago

FYI: I removed the GeometryAdapted parameter from the interface, and instead detect it from the FEM mesh file, either from the parameters string if available, or directly from the geometry: https://github.com/brainstorm-tools/brainstorm3/commit/698b2c383ed32f5ed2d38235d29b308fe7275bc1

    if isfield(FemMat, 'History') && ~isempty(FemMat.History) && ~isempty(strfind([FemMat.History{:,3}], 'NodeShift'))
        strOptions = [FemMat.History{:,3}];
        iTag = strfind(strOptions, 'NodeShift');
        val = sscanf(strOptions(iTag:end), 'NodeShift=%f');
        if ~isempty(val)
            GeometryAdapted = (val > 0);
        end
    end
    % Otherwise, try to guess based on the geometry
    if isempty(GeometryAdapted)
        % Compute the distance between the first two nodes of each element
        dist = sqrt(sum([FemMat.Vertices(FemMat.Elements(:,1),1) - FemMat.Vertices(FemMat.Elements(:,2),1), ...
         FemMat.Vertices(FemMat.Elements(:,2),2) - FemMat.Vertices(FemMat.Elements(:,2),2), ...
         FemMat.Vertices(FemMat.Elements(:,2),3) - FemMat.Vertices(FemMat.Elements(:,2),3)] .^ 2, 2));
        % If the distance is not constant: then the geomtry is adapted
        GeometryAdapted = (max(abs(dist - dist(1))) > 1e-9);
    end
tmedani commented 4 years ago

Input files: tmp.zip

Error message:

DUNEURO> Installation path: C:\Users\franc\.brainstorm\bst_duneuro\bin\bst_duneuro_meeg_win64.exe
DUNEURO> Writing temporary files to: C:\Users\franc\.brainstorm\tmp
DUNEURO> Detected parameter: GeometryAdapted=true
DUNEURO> System call: "C:\Users\franc\.brainstorm\bst_duneuro\bin\bst_duneuro_meeg_win64.exe" "C:\Users\franc\.brainstorm\tmp\duneuro_minifile.mini"
DUNEURO> Error log:
Dune reported error: Dune::Exception [make_meeg_driver:/home/juan/bst-duneuro/src/duneuro/duneuro/meeg/meeg_driver_factory_impl.hh:203]: geometry adaption needs dune-subgrid

@juangpc did you have the same errors when you tested the application the 'eeg_transfer_cg_0000.ini' or 'eeg_transfer_cg_0002.ini'?

juangpc commented 4 years ago

No, when testing with 0001.ini but I've never tested it with 0002.ini?

Do we need this? I could try to add the dune-subgrid module.

tmedani commented 4 years ago

No, when testing with 0001.ini but I've never tested it with 0002.ini?

Do we need this? I could try to add the dune-subgrid module.

Hey Juan, yes please, it seems that with the geometry adaptation the subgrid module is required.

I have checked on their fieldtrip-duneuro workshop and they used geometry adapted.

I will double-check with Sophie.

juangpc commented 4 years ago

Hi, As we saw yesterday, in order to have the geometry adapted we need to add this subgrid module to the whole compilation process.

I tried yesterday until late to try to have the thing running... and... it was an error after another. the meta-programming kills me man. they auto and template like mad. The module uses boost (a well known computational c++ library) so now you need to install that to in order to compile it. And thee problem is that the include calls are different for gcc, clang, etc... so I'll need a few more sed calls...

I'll keep on trying... but it will take me a few days. I'll try to update soon.

tmedani commented 4 years ago

hey Juan,

I know how it's complicated to solve it.

We can submit an issue to Dune/Duneuro git lab and we can have an orientation to solve it.

juangpc commented 4 years ago

I'm already working on it. Already solved many compilation errors. But more keep popping. do you know if this module is used at all? There are many compilation errors. some could be related to clang... but others I'm not so sure.

tmedani commented 4 years ago

no idea at all ...

it's weird since it's not on the dune repo as the others.

I will ask the Germans' team.

tmedani commented 4 years ago

I'm already working on it. Already solved many compilation errors. But more keep popping. do you know if this module is used at all? There are many compilation errors. some could be related to clang... but others I'm not so sure.

@juangpc do you have any updates on this error?

thanks

chr-engwer commented 4 years ago

I tried yesterday until late to try to have the thing running... and... it was an error after another. the meta-programming kills me man. they auto and template like mad. The module uses boost (a well known computational c++ library) so now you need to install that to in order to compile it.

I'm sure it does not use boost.

do you know if this module is used at all?

yes, Carsten (Gräser) is using it on a regular basis and some people here use it also in their duneuro pipeline.