Skip to content

Fix shouldReallocate function - #5

Merged
hamsteri15 merged 2 commits into
vttresearch:masterfrom
wengzf20:fix_reallocate
Feb 24, 2026
Merged

Fix shouldReallocate function#5
hamsteri15 merged 2 commits into
vttresearch:masterfrom
wengzf20:fix_reallocate

Conversation

@wengzf20

Copy link
Copy Markdown
Contributor

In shouldReallocate function of memoryResource.H,

    bool shouldReallocate(gLabel nCells, gLabel nSpecie) const {

        if ((nCells != this->nCells()) ||
            (nSpecie != this->nSpecie()) ||
            (nCells + 2 != this->nEqns())) {
            return true;
        }
        return false;
    }

the nEqns should be nSpecie + 2 instead of nCells + 2.

The error results in momery reallocation every time step and lower the computation efficiency.

@hamsteri15
hamsteri15 merged commit c41071e into vttresearch:master Feb 24, 2026
1 check passed
@hamsteri15

Copy link
Copy Markdown
Collaborator

Thanks for spotting this! Merged both.

@wengzf20
wengzf20 deleted the fix_reallocate branch March 3, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants