OpenCMISS / cm

www.opencmiss.org
60 stars 93 forks source link

Fieldml support for simplex elements #88

Closed dladd closed 12 years ago

dladd commented 12 years ago

Added in FieldML input/output support for linear and quadratic simplex (triangle and tetrahedron) types. I've tested this with with FieldML 0.4 and 0.5 on my 64-bit machine with gnu compilers.

Tracker #3132

dladd commented 12 years ago

Vijay kindly offered to review this request.

vraj004 commented 12 years ago

Hi guys, just asking here to keep things documented: Any chance dladd tested this fieldml code with MPI? Code compiled fine on hpc3. Works with 1 processor, debugging for MPI multiple processor setup.

dladd commented 12 years ago

Sorry I had not tested the FieldML IO with MPI and am also running into issues:

It looks like during the geometric field setup CMISSFieldML_InputFieldParametersUpdate is used to set all the geometric field parameters at once.

The problem is that without FieldML, you would loop through the all the geometric nodes and call CMISSField_ParameterSetUpdateNode to set each one after checking that you were on the correct computational node.

Let me see what I can do to fix this up.

dladd commented 12 years ago

Hi Vijay:

So 05b63ebc17553d1d52e091d521d19bd5846c072c fixes the parallel input issues I was having. Some of the output files I am getting are still looking a bit wacky though ( for me the naming for the exported fields is wrong and the header appears again in the middle of the part.exnode files) but it looks like the data is all there. I'll look into fixing this up.

This is also assuming a static solution at the moment so I'll need to also try to get this working for dynamic problems. I recall there being issues accessing the glue code (fieldml_output/input_routines.f90) from outside opencmiss.f90 but I think we can still use the FieldML API to write slabs of data and then figure out a way to get the main xml file to take those slabs into account.

Cheers, David

vraj004 commented 12 years ago

Hi Dave, thanks for that. Your current patch certainly seems to help. Please let me know of anything I can do to help - It will help me understand this part of the code too... Happy to Skype on how to possibly bug-detect-fix this... I am in more immediate need of the time-step solutions than you possibly are at this point.

cheers

Vijay

chrispbradley commented 12 years ago

Is this pull request ready to be merged?

vraj004 commented 12 years ago

Hi Chris.

Not yet... Trying to set up a computer here... Will hopefully get onto working next week!

On 3 Apr, 2012, at 10:28 AM, Chris Bradleyreply@reply.github.com wrote:

Is this pull request ready to be merged?


Reply to this email directly or view it on GitHub: https://github.com/OpenCMISS/cm/pull/88#issuecomment-4893204

chrispbradley commented 12 years ago

Any news on this?

vraj004 commented 12 years ago

Have started testing parallel processing now, should be able to update within a couple of days.

vraj004 commented 12 years ago

I am currently testing this code using an example with fieldml output, hexahedral elements and MPI.

Questions: When running MPI, do all the nodes simply dump the results to the dependent field, which fieldml then uses for output? I should not expect to see part numbers in the output like I did with the old FieldIO group of functions right?

Ok, closer look tells me that simplex and fieldml do work, but MPI and fieldml needs some debugging - on it now.

chrispbradley commented 12 years ago

When using MPI your dependent field is decomposed into a number of smaller domains. The dependent field numbers in each of these domains is written to a separate part file. I'm pretty sure that the FieldML API does this as well rather than assembling all the parts/domains into one file.

vraj004 commented 12 years ago

Maybe I have set up my program incorrectly a bit - is there an example that has MPI with fieldml io?

dladd commented 12 years ago

Yeah I've mainly used fieldml for parallel input rather than output so far. I'm re-running one of my examples now to make sure it works properly. Usually I use the field IO routines to give me CMGUI ex-format output for parallel problems

dladd commented 12 years ago

Unfortunately it looks like CMGUI is giving me grief at the moment as I've just upgraded my machine to Ubuntu 12.04. As for examples, the only one I know of that uses FieldML IO in the main trunk now is the Static_FieldML example in FluidMechanics/NavierStokes . That, however, is not set up to run in parallel.

I can email you one of my examples if you'd like to get an idea of how it is done though.

alan-wu commented 12 years ago

Great work, thanks. FieldMLoutput does not supports shapes other than lines, squares and cubes at the moment. I will create a pull request on your fork to add support for triangle and tetrahedral shape.

dladd commented 12 years ago

Hi Vijay,

I think the problems we are now seeing for Simplex are probably outside of the scope of fieldml IO issues and those fixes should probably be opened as a new pull request outside of this one. Do you think the changes in this request are ready to be pulled in?

Cheers, David

vraj004 commented 12 years ago

Hi guys, this is ready to be pulled into the main opencmiss code. Thanks to all for the help!