Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary array allocations and devil numbers #197

Merged
merged 1 commit into from
Sep 18, 2021

Conversation

zhaog6
Copy link
Contributor

@zhaog6 zhaog6 commented Sep 18, 2021

With KSPSolve, it is unnecessary to manually allocate memory when declaring FreeFEM array variables.

@prj-
Copy link
Member

prj- commented Sep 18, 2021

Is there a specific reason why you'd want not to specify the sizes? It will still be done down the road (in the .cpp) if it's not done sooner (in the .edp). Also, just FYI, you don't need to close a PR and reopen a new one just to change branch destination, you can just edit the original PR, cf. GitHub documentation.

@zhaog6
Copy link
Contributor Author

zhaog6 commented Sep 18, 2021

Is there a specific reason why you'd want not to specify the sizes? It will still be done down the road (in the .cpp) if it's not done sooner (in the .edp)

Because sometimes I can't remember whether I need to manually allocate memory for these arrays before using some functions such as ChangeNumbering, MatMult and KSPSolve, when I encounter this situation, I often have to write another example to test. But a short break in the middle may make the program not very smooth. So I want to have a unified declaration with these arrays and the allocation of array memory is handled by KSPSolve. This is just a feeling for me.

@zhaog6
Copy link
Contributor Author

zhaog6 commented Sep 18, 2021

you don't need to close a PR and reopen a new one just to change branch destination, you can just edit the original PR, cf. GitHub documentation.

Okay.

@prj- prj- merged commit 44fbf8f into FreeFem:develop Sep 18, 2021
@zhaog6
Copy link
Contributor Author

zhaog6 commented Sep 18, 2021

Thanks for your review and advice.

@zhaog6 zhaog6 deleted the petscArray branch September 18, 2021 08:43
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