Skip to content

Fix MLMG tortuosity: pin boundary cells to match HYPRE convention#238

Merged
jameslehoux merged 1 commit intoworkingfrom
claude/fix-gpu-wheels-build-yptxM
Apr 1, 2026
Merged

Fix MLMG tortuosity: pin boundary cells to match HYPRE convention#238
jameslehoux merged 1 commit intoworkingfrom
claude/fix-gpu-wheels-build-yptxM

Conversation

@jameslehoux
Copy link
Copy Markdown

AMReX MLABecLaplacian applies Dirichlet BCs at domain faces (half-cell outside boundary cell centres), but the shared globalFluxes() code computes cell-to-cell gradients assuming HYPRE's convention where Dirichlet values are at boundary cell centres. This caused MLMG to report tau=1.0 instead of the correct (N-1)/N for uniform blocks.

Fix: after the MLMG solve, overwrite boundary cells with vlo/vhi so the flux integration sees the same boundary conditions as HYPRE.

Also fixes clang-format violations from the previous commit.

AMReX MLABecLaplacian applies Dirichlet BCs at domain faces (half-cell
outside boundary cell centres), but the shared globalFluxes() code
computes cell-to-cell gradients assuming HYPRE's convention where
Dirichlet values are at boundary cell centres. This caused MLMG to
report tau=1.0 instead of the correct (N-1)/N for uniform blocks.

Fix: after the MLMG solve, overwrite boundary cells with vlo/vhi so
the flux integration sees the same boundary conditions as HYPRE.

Also fixes clang-format violations from the previous commit.

https://claude.ai/code/session_01RKnn97qiD7sbCeABHH3eQk
@jameslehoux jameslehoux merged commit 85db25e into working Apr 1, 2026
3 of 6 checks passed
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

Code Coverage Report

------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: .
------------------------------------------------------------------------------
File                                       Lines     Exec  Cover   Missing
------------------------------------------------------------------------------
src/io/CathodeWrite.cpp                       95        0     0%   15,17-19,24,27,31,34-36,39-41,46,50-52,59,62,65-69,72-74,78-79,83-91,93,96-100,103-106,109-111,114-116,121,125-127,136,139-143,145-148,151-162,168-171,175,177,181-185,188-191
src/io/CathodeWrite.H                          1        0     0%   60
src/io/DatReader.cpp                         135        0     0%   26-27,30,35,39,41,55,57,59-60,62-63,65,69-70,73-79,81-84,87-88,90-93,96-100,105,107-109,112-115,117-119,122-125,127-131,133,135-137,140-141,143-148,150-155,160,162,164,168-172,176-177,179-180,182-183,185-189,191-192,195-197,199-203,205-209,211,215,217,220-224,227,232-240,242,244-245,247,249,252-254
src/io/DatReader.H                             1        0     0%   59
src/io/HDF5Reader.cpp                        344        0     0%   40-41,43-44,46-49,52,54-56,58-59,62,64-66,68-74,82,84-85,88-89,91-93,95,101-104,108,110-114,118,120,122-123,125-128,133,136-138,141-145,149-151,153-157,161,165-169,171,173-180,182-187,193-194,196-197,199-200,202-204,206-207,213-215,217,219-228,230-233,236-238,240-251,253-258,266,266,266,266,266,266,266,266,270,270,270,270,270,270,270,270,272,274,276,278,280,282,288,290,297,297,297,297,297,297,297,297,301,301,301,301,301,301,301,301,305,305,305,305,305,305,305,305-306,306,306,306,306,306,306,306,309,309,309,309,309,309,309,309-310,310,310,310,310,310,310,310-311,311,311,311,311,311,311,311,313,313,313,313,313,313,313,313-314,314,314,314,314,314,314,314-315,315,315,315,315,315,315,315,319,319,319,319,319,319,319,319,324,324,324,324,324,324,324,324-325,325,325,325,325,325,325,325-326,326,326,326,326,326,326,326-327,327,327,327,327,327,327,327,332,332,332,332,332,332,332,332,337,337,337,337,337,337,337,337-338,338,338,338,338,338,338,338,343,343,343,343,343,343,343,343,350,350,350,350,350,350,350,350,354,356-358,366-367,371,430,432-435,437-441,444-446
src/io/HDF5Reader.H                            3        0     0%   61,153-154
src/io/ImageLoader.cpp                        61        0     0%   20,22,24-25,28-29,33-36,38,42-43,45-48,50-57,59-62,64-70,72,74-77,79-86,88-90,92,94,99,101-104,106-107
src/io/RawReader.cpp                         266        0     0%   31-32,34-35,48-50,53,60-61,68-69,77-78,80,83-85,87,89-90,92,98,101-107,110-112,114-117,119-121,126-127,129,131-135,140-142,145,150,152-153,155-157,161-162,164,166-168,173-177,180,183-186,190-196,199-204,207,209-212,218-224,227-228,231-237,240,244-245,253,255-256,258-259,263-264,270-271,273-274,276,283-284,286-287,289-290,292-293,295-296,299-301,303-304,312,314,318,325,327,331-334,338,346-347,353-355,361-363,365-366,369,372,374,377-380,382-384,386,388-389,391,393-394,396,398-399,401,403-404,406,410-411,413,417-418,420,425,434,436,438,443-447,449,451-452,456-457,463-465,471-475,477,480,488,492-493,497-502,505,509-510,515-519,521-524,526,528-530,532,534-536,538,540-542,544,546-548,550,554-556,558,562-564,566,573-574,585,588,590,592,596-598
src/io/RawReader.H                             1        0     0%   109
src/io/TiffReader.cpp                        384        0     0%   49-52,59-65,67-69,71-73,75-77,79-80,82-84,86-88,90-92,94-96,98-99,101-103,106-108,111-112,114-117,119,122,124-127,134-137,139-140,142-144,146,148-150,152-158,160,165-166,168-169,171-172,174-175,177-178,180-181,184-186,188-189,195,198-202,204-205,208-210,213-217,219-223,225-226,228-231,234-240,242-248,252-255,257,259,263-265,267-277,280,282-286,288-293,296,299-301,306,309-317,319-320,323-327,331-335,338-342,344-348,351-357,359-363,367,369,375-377,379-393,396,398-402,404-409,413-418,420-425,428-429,432-434,439,441,444,446-447,449-452,456-459,462,555-575,577-578,581-588,590,593-609,612-614,653-671,673-674,677-683,685,688-703,706-708,717-718,723,725-726,728-730
src/io/TiffReader.H                            3        0     0%   83,185-186
src/props/BoundaryCondition.H                131        0     0%   57-68,70-71,81,117-118,133,141-146,148-154,157,160-168,170-176,178-184,188-193,196,200,216,224-229,233-236,238-244,247-249,252-253,255,258-261,264-265,271-272,274-279,285-287,290-296,299,303,317,324,339,346,348-349,361-371,373
src/props/ConnectedComponents.cpp             69        0     0%   21,24-26,28-29,31,35-36,38-41,43-46,48-49,53-54,56-58,61-65,67-69,72-73,75,78-79,85-87,90-91,93-95,99-100,102,104-105,109,111-113,115-117,119-122,124-125,127-128,131-132,135-136
src/props/ConnectedComponents.H                2        0     0%   53-54
src/props/DeffTensor.cpp                      62        0     0%   15,21-23,27-28,30,32,34-37,43,46,48-52,54-55,57,59,62-63,67,69,71,73,75-76,78-82,87-88,90,92,94-97,99-103,107-109,114-118,122,127-129,131
src/props/EffDiffFillMtx.H                   120        0     0%   50,57-58,60-62,64-69,72-77,79-83,85-86,88-91,94-97,100-103,107-109,114-117,120-124,127-129,133-137,139-141,145-149,151-153,157-161,163-165,169-170,173-177,179-181,185-189,191-193,197,200-204,207-208,212,215-217,221-225,228-229,231-235,238,243
src/props/EffectiveDiffusivityHypre.cpp      389        0     0%   68-76,78-82,87,91,93-96,99,103,105-106,109-113,116-126,129-131,133-134,136-139,144-148,150-151,155-156,158,160-161,163,166-168,170-171,173,175-178,180-184,188-191,193-197,200-201,203-205,207-208,210,214-217,219-222,224,226-227,229-238,240,243,245-249,252-253,256-258,261,284-285,288,290-293,296,299-305,308,311-313,315-317,319-328,331,333-336,339-343,345-349,352-353,356-364,367-370,373,378,380,382-384,388,390,392-393,395,397,399-402,404-409,412,415-418,421-423,473-479,481-483,485-488,490-493,495,499,501-502,504,507-508,510-511,513-514,524-525,527-542,545-548,555-557,561-564,566-569,571,573-577,579-582,584,588,590-591,593,595,598,600-602,604-608,611-615,617-619,621-624,628,630-631,633-636,641-646,648-649,651-654,656-659,662-663,665-666,668-669,671-672,677,680,683-687,689-691,693,695-697,700-705,707,709-710,712,714,716,718,721-722,724-726,728-730,733,735-736,738
src/props/EffectiveDiffusivityHypre.H          5        0     0%   74,117-118,120-121
src/props/FloodFill.cpp                       84        0     0%   25,28,30-33,35-36,40,43,51-52,54,56,58,63-64,66,68,70,75-76,79-84,87-89,91-95,98-100,102-105,107-110,112-114,119,132,135,159-162,165-166,171,174-176,186,190,201,203-204,207,209-216,227,229,232,235-236,238-239
src/props/HypreStructSolver.cpp              344        0     0%   23-24,26-28,31-32,34-36,42,44-46,51-64,66-70,75-76,78-79,81-88,90-91,95-96,98-103,106,109-112,116-118,120-121,123,128-130,132-134,136-140,142,144-145,147,152-153,155,159,161,163,165-166,168-169,186-187,189-192,194-197,199-201,203,208-217,219,224-225,227-230,233-241,243-249,251,254-257,259,262,265-270,272,274-277,279-283,285-286,288-289,291-292,294-295,297-299,302-303,305-306,308-311,313-314,317-318,320-323,325-330,332-333,335-336,338-339,341-342,344-346,349-350,352-353,355-358,360-361,364-365,367-370,372-376,378-379,381-385,388-389,391-392,394,397-398,401-402,404-407,409-413,415-416,418-422,425-426,428-429,431,434-435,438-439,441-443,445-451,453-457,460-461,463-464,466,469-470,473,475-477,479-486,488-492,495-496,498-499,501,504-505,508,510-512,514-517,519-523,526-527,529-530,532,535-536,539,542-543,547-551,554,556,559
src/props/ParticleSizeDistribution.cpp        11        0     0%   11-14,16-18,20-21,24-25
src/props/PercolationCheck.cpp                53        0     0%   14,17-19,21-22,24-33,37,41,44-46,48-51,55-58,62-65,67-69,72-74,78-79,82,89-92,94,97-100,102-103
src/props/REVStudy.cpp                       151        0     0%   27,32,34-40,42-44,47,49,53-56,58,62,64-65,67-72,74-75,79-80,82-91,93-96,100-101,103,106-109,111-114,120-124,127-136,139-141,143,146-147,149,152-156,158-159,161,163,165-173,175,177-186,188-191,195-197,201,203-204,206,209-222,225-231,233-234,236-237,239-241,243,246-247,249
src/props/SpecificSurfaceArea.cpp             56        0     0%   13-17,19,21,23-24,28-31,33-35,39-40,42-44,47-48,56-59,64-65,67-71,73,75-78,80,90,92-94,97-101,103,105-107,110-112
src/props/SpecificSurfaceArea.H                1        0     0%   55
src/props/ThroughThicknessProfile.cpp         38        0     0%   12,14-16,18,20,23-25,28-31,33-35,37-39,41-46,48-49,52-54,56,60,62,66-69,72
src/props/Tortuosity.H                         2        0     0%   67,86
src/props/TortuosityDirect.cpp               219        0     0%   40,46-51,53-55,58,62-64,67,69-75,77-79,81-83,85-86,89-90,92-93,95-106,110,113-114,119,121-122,125,127-129,131,134,136-137,140,142,146,149-153,155-157,159-163,165-169,171-174,176-179,181-187,190-192,194-195,200,202-209,214,216-218,220-221,223,225-226,229-231,234-236,238-239,248,251,254,286-288,291,293,295,298,330-332,335,338,340,343,352-354,356,360-361,365-366,369-371,375-377,379-380,383,390-392,394,396,398,400-408,411,418-422,424,426,428,431-433,435-437,442-444,448,474-479,482-487,504-509,512-517
src/props/TortuosityDirect.H                   1        0     0%   80
src/props/TortuosityHypre.cpp                784        0     0%   83,90,92-97,101,104,107-108,110,114-115,119-123,127-131,133-134,137-138,140-141,143-155,158-160,162,164-167,169,171-172,176-179,181-182,186-187,189,191-197,202-206,209,211-213,216-220,225-227,229-230,232-234,238-242,245-247,251-260,262-263,265,269,271-273,275-278,280,282-283,285-294,296,298-310,316,321-324,326-329,331,334-336,339-340,342,352-354,357-359,361,365,371,374-376,378-382,385,389-392,396-399,401-403,406-408,411,413,420-423,425,427,430-433,437-442,444-445,447-449,451-453,456-458,460,464,466,469,471-472,474,476-478,481-483,485-488,491-493,568-572,574-576,578-580,582-584,586,589-590,593-596,598-600,602,606-607,609,611-612,614-615,617-618,620-621,625-626,630,634,636-638,640-642,644-653,655,658-662,666-668,671-678,680-684,686,688-690,692-694,696-705,707-711,713-724,726-729,731-732,738,740-741,744,746-750,752-754,757-758,760,762-766,768-770,774,777-786,789-790,792-800,803,811-818,820-823,828-832,834,839,842-843,845-848,850,857-858,864-867,869,871,875-879,882-884,887-891,893-898,900,903-907,909,912,916,918-922,927-928,934,936-938,940-943,945-949,951-964,966-967,969,971-972,974-980,982-993,995-999,1001-1002,1004-1008,1011-1017,1019-1027,1030-1041,1043-1051,1055-1060,1062-1066,1068-1070,1072-1076,1079-1085,1087,1090-1091,1096,1098,1102,1104,1109,1111-1115,1118-1119,1121-1130,1132,1135-1139,1141-1143,1146-1149,1152-1153,1155-1158,1163,1165,1168-1170,1172-1176,1178-1180,1182,1184-1194,1197,1201-1203,1205,1207-1217,1220,1223,1225-1229,1232-1241,1243-1246,1249,1251-1254,1256,1265-1266,1269-1270,1281,1284-1288,1291,1293-1296,1298,1304-1305,1309-1311,1313-1317,1319-1320,1322-1332,1334-1335,1338-1339,1343,1346,1349-1351,1353,1355-1359,1362-1363,1365-1369,1371-1375,1378
src/props/TortuosityHypre.H                    5        0     0%   77,147-148,150-151
src/props/TortuosityHypreFill.H              127        0     0%   77,84-85,89-91,94-96,100-105,108-112,114,116-119,122-130,133-137,140-144,146,150-154,156,160-164,166,170-174,176,180-184,186,190-194,196,199,202-203,205-212,214,218-225,227-228,231-232,236-239,241-245,247-248,250,252,255-256,258-262,267,284,294,298-299,304-305,308
src/props/TortuosityKernels.H                 97        0     0%   52,56-60,62-65,69-74,76-80,84-85,90,108,113-117,119-120,124,126-129,131,133,138,140-143,145,147,152,154-157,159,161,163,182,188-190,192,194-199,218,225-226,228-229,231,233-236,238-241,243,245-248,250-253,257-260,262-265,268
src/props/TortuositySolverBase.cpp           301        0     0%   40,46-52,54-55,57,61,64,67,69-72,74-75,77,80,85-88,90-91,94-101,104,106-107,110,113,115,122-124,126-127,130,134,136-138,140,142-145,148-152,154,157,159,166-169,171,173,175-182,184-186,188-190,193-195,197,200,203,205,208,210-211,213-217,219-221,223-224,226-232,234-239,241,243-252,255,259-264,266,268-277,280,283-286,288-289,291,293-296,298,302-303,305-306,309,312-318,320,322-325,327,332-334,336-340,342-343,345-355,357-358,360-361,364-365,367-370,372-376,379-380,382-386,388,391,394-396,398,406-409,411-417,420-422,425-429,432,434-436,438-440,443,446-454,458-460,463-465,467,469-471,473-476,478,482,486-490,492,495-502,504-506,508,512-513,518-519
------------------------------------------------------------------------------
TOTAL                                       4346        0     0%
------------------------------------------------------------------------------


Generated by CI — coverage data from gcovr

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant