From: Travis A. <aus...@ya...> - 2006-12-28 19:11:33
|
John and Roy,=0A=0AThanks for your comments. It appears that xta/xtr is re= served for data on a mesh =0Adescribed by an xda/xdr file. Here is the des= cription from the MeshData example =0A(Example 12):=0A=0A The xtr/xta f= ormat is simply an extension of the=0Axdr/xda format to read/write also =0A= nodal/element-associated=0Afloating-point data. The xtr interface of = the MeshData=0A=0A creates stand-alone files that may be binary or ASCI= I.=0AYou cannot append files =0A created by the MeshData I/O methods=0A= to a mesh file (xdr/xda). =0AThe xtr files may =0A be seen as a "backdr= op", especially when=0Abinary files are preferred. Note that unv =0A f= iles are always=0AASCII and may become pretty big!=0A=0ANote the last line = which is why I'd prefer not to use unv files (but I am) except for the =0Af= act that they can be gzip'd. =0A=0AFor further reference, here is as I see= it the problem with reading in MeshData using =0Axta/xtr format.=0A=0A = The problem is in xdr_io.C, subroutine read_mesh. In particular, look=0A = at lines 2099-2131, which is supposed to add foreign_ids to nodes. Thi= s=0A actually never happens which causes the code to crash when you try= to=0A read in data to those nodes.=0A=0A This never happens becaus= e mesh_data is null because it is supposed to=0A be passed in as an arg= ument but in the call to read_mesh (line 1924 or=0A 1947) mesh_data is = not passed in. Fixing this is not as easy as it=0A looks.=0A=0A Th= ere is more to it if you want to investigate. Try it for a simple=0A e= xample (ex12) and see what happens for you. Hopefully I've made a=0A m= istake and I'm wrong.=0A=0ABack to the original problem with using UNV file= s and reading in data. What I have =0Adone at the moment is to have all of= the processors read in the mesh, instead of =0Aprocessor 0 reading in mesh= and distributing. This ensures close_foreign_id_maps is=0Acalled from unv= _io.C by all processors. It seems to work for now but is obviously =0Asubop= timal. The other idea I had was what John proposed but requires a little b= it of =0Awork. I'll eventually look at this and have processor 0 read in M= eshData and then =0Adistribute to other processors using routines similar t= o mesh_communication.C.=0A=0AThat's all for now. Thanks for your help.=0A= =0ATravis=0A=0A----- Original Message ----=0AFrom: John Peterson <peterson@= cfdlab.ae.utexas.edu>=0ATo: Travis Austin <aus...@gm...>=0ACc: Libme= sh-...@li...=0ASent: Thursday, December 28, 2006 6:11:19 = PM=0ASubject: [Libmesh-users] Mesh Data=0A=0AHi!=0A=0AI'm curious...do you= have any idea why the MeshData class refers=0Ato it as an xta/xtr file ins= tead of the normal xda/xdr (binary/ascii)=0Afile extensions?=0A=0AAs far as= the MeshData class goes, it is quite possible that it does=0Anot work in p= arallel; this would be the case if the original=0Adevelopers only used it i= n serial. If you can make the entire class=0A"serial" i.e. wrap more stuff= in "if (libMesh::processor_id()=3D=3D0)",=0Aand then communicate the neces= sary information using the routines=0Asimilar to those found in mesh_commun= ication.C, that might be enough=0Ato get it working.=0A=0AI've done a very = small amount of MPI programming, so I might be=0Aable to help out if you ha= ve a specific question.=0A=0A-John=0A=0A=0A=0A=0ATravis Austin writes:=0A >= Hi,=0A > =0A > I am building reaction-diffusion problems with varying diff= usion=0A > and reaction coefficients (each node has its own value) and I am= =0A > currently reading in these coefficients using MeshData. I've been=0A= > using MeshData because I find it is a bit more natural than using=0A > m= ultiple EquationSystems to read in data, which was suggested=0A > previousl= y.=0A > =0A > I originally tried to use MeshData with XTA/XDA mesh formats = but=0A > ran into a problem that is not easily fixed. So I've gone to usin= g=0A > UNV mesh files (both for mesh and data). Everything works in the=0A= > serial case (reading in mesh and data runs and I can access the=0A > dat= a) but not in the parallel case. I get the following error.=0A > =0A > (*)= monodomain_example_aliev: src/mesh/mesh_data.C:240: void=0A > MeshData::re= ad(const std::string&): Assertion `_elem_id_map_closed=0A > && _node_id_map= _closed' failed.=0A > =0A > I believe that the problem is that processor 1 = has not closed his=0A > elem_id_map or node_id_map which is only done by pr= ocessor 0 who=0A > reads in the mesh.=0A > =0A > See following lines in mes= h.C and unv_io.C=0A > =0A > mesh.C:719 UNVIO(*this, *mesh_data).read (name)= ;=0A > =0A > unv_io.C:260 this->_mesh_data.close_foreign_id_maps ();=0A > = =0A > This last line is only performed by processor 0 since only he reads= =0A > in the mesh. So when reading in MeshData, processor 1 causes above= =0A > error (*). Even if this was fixed, it doesn't look like that=0A > pr= ocessor 0 communicates the MeshData after he reads it in so if=0A > this is= to work a few (hopefully just a few) bits need fixed up.=0A > =0A > My que= stion is whether or not there is any long term support for=0A > MeshData us= ing either UNV or XDA or any other format. I'm worried=0A > I'm going to k= eep running into problems using MeshData since I've=0A > found one using XT= A/XDA and now a second using UNV with >1=0A > processors. It seems most pe= ople run problems using libMesh where=0A > parameters are constant so it ma= kes me think that most people don't=0A > care about reading in data to a me= sh. I do and I'd like to find=0A > something reliable without redeveloping= something completely new.=0A > Any thoughts?=0A > =0A > Cheers, Travis Aus= tin=0A=0A------------------------------------------------------------------= -------=0ATake Surveys. Earn Cash. Influence the Future of IT=0AJoin Source= Forge.net's Techsay panel and you'll get the chance to share your=0Aopinion= s on IT & business topics through brief surveys - and earn cash=0Ahttp://ww= w.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV=0A__= _____________________________________________=0ALibmesh-users mailing list= =0AL...@li...=0Ahttps://lists.sourceforge.net/list= s/listinfo/libmesh-users=0A=0A=0A=0A=0A____________________________________= ______________=0ADo You Yahoo!?=0ATired of spam? Yahoo! Mail has the best = spam protection around =0Ahttp://mail.yahoo.com |