Re: [deal.II] Geometric Conservation Law

2020-06-17 Thread Alexander Cicchino
Dear Martin,

Thank you for your response. Yes I agree that only some local computations 
are necessary to implement the identities.
Yes I would be interested in this feature and trying to implement it. Do 
you have any suggestions on where I should start and overall practices I 
should follow?

Thank you,
Alex

On Wednesday, June 17, 2020 at 1:19:29 AM UTC-4, Martin Kronbichler wrote:
>
> Dear Alex,
>
> This has been on my list of things to implement and verify with deal.II 
> over a range of examples for quite a while, so I'm glad you bringing the 
> topic up. It is definitely true that our way to define Jacobians does not 
> take those identities into account, but I believe we should add support for 
> them. The nice thing is that only some local computations are necessary, so 
> having the option to use it in the polynomial mapping classes would be 
> great. If you would be interested in this feature and trying to implement 
> things, I'd be happy to guide you to the right places in the code.
>
> Best,
> Martin
> On 17.06.20 06:02, Alexander Cicchino wrote:
>
> Thank you for responding Wolfgang Bangerth.
>
> The GCL condition comes from the discretized scheme satisfying free-stream 
> preservation. I will demonstrate this for 2D below, (can be interpreted for 
> spectral, DG, finite difference, finite volume etc):
> Consider the conservation law: \frac{\partial W}{\partial t} + 
> \frac{\partial F}{\partial x} +\frac{\partial G}{\partial y} =0
> Transforming this to the reference computational space (x,y)->(\xi, \eta):
> J*\frac{\partial W}{\partial t} + J*\frac{ \partial \xi}{\partial x} * 
> \frac{\partial F}{\partial \xi} + J * \frac{ \partial \eta}{\partial x}* 
> \frac{\partial F}{\partial \eta} + J * \frac{ \partial \xi}{\partial y} * 
> \frac{\partial G}{\partial \xi} + J*\frac{ \partial \eta}{\partial 
> y}*\frac{\partial G}{\partial \eta}
> Putting this in conservative form results in:
> J\frac{\partial W}{\partial t} + \frac{\partial}{\partial \xi} ( 
> J*F*\frac{\partial \xi}{\partial x} +J*G*\frac{\partial \xi}{\partial y} ) 
> + \frac{\partial}{\partial \eta} ( J*F*\frac{\partial \eta}{\partial x} 
> +J*G*\frac{\partial \eta}{\partial y} ) - F*( GCL in x) - G*(GCL in y) =0
>
> where GCL in x = \frac{\partial }{\partial \xi} ( det(J)* \frac{\partial 
> \xi 
>  }{\partial x}) + \frac{\partial }{\partial \eta}( det(J)* \frac{\partial 
> \eta}{\partial x} )
> similarly for y.
>
> So for the conservative numerical scheme to satisfy free stream 
> preservation, the GCL conditions must go to zero.
> For linear grids, there are no issues with the classical definition for 
> the inverse of the Jacobian, but what Kopriva had shown (before him Thomas 
> and Lombard), was that the metric Jacobian has to be calculated in either a 
> "conservative curl form" or an "invariant curl form" since it reduces the 
> GCL condition to the divergence of a curl, which is always discretely 
> satisfied. In the paper by Kopriva, he shows this, an example in 3D:
>  Analytically
> J*\frac{\partial \xi}{\partial x} = \frac{\partial z}{\partial \zeta} * 
> \frac{\partial y}{\partial \eta} - \frac{\partial z}{\partial \eta} * 
> \frac{\partial y}{\partial \zeta}
>
> but the primer doesn't satisfy free-stream preservation while the latter 
> ("conservative curl form") does.
>
> I will put together a unit test for a curvilinear grid. 
>
> Thank you,
> Alex
>
> On Tuesday, June 16, 2020 at 10:24:59 PM UTC-4, Wolfgang Bangerth wrote: 
>>
>>
>> Alexander, 
>>
>> > I am wondering if anybody has also found that the inverse of the 
>> Jacobian from 
>> > FE Values, with MappingQGeneric does not satisfy the Geometric 
>> Conservation 
>> > Law (GCL), in the sense of: 
>> > 
>> > Kopriva, David A. "Metric identities and the discontinuous spectral 
>> element 
>> > method on curvilinear meshes." /Journal of Scientific Computing/ 26.3 
>> (2006): 301. 
>> > 
>> > on curvilinear elements/manifolds in 3D. 
>> > That is: 
>> > \frac{\partial }{\partial \hat{x}_1} *det(J)* \frac{\partial \hat{x}_1 
>> > }{\partial x_1} + \frac{\partial }{\partial \hat{x}_2} *det(J)* 
>> \frac{\partial 
>> > \hat{x}_2}{\partial x} + \frac{\partial }{\partial \hat{x}_3} * 
>> > det(J)*\frac{\partial \hat{x}_3 }{\partial x_1} != 0 (GCL says it 
>> should =0, 
>> > similarly for x_2 and x_3) 
>> > 
>> > If so or if not, also, has anybody found a remedy to have the inverse 
>> of the 
>> > Jacobian from FE Values with MappingQGeneric to satisfy the GCL. 
>>
>> I'm not sure any of us have ever thought about it. (I haven't -- but I 
>> really 
>> shouldn't speak for anyone else.) Can you explain what this equality 
>> represents? Why should it hold? 
>>
>> I'm also unsure whether we've ever checked whether it holds (exactly or 
>> approximately). Can you create a small test program that illustrates the 
>> behavior you are seeing? 
>>
>> Best 
>>   W. 
>>
>> -- 
>>  
>> Wolfgang Bangerth  

[deal.II] Re: 9.2 issue during compilation on macOSX

2020-06-17 Thread Alberto Salvadori
quick update:

since I noticed the directory * 
zlib-1.2.11-rqiqrujgg5aemhk7eqjk3asbaukff37x*
in deal.ii directory * 
/Applications/deal.II.app/Contents/Resources/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple*

I thus attempted at creating a symbolic link* ln -s 
zlib-1.2.11-rqiqrujgg5aemhk7eqjk3asbaukff37x 
zlib-1.2.11-rqiqrujgg5aemhk7eqjk3asbaukff*
to sort out the warning message


*Scanning dependencies of target step-17*[ 50%] Building CXX object 
CMakeFiles/step-17.dir/step-17.cc.o
[100%] 
*Linking CXX executable step-17*ld: warning: directory not found for option 
'-L/Applications/deal.II.app/Contents/Resources/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/zlib-1.2.11-rqiqrujgg5aemhk7eqjk3asbaukff'
[100%] Built target step-17


It worked, in the sense that :


bash-3.2$ make release

*Scanning dependencies of target release*[100%] 
*Switching CMAKE_BUILD_TYPE to Release*-- Autopilot invoked
-- Run   $ make info  to print a detailed help message
-- Configuring done
-- Generating done
-- Build files have been written to: 
/Users/albertosalvadori/Codes/dealii-9.2/examples/step-17

***
*** Switched to Release mode. Now recompile with:  $ make
***

[100%] Built target release

bash-3.2$ make

*Scanning dependencies of target step-17*[ 50%] Building CXX object 
CMakeFiles/step-17.dir/step-17.cc.o
[100%] 
*Linking CXX executable step-17*[100%] Built target step-17


Nonetheless,  the code still does not run neither in debug nor in release 
mode, providing the following output:

bash-3.2$ ./step-17 
dyld: malformed mach-o: load commands size (33840) > 32768
Abort trap: 6

Any help appreciated.

Thanks
Alberto



Il giorno lunedì 15 giugno 2020 alle 19:15:09 UTC+2 Alberto Salvadori ha 
scritto:

> Hi,
>
> I just installed release 9.2, with great pleasure on my mac. Not working 
> yet. 
>
> Here is the error I receive, my OSX is 10.15.4 (19E287) and Xcode 11.5 
> (11E608c)
>
>
> *Developer Tools:*
>
>
>   Version: 11.5 (11E608c)
>
>   Location: /Applications/Xcode.app
>
>   Applications:
>
>   Xcode: 11.5 (16139)
>
>   Instruments: 11.5 (64535.75)
>
>   SDKs:
>
>   iOS:
>
>   13.5: (17F65)
>
>   iOS Simulator:
>
>   13.5: (17F65)
>
>   macOS:
>
>   10.15.4: (19E258)
>
>   19.0: 
>
>   tvOS:
>
>   13.4: (17L255)
>
>   tvOS Simulator:
>
>   13.4: (17L255)
>
>   watchOS:
>
>   6.2: (17T255)
>
>   watchOS Simulator:
>
>   6.2: (17T255)
>
>
> It seems that a library is sought for in a non existing directory:
>
>
> bash-3.2$ ls 
> /Applications/deal.II.app/Contents/Resources/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/zlib-1.2.11-rqiqrujgg5aemhk7eqjk3asbaukff
>
> ls: 
> /Applications/deal.II.app/Contents/Resources/spack/opt/spack/darwin-catalina-x86_64/clang-11.0.3-apple/zlib-1.2.11-rqiqrujgg5aemhk7eqjk3asbaukff:
>  
> No such file or directory
>
>
> Let me know if I can be of further help.
>
>
> Thanks!
> Alberto
>
>
>
> This is a shell with modules and PATHs set to work with Deal.II.
>
> All external libraries and deal.II itself are located in 
>
>
> /Applications/deal.II.app/Contents/Resources/spack/
>
>
> If you want to set up your daily Terminal to work with deal.II, add
>
> these lines to your ~/.profile file (the first line turns off this 
> message):
>
>
>export DEAL_II_CONF_SILENT=ON
>
># DEAL_II_USE_LMOD=ON # if you want to use lmod instead of tcl module
>
># DEAL_II_ENABLE_VIEW=ON # if you want to set CMAKE_PREFIX_PATH to a 
> view of
>
>. /Applications/deal.II.app/Contents/MacOS/dealii.conf
>
>
> deal.II and all its dependencies were installed using spack, and are 
> available
>
> through the spack and module or lmod commands, e.g.:
>
>
> module load dealii
>
> 
>
>
> The default interactive shell is now zsh.
>
> To update your account to use zsh, please run `chsh -s /bin/zsh`.
>
> For more details, please visit https://support.apple.com/kb/HT208050.
>
> bash-3.2$ 
>
> bash-3.2$ 
>
> bash-3.2$ cd /Users/albertosalvadori/Codes/dealii-9.2/examples/step-17
>
> bash-3.2$ cmake -G 'Unix Makefiles'
>
> CMake Warning:
>
>   No source or binary directory provided.  Both will be assumed to be the
>
>   same as the current working directory, but note that this warning will
>
>   become a fatal error in future CMake releases.
>
>
>
> -- The C compiler identification is AppleClang 11.0.3.11030032
>
> -- The CXX compiler identification is AppleClang 11.0.3.11030032
>
> -- Check for working C compiler: 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
>
> -- Check for working C compiler: 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
>  
> - works
>
> -- Detecting C compiler ABI info
>
> -- Detecting C compiler ABI info - done
>
> -- Detecting C compile features
>
> -- Detecting C compile features - done
>
> -- Check for working CXX compiler: 
>