Re: [DuMuX] memory corruption in brookscorey.hh?

2018-08-21 Thread Christoph Grüninger
Hi Edscott, give AddressSanitizer a try, it is a great tool to find such thing you describe. Further MemorySanitizer and Undefined Behavior Sanitizer might turn out to be helpful, too. My best experience with these tools were when I used the latest Clang compiler. Some of them work with recent

Re: [DuMuX] memory corruption in brookscorey.hh?

2018-08-21 Thread Timo Koch
Dear Edscott, what was your actual problem you are trying to solve? Is this a problem with Dumux? The code you are showing looks perfectly fine to me. Or was this just occurring during debugging? Your comments sound like you are debugging optimized code. If yes, is there any problem if the

Re: [DuMuX] memory corruption in brookscorey.hh?

2018-08-21 Thread Edscott Wilson
OK. I'll dig into the matter a bit further to see if I can solve where the problem arises. It might be an incorrect cast somewhere that screws up memory locations. Best regards, Edscott 2018-08-17 15:31 GMT-05:00 Flemisch, Bernd < bernd.flemi...@iws.uni-stuttgart.de>: > Hi Edscott, > > can

Re: [DuMuX] Check global conservation error

2018-08-21 Thread Dennis Gläser
Hi Nikolai, you have to make sure that you only compute this on Dirichlet faces. On Neumann faces the fluxes are the ones you set in your neumann() or neumannAtPos() function and cannot be computed by the flux assembly. So if you have only no-flow Neumann boundaries just make sure to only

Re: [DuMuX] Check global conservation error

2018-08-21 Thread Nikolai Andrianov
Hi Dennis, Thanks a lot, I got through elemFluxVarsCache.bind runtime error! However, a new problem has popped up  When I get to computing (or recovering) the advective flux with fluxVars.advectiveFlux(nPhaseIdx, upwindTermN), the execution brings me to caluclating Dracy's flux in

Re: [DuMuX] Check global conservation error

2018-08-21 Thread Dennis Gläser
Hi Nikolai, I think your implementation is almost correct. If you want to balance masses, you have to add the density to your upwind terms though, i.e.: auto upwindTermN = [](const auto& volVars) { return volVars.mobility(nPhaseIdx)*volVars.density(nPhaseIdx); }; ... Also, you have to

[DuMuX] Check global conservation error

2018-08-21 Thread Nikolai Andrianov
Dear DuMuX experts, Please advise how can I implement a global conservation error check, that is, evaluate the residual ( mass(t^{n+1}) - mass(t^n) ) / dt + sum of fluxes over the domain boundaries. So far I can evaluate the mass in the domain by looping through the elements as in void