OpenCMISS / cm

www.opencmiss.org
60 stars 93 forks source link

Updating memory allocations for equation element matrices and vectors #140

Closed PrasadBabarendaGamage closed 11 years ago

PrasadBabarendaGamage commented 11 years ago

EQUATIONS_MATRICES_ELEMENT_MATRIX_SETUP and EQUATIONS_MATRICES_ELEMENT_VECTOR_SETUP now take into account the MAX_NUMBER_OF_INTERPOLATION_PARAMETERS in each field component to find the number of rows/columns to allocate. This should reduce memory allocation eg when a dependent field has cubic Hermite interpolation for x,y,z (field component 1,2,3 respectively) and linear lagrange for hydrostatic pressure (field component 4).

Tracker Item 3547

PrasadBabarendaGamage commented 11 years ago

@chrispbradley Hi Chris could you please review this (its only a couple of lines - the rest is just changing to the new style). I built and tested it with the examples/FiniteElasticity/Cantilever/Python/CantileverExample.py

Thanks

Prasad

chrispbradley commented 11 years ago

Looks good to me.

adamreeve commented 11 years ago

Hi @chrispbradley and @PrasadBabarendaGamage. It looks like with the recent merges, this change has been lost. There were conflicts with commit 9e5c04b29919d5b5051de2e5903156ee61f84b10, so that was used instead and the changes here were discarded. Is that what was supposed to happen?

The buildbot failures in finite elasticity are due to a difference between the size of the element matrix and element residual vector in the finite differencing. I've fixed it by just using the number of rows for the current matrix and vector, but it looks like the maximum element matrix dimensions are calculated incorrectly. I guess that was due to Nancy's commit above. I'll try and merge these two properly and fix this up.

adamreeve commented 11 years ago

Ah, so the difference in size is because the changes to EQUATIONS_MATRICES_ELEMENT_VECTOR_SETUP were still present, but the ones to EQUATIONS_MATRICES_ELEMENT_MATRIX_SETUP were lost. I've fixed this up and will test and make a new PR.

chrispbradley commented 11 years ago

Hi adamreeve, apologies. I did see that problem but I thought I fixed it? Actually it seems I've fixed in my branch but that one isn't due to be pulled for a while yet. Make a new PR and I'll sort it.

adamreeve commented 11 years ago

Hi Chris, oh yup, looks like this was fixed in the stuff you just merged. I'll still make another PR as I realised the Jacobian calculation isn't quite right.