Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrate current through an explicitly given rectangle #199

Open
lnw opened this issue Oct 9, 2018 · 12 comments
Open

integrate current through an explicitly given rectangle #199

lnw opened this issue Oct 9, 2018 · 12 comments

Comments

@lnw
Copy link
Contributor

lnw commented Oct 9, 2018

It's probably a combination of wrong input and missing input sanitation.

I intend to integrate the current that passes through a grid, and define the grid by giving an origin and base vectors:
calc=integral
...
Grid(std) {
type=even
origin=[18.0, 0.0, 0.0]
ivec=[1.0, 0.0, 0.0]
jvec=[0.0, 0.0, 1.0]
lengths=[26.0, 12.0, 0.0]
spacing=[0.05, 0.05, 0.05]
}

The job runs, and finishes without warnings.

In the output there is: 'Integration bound set to radius 0.0000000000000000', which is both stupid and fatal. For an std grid the radius should be irrelevant, and using a zero-radius leads to wrongs results. Specifically, in two jobs either the positive or the negative contribution to the integrated current is 0.0 (which is highly implausible).

Either my input is valid, then this is a bug, or my input is wrong, then it should be rejected with an error. Which of the two is it? How do I integrate the current through the above given grid.

@heikef
Copy link
Contributor

heikef commented Oct 9, 2018

When you do an integration you have to use the grid "bond".
Furthermore you define ivec as x and jvec as z but you give the length only for xy. This can not work.
Indeed the program does not assume the "worst possible user", one could call this a bug of course.... :)

@lnw
Copy link
Contributor Author

lnw commented Oct 9, 2018

I have to use the bond grid? That's inconvenient! And there should definitely be an error if someone chooses an invalid combination of grid/task, not just wrong results.
I was under the impression, that lengths are specified for i, j, k and not x, y, z. Is that wrong?
A program must always assume the worst possible user. Or even--and that is much worse---me.

@heikef
Copy link
Contributor

heikef commented Oct 11, 2018

It should be possible to use grid "even" when looking at a bond but then you should define your plane properly.

@heikef
Copy link
Contributor

heikef commented Apr 6, 2019

I tried to use grid(base) to integrate but ran into the same problems. The things is one can modify the bound / radius such that it is not zero any more but this does not solve the problem. In fact the norm is zero and that is the reason why you get a zero current. I think the problem of Raphael is identical to your issue. @lnw @bergerrjf #210

@bergerrjf
Copy link

bergerrjf commented Apr 6, 2019 via email

@heikef
Copy link
Contributor

heikef commented Apr 6, 2019

Reading in external grids is possible and part of the test suite.

@bergerrjf
Copy link

bergerrjf commented Apr 6, 2019 via email

@heikef
Copy link
Contributor

heikef commented Apr 7, 2019

It works. Otherwise the test must fail. Please let us know if you encounter problems.

@mrauha
Copy link

mrauha commented Oct 8, 2020

Hi :)

Hope all is going well with you all!

Replying here as Raphael inquired about same stuff.

The final steps in finishing up my thesis involve automating ring current calculations. Everything else is carried out in my own code - I only need GIMIC to return me J(r) given r and magnetic field orientation. The read-grid example requires additional files as described in the docs. As I'm not interested in paraview visualisations, the tetgen etc steps seem excessive.

My fortran knowledge is quite poor and the source code is a bit hard to follow. I made following edits in my own fork:
mrauha@aa4c190

Is this correct way to get a list of jvec's given a file containing the xyz points?

All the best,
Markus

@bast
Copy link
Member

bast commented Oct 9, 2020

Markus, thanks for the description and example. I am looking at it and will report back ...

@bast
Copy link
Member

bast commented Oct 9, 2020

To me this looks like an OK way to get that information (I am working on a standalone density and current density evaluator but progress is slow). Maybe counter-question: does it work? Do you get reasonable values out?

@bergerrjf
Copy link

bergerrjf commented Oct 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants