EIT-team / PEITS

Fast forward solver for EIT
6 stars 3 forks source link

Proper Calling PEITS from Octave with EIDORS fmdl Structure #12

Closed ca-ja closed 5 years ago

ca-ja commented 5 years ago

Hi there, I am trying to prepare a call the PEITS solver from octave, where an input is the EIDORS fmdl structure (see fmdl_cyl.mat in the attached zip file) with cylinder equipped by circular electrodes. After executing my code (see call_peits.m in the attached zip file), I have received the following error:

octave:8> out = call_peits('JOB1'); Warning: Unable to read parameter file '../data/parameter' Error: ParameterNotFound [map:/home/jc/PEITS_root/PEITS/dune-fem-1.4.0/dune/fem/io/parameter.hh:734]: Parameter 'electrode.use_node_assignment' not found. Warning: Unable to read parameter file '../data/parameter' Error: ParameterNotFound [map:/home/jc/PEITS_root/PEITS/dune-fem-1.4.0/dune/fem/io/parameter.hh:734]: Parameter 'electrode.use_node_assignment' not found. ...

I would like to ask for advice. Are all parameters in the right place? In a summary, I have the following files in the directory PEITS_root/PEITS/data/

standardparams parameter current_protocol_3Dcyl.txt electrode_nodes_3Dcyl.txt param_3Dcyl 3Dcyl.dgf

which are also part of the attached zip file: call_peits.zip

Thank you in advance for any advice.

tdowrick commented 5 years ago

Hi,

Can you copy & paste the contents of your standardparams and parameter files?

Thanks

Jimbles commented 5 years ago

hey, it looks like it is having a problem reading your electrode.use_node_assignment which is part of the param3Dcyl file. which is specified in the parameter file with the line `paramfile: ../data/param$(mesh) double check this is in the correct place. If you are using the Nodes to assign the electrodes, then I think you need to double check your param_3Dcyl as you need the equivalent line to thiselectrode.nodes: ../data/electrode_nodes_TA052_meters`

Jimbles commented 5 years ago

also, check out the functions run_forward_solver.m and write_parameter_files.m as these already allow you to write the parameter files and run call the forward solver

ca-ja commented 5 years ago

Hi,

Can you copy & paste the contents of your standardparams and parameter files?

Thanks

Ok, here it is:

_~/PEITSroot/PEITS/data/standardparams ################# Verbosity ###################### # number of process that prints output (-1 no output) fem.verboserank: 0 # true for iteration output, false means no output fem.solver.verbose: false # write vtk file with solution to first current input write.vtk: false # write petsc matrix to matlab readable file - this only works in serial output.write_matrix: false # print electrode voltages during execution output.print_electrode_voltages: false # write all electrode potentials or only measured voltage? fem.io.write_only_measured_voltage: true # shift average voltage fem.solver.shift_average: false

##### conductivity settings ####### # uniform conductivity? fem.uniform_conductivity: true fem.uniform_conductivity_value: 1 # WHETHER CONDUCTIVITY OF MESH FILE IS USED OR CONDUCTIVITIES # ARE ASSIGNED ACCORDING TO LAYER NUMBERING IS SPECIFIED IN THE MESH PARAMETER FILES

##### electrode settings ##### contact.impedance: 0.01 input.current: 0.01 electrode.diameter: 200 electrode.diameter_file: ../data/electrode_diameters_TA052.txt #set this to "none" if you do not want to specify individual diameters

##### Parameters for preconditioned linear solver # preconditioning method: none, ssor, sor, ilu-0, ilu-n, gauss-seidel, jacobi, amg-ilu-0 istl.preconditioning.method: ilu-0 istl.preconditioning.iterations: 1 istl.preconditioning.relaxation: 1.2 # enable simple Jacobi preconditioning (for non istl inverse operators) fem.preconditioning: true

##### Parameters for output ###### # path for output fem.prefix: ../output # time interval for data output fem.io.savestep: 0.1 # number of calls to write() after which a file is produced fem.io.savecount: 1 # output format (vtk-cell, vtk-vertex, sub-vtk-cell, sub-vtk-vertex, gnuplot) fem.io.outputformat: vtk-cell # also print partitioning for parallel runs fem.io.partitioning: rank #true

##### Problem setup parameter ##### poisson.problem: EIT

_~/PEITSroot/PEITS/data/parameter ### has to be set to 1 / true fem.resolvevariables: 1

########## Include Standard Settings ############## paramfile: ../data/standardparams

######### Parameters for input/output ############# fem.io.loadPartitions: false fem.io.meshPath: ../data/ fem.io.partitionPath: ../partitions/ fem.io.do_elec_volts: true fem.io.do_jacobian: true fem.io.do_electrode_jacobian: false fem.io.outputpath: ../output/

# Meshes mesh: 3Dcyl #mesh: unitcube-3d # Cube for debugging => before using it you have to edit the electrode assignment in src/electrodehelpers.hh and build it again

# Separate conductivity file: this file assigns a conductivity value to each finite element fem.io.load_sigma_separately: false fem.io.separate_sigma_file: none

# Conductivities: this file encodes the conductivity values for different tissues conductivities: ../data/conductivities

### include special parameter file for the mesh ### paramfile: ../data/param_$(mesh)

########## how to make solution unique ############ ground.node: true ground.epsmass: false

############### PETSc settings ################### # Preconditioners are: "none", "asm", "sor", "jacobi", "hypre", "ml"; SERIAL: "ilu-n", "lu", "icc"; DIRECT SOLVERS: "mumps", "superlu" petsc.preconditioning.method: hypre

# Solvers are: "cg" , "bicg", "bicgstab", "gmres" petsc.kspsolver.method: cg

# tolerance for linear solver poisson.solvereps: 1e-12

# maximum iterations for linear solver poisson.solveriter: 10000

############### Current Protocol #################

current.protocol: ../data/current_protocol.txt # one entry

current.protocol: ../data//home/jc/PEITS_root/PEITS/data/current_protocol_3Dcyl.txt

current.protocol: ../data/current_protocol_cube.txt # for the cube test

################# Perturbation ################## mesh.perturbation: false mesh.perturbation.multORabs: true mesh.perturbation.value: 1.5 mesh.perturbation.radius: 10 mesh.perturbation.pos_x: 0 mesh.perturbation.pos_y: 0 mesh.perturbation.pos_z: 0

_~/PEITS_root/PEITS/data/param3Dcyl ##### Parameters for 3Dcyl ##### # no. elements: 11675 # no. nodes: 2846 #

fem.io.macroGrid: 3Dcyl.dgf

electrode.use_node_assignment: true

electrode.positions: none

/home/jc/PEITS_root/PEITS/data/electrode_nodes_3Dcyl.txt surface.coordinates: none

ground.hsquared: 1.5e-5 groundposition.x: -0.093853611626754596 groundposition.y: 0.230431191864336193 groundposition.z: 0.000000000000000000

Jimbles commented 5 years ago

I think the param_3Dcyl is where the error is. The line /home/jc/PEITS_root/PEITS/data/electrode_nodes_3Dcyl.txt is the problem, if its not a comment or an expected parameter, I dont think PEITS can read the whole file properly. You can use the matab functions in the matlab folder in this repo to double check your function writes files in the correct format.

electrode.use_node_assignment: true

electrode.positions: none

/home/jc/PEITS_root/PEITS/data/electrode_nodes_3Dcyl.txt  -- this one
surface.coordinates: none
ca-ja commented 5 years ago

hey, it looks like it is having a problem reading your electrode.use_node_assignment which is part of the param3Dcyl file. which is specified in the parameter file with the line `paramfile: ../data/param$(mesh) double check this is in the correct place. If you are using the Nodes to assign the electrodes, then I think you need to double check your param_3Dcyl as you need the equivalent line to thiselectrode.nodes: ../data/electrode_nodes_TA052_meters`

Thank you Jimbles. I have found the first two mistakes. There is missing electrode.nodes: in my _param3Dcyl file and a bad path to current protocol in the parameter file. I have already fix them. Nevertheless, above-mentioned error persists.

So, the line with link to the file with electrode nodes in the _param3Dcyl file is: electrode.nodes: /home/jc/PEITS_root/PEITS/data/electrode_nodes_3Dcyl.txt In this file, there are nodes for each electrode on the separate line (separated by a comma). I guess that it is the correct format, according to a file _electrode_nodes_TA052meters. Which Matlab function for a double check of the electrode nodes did you mean?

Jimbles commented 5 years ago

Hey,

There are two files run_forward_solver.m and write_parameter_files.m which call PEITS from matlab, I think they should write everything including the nodes file. You could also try ignoring the nodes assignment, and instead using the electrode locations - this will check if it is reading the correct file at least. Are you calling PEITS from the correct directory from within matlab?

Also the line current.protocol: ../data//home/jc/PEITS_root/PEITS/data/current_protocol_3Dcyl.txt needs fixing in your parameter file

ca-ja commented 5 years ago

Hey,

There are two files run_forward_solver.m and write_parameter_files.m which call PEITS from matlab, I think they should write everything including the nodes file. You could also try ignoring the nodes assignment, and instead using the electrode locations - this will check if it is reading the correct file at least. Are you calling PEITS from the correct directory from within matlab?

Also the line current.protocol: ../data//home/jc/PEITS_root/PEITS/data/current_protocol_3Dcyl.txt needs fixing in your parameter file

Oh yes. The problem was in the wrong location from which I called PEITS. My stupid mistake ... I am already playing with PEITS.

Thank you very much.

Jimbles commented 5 years ago

No problem! I've done it myself a few times, thats why I thought to suggest it 👍 PEITS could be nicer with its error messages tbf. I'm glad you are able to starting playing around with it. I'll keep this issue open in case something else doesnt make sense. Please let us know your results