IBAMR / IBSAMRAI2

SAMRAI 2.4.4 fork and associated patches.
Other
1 stars 1 forks source link

Avoid computing non-overlapping boxes for all data centerings #5

Closed boyceg closed 1 year ago

boyceg commented 1 year ago

SAMRAI implements an O(N_p^2) algorithm, with N_p = number of patches, for computing non-overlapping boxes in the HierarchyDataOps classes. We should skip computing those whenever possible.

% grep nonoverlapping `find . -name "*.h"`
./include/HierarchySideDataOpsInteger.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_side_boxes[DIM];
./include/HierarchySideDataOpsComplex.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_side_boxes[DIM];
./include/HierarchyNodeDataOpsReal.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_node_boxes;
./include/HierarchySideDataOpsReal.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_side_boxes[DIM];
./include/HierarchyFaceDataOpsReal.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_face_boxes[DIM];
./include/HierarchyEdgeDataOpsReal.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_edge_boxes[DIM];
./include/HierarchyFaceDataOpsInteger.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_face_boxes[DIM];
./include/HierarchyNodeDataOpsInteger.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_node_boxes;
./include/HierarchyEdgeDataOpsComplex.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_edge_boxes[DIM];
./include/HierarchyFaceDataOpsComplex.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_face_boxes[DIM];
./include/HierarchyNodeDataOpsComplex.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_node_boxes;
./include/HierarchyEdgeDataOpsInteger.h:   tbox::Array< tbox::Array< hier::BoxList<DIM> > > d_nonoverlapping_edge_boxes[DIM];
drwells commented 1 year ago

This is partially addressed in #3 - I need to copy the fix to the rest of the data centerings.

I'll also double-check to see where this was or was not fixed in the past.

boyceg commented 1 year ago

I looked at our existing patches last night --- I hope I am wrong, but I think that this never made it onto the patches provided through https://github.com/IBAMR/IBAMR.

drwells commented 1 year ago

Weird!

drwells commented 1 year ago

Fixed by #3.