Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/integral symmetry factor (#256)
* Added symmetry correction flag and symmetry factor variable 1. The symmetry correction flag is read in ChomboParameters. It is defaulted to "off" if the parameter is not provided. 2. If symmetry correction is flag is on, the symmetry factor is calculated based off of the number of hi or lo boundaries chosen to be reflective (choice 2). 3. The symmetry factor is a chombo parameter, and must be given to any AMRReduction function which integrates over the entire box (currently norm and sum). The symmetry factor is defaulted to 1 if it is not provided to the AMRReduction scheme. 4. The result of sum or norm is multiplied by the symmetry factor before it is returned, in the case of a single variable. The symmetry factor is provided correctly to AMRReductions for the BinaryBH example ONLY in this commit. * Added symmetry correction flag to all params in all Examples * Adding params changes, so I can bugfix separately * Bug fixes to symmetry factor implementation Fixed a few bugs with how I had first implemented the symmetry factor: 1. Moved the symmetry factor argument in norm and sum ahead of the defaulted variables. 2. Changed type of the symmetry factor variable in sum and norm to int, and cast it to double before applying to the final result. 3. Changed error in the name of the variable in norm. * Trying to add symmetry factor from GRAMR but I think I need to start on a new branch... * Symmetry factor implementation in GRAMR Created a series of subroutines to directly read in the symmetry factor associated with using reflective boundary conditions in the GRAMR class, which can then be drawn out for use by the sum() and norm() AMRReductions functions. 1. The symmetry factor is calculated in BoundaryConditions as a parameter, then assigned to a private BoundaryConditions variable. 2. A GRAMRLevel subroutine, get_symm(), calls the BoundaryConditions subroutine to return the private symmetry factor variable. 3. AMRReductions reads in the symmetry factor from get_gramrlevels in the same style as m_coarsest_dx. 4. The symmetry factor is applied to the norm() and sum() results immediately before they are returned. * Removed symmetry argument from uses of AMRReductions * Fixed clang tidy warnings * Fixed clang tidy warnings * Clang formatting changes, after running clang-format locally * Fixed typo on line 40 of BoundaryConditions.cpp * Added default to the symmetry_correction flag * Symmetry factor implementation Created a series of subroutines to directly read in the symmetry factor associated with using reflective boundary conditions in the GRAMR class, which can then be drawn out for use by the sum() and norm() AMRReductions functions. 1. If the symmetry_correction flag in params is turn on, the symmetry factor is calculated in BoundaryConditions as a parameter, then assigned to a private BoundaryConditions variable. 2. A GRAMRLevel subroutine, get_symm(), calls the BoundaryConditions subroutine to return the private symmetry factor variable. 3. AMRReductions reads in the symmetry factor from get_gramrlevels in the same style as m_coarsest_dx. 4. The symmetry factor is applied to the norm() and sum() results immediately before they are returned. * Pre-pull commit * Removal of old Chombo Parameter function argument from AMRReductions class. * Fixed Katy's comments on PR 1. Removed symmetry_correction flag, making the symmetry factor calculation automatic. 2. Moved application of symmetry factor in AMRReductions::norm function into the logic block controlled by the a_normalize_by_volume flag, so that only when normalising by the volume will the symmetry factor be applied. 3. Changed get_symm() function names to get_symmetry_factor() (coding convention). 4. Removed file path in params_very_cheap.txt in BinarBH example. * Remove symmetry_correction param from tests --------- Co-authored-by: dinatraykova <dina.traykova@aei.mpg.de>
- Loading branch information