Re: [Users] Achieve Cell-Center in NR simulation
Hello Steve, using Carpet's cell centered refinement you should enable the CarpetLib parameter: CarpetLib::use_higher_order_restriction = "yes" and possibly increase the default value of CarpetLib::restriction_order_space from its default value of 3. Note that values larger than 3 can be very slow. This parameter controls the polynomial order used by CarpetLib's Lagrange restriction operators, which is used for example for the metric quantities. Otherwise (for *cell centered grids only*) CarpetLib uses linear order (averaging) which is appropriate for cell averaged quantities like the fluid density but not the best for quantities that are sampled at the cell center like the metric. CarpetLib's ENO and WENO operators are not affected by this option and always use averaging for restriction. Yours, Roland > Steve > > Carpet supports cell-centred refinement. To use it, you have to enable > it officially, and also (as mentioned by others) modify the boundary > conditions. With vertex centred refinement (the default), you need to > place grid points right onto the boundaries. With cell centring, you > need to ensure that all cell centres ("grid points") straddle the > boundaries. It is also necessary to use CoordBase to set up the domain > and boundaries, which you already do. > > Set > > Carpet::refinement_centering = "cell" > > CoordBase::boundary_staggered_{x,y,z}{lower,upper} = yes > CoordBase::boundary_shiftout_{x,y,z}{lower,upper} = 0 # this is also > the default > > ReflectionSymmetry::avoid_origin_{x,y,z} = yes # this is also the default > ReflectionSymmetry::avoid_origin_upper_{x,y,z} = yes # this is also > the default > > I find it convenient to enable 1D ASCII output for a certain variable > (e.g. the lapse) and then study this file, looking at the coordinates > of the quantity that is output. These coordinates are the cell > centres. Compare this to your expectation. For example, these > coordinate must straddle the origin; if you have a symmetry, then the > number of symmetry points (i.e. the number of points with negative > coordinates) must be the same as the number of ghost points (probably > 3); fine grid points must straddle the coarse grid points, etc. > > If this works, then do this for another resolution, e.g. refining by a > factor of 2. (I am talking about a convergence test here, not about > AMR mesh refinement.) In this case, the new (finer) cell boundaries > must be exactly aligned with the old (coarser) cells. For this test, I > like to set up grid such that the number of higher-resolution cells is > exactly twice the number of finer-resolution cells. > > If these two tests work, then you have a consistent grid structure. If > this doesn't work, then there is a slight inconsistency that will make > proper convergence tests and/or comparison of norms to analytic > solutions impossible. I will be happy to help further. > > It also helps me to draw sketches on a blackboard, e.g. drawing as > square that is then subdivided into four squares. The locations of the > centres of the squares are the grid points. All boundaries must be > aligned with an edge of a square. The thorn CoordBase has some 1D > sketches that might also help. > > -erik > > On Sun, Jun 23, 2019 at 4:10 AM Steve Hawk wrote: > > > > Hello: > > Thanks for giving some hints about adaptive mesh refinement with the help > > of Roland, but I feel sorry that I came across some new problems about > > cell-centering when I try to simulate "the transition from wormholes to > > trumpets” considering Schwartzchild metric. > > > > Since the singularity (0,0,0) exists under the metric of Schwartzchild, I > > want to make use of cell-centered method to avoid the singularity. Although > > there is an option CartGrid3D::avoid_origin = “yes” in the thorn > > CartGrid3D, it seems that it doesn’t works properly: the data related to > > the grid points (0,0,0) is still been calculated (very large!). The related > > par file is attached in the attachment. > > > > So I am wondering is there a method to solve the problem or any parameters > > of thorns governing the cell-centering methods? > > > > > > Thanks! > > Best Regards! > > > > > > Xiaoxiao > > ___ > > Users mailing list > > Users@einsteintoolkit.org > > http://lists.einsteintoolkit.org/mailman/listinfo/users > > > -- My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from http://pgp.mit.edu . pgpyiyDHo8xQx.pgp Description: OpenPGP digital signature ___ Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
Re: [Users] Achieve Cell-Center in NR simulation
Steve Carpet supports cell-centred refinement. To use it, you have to enable it officially, and also (as mentioned by others) modify the boundary conditions. With vertex centred refinement (the default), you need to place grid points right onto the boundaries. With cell centring, you need to ensure that all cell centres ("grid points") straddle the boundaries. It is also necessary to use CoordBase to set up the domain and boundaries, which you already do. Set Carpet::refinement_centering = "cell" CoordBase::boundary_staggered_{x,y,z}{lower,upper} = yes CoordBase::boundary_shiftout_{x,y,z}{lower,upper} = 0 # this is also the default ReflectionSymmetry::avoid_origin_{x,y,z} = yes # this is also the default ReflectionSymmetry::avoid_origin_upper_{x,y,z} = yes # this is also the default I find it convenient to enable 1D ASCII output for a certain variable (e.g. the lapse) and then study this file, looking at the coordinates of the quantity that is output. These coordinates are the cell centres. Compare this to your expectation. For example, these coordinate must straddle the origin; if you have a symmetry, then the number of symmetry points (i.e. the number of points with negative coordinates) must be the same as the number of ghost points (probably 3); fine grid points must straddle the coarse grid points, etc. If this works, then do this for another resolution, e.g. refining by a factor of 2. (I am talking about a convergence test here, not about AMR mesh refinement.) In this case, the new (finer) cell boundaries must be exactly aligned with the old (coarser) cells. For this test, I like to set up grid such that the number of higher-resolution cells is exactly twice the number of finer-resolution cells. If these two tests work, then you have a consistent grid structure. If this doesn't work, then there is a slight inconsistency that will make proper convergence tests and/or comparison of norms to analytic solutions impossible. I will be happy to help further. It also helps me to draw sketches on a blackboard, e.g. drawing as square that is then subdivided into four squares. The locations of the centres of the squares are the grid points. All boundaries must be aligned with an edge of a square. The thorn CoordBase has some 1D sketches that might also help. -erik On Sun, Jun 23, 2019 at 4:10 AM Steve Hawk wrote: > > Hello: > Thanks for giving some hints about adaptive mesh refinement with the help of > Roland, but I feel sorry that I came across some new problems about > cell-centering when I try to simulate "the transition from wormholes to > trumpets” considering Schwartzchild metric. > > Since the singularity (0,0,0) exists under the metric of Schwartzchild, I > want to make use of cell-centered method to avoid the singularity. Although > there is an option CartGrid3D::avoid_origin = “yes” in the thorn CartGrid3D, > it seems that it doesn’t works properly: the data related to the grid points > (0,0,0) is still been calculated (very large!). The related par file is > attached in the attachment. > > So I am wondering is there a method to solve the problem or any parameters of > thorns governing the cell-centering methods? > > > Thanks! > Best Regards! > > > Xiaoxiao > ___ > Users mailing list > Users@einsteintoolkit.org > http://lists.einsteintoolkit.org/mailman/listinfo/users -- Erik Schnetter http://www.perimeterinstitute.ca/personal/eschnetter/ ___ Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
Re: [Users] Achieve Cell-Center in NR simulation
Hi Steve. It looks like the "avoid_origin" options are commented out in your parameter file, so they wouldn't be active. However, since they're part of the ReflectionSymmetry thorn, they'd only work if you were using reflection symmetry in one of more of the spatial dimensions. To get what you want to happen, I'd manually shift the CoordBase parameters a bit: xmin -> xmin + delta ymin -> ymin + delta zmin -> zmin + delta xmax -> xmax + delta ymax -> ymax + delta zmax -> zmax + delta ... where "delta" is half of your *finest* grid spacing --- 1/64, if I'm reading the parameter file correctly. Then all the grids (base level 0 and Carpet's refined levels 1-4) will be centered slightly off the origin, as you wanted. Bernard On Sun, 23 Jun 2019 at 04:10, Steve Hawk wrote: > > Hello: > Thanks for giving some hints about adaptive mesh refinement with the help of > Roland, but I feel sorry that I came across some new problems about > cell-centering when I try to simulate "the transition from wormholes to > trumpets” considering Schwartzchild metric. > > Since the singularity (0,0,0) exists under the metric of Schwartzchild, I > want to make use of cell-centered method to avoid the singularity. Although > there is an option CartGrid3D::avoid_origin = “yes” in the thorn CartGrid3D, > it seems that it doesn’t works properly: the data related to the grid points > (0,0,0) is still been calculated (very large!). The related par file is > attached in the attachment. > > So I am wondering is there a method to solve the problem or any parameters of > thorns governing the cell-centering methods? > > > Thanks! > Best Regards! > > > Xiaoxiao > ___ > Users mailing list > Users@einsteintoolkit.org > http://lists.einsteintoolkit.org/mailman/listinfo/users -- -- Bernard Kelly -- CRESST Assistant Research Scientist, NASA/GSFC Gravitational Astrophysics Laboratory --- Code 663 Phone: +1 (301) 286-7243 *** Fax: +1 (301) 286-2226 Web: http://science.gsfc.nasa.gov/sed/bio/bernard.j.kelly ORCID: orcid.org/-0002-3326-4454 -- ___ Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
[Users] Achieve Cell-Center in NR simulation
Hello: Thanks for giving some hints about adaptive mesh refinement with the help of Roland, but I feel sorry that I came across some new problems about cell-centering when I try to simulate "the transition from wormholes to trumpets” considering Schwartzchild metric. Since the singularity (0,0,0) exists under the metric of Schwartzchild, I want to make use of cell-centered method to avoid the singularity. Although there is an option CartGrid3D::avoid_origin = “yes” in the thorn CartGrid3D, it seems that it doesn’t works properly: the data related to the grid points (0,0,0) is still been calculated (very large!). The related par file is attached in the attachment. So I am wondering is there a method to solve the problem or any parameters of thorns governing the cell-centering methods? Thanks! Best Regards! Xiaoxiao wormholes.par Description: wormholes.par ___ Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users