On Apr 30, 2012, at 9:26 PM, Barry Smith wrote: > > On Apr 30, 2012, at 10:37 AM, Blaise Bourdin wrote: > >> Hi, >> >> I know I suggested it before and the idea did not get much traction, but it >> would be _really_ >> nice to add Real and Integer arrays to PetscBag. The idea is _not_ to add >> full fields in a bag. >> Instead, I would like to be able to pass material properties as command line >> arguments in a concise way. >> (Think of a Hooke's law in 3d and its 21 coefficients, passing it as -a >> 1,1,1,1,1,... is much nicer than >> having to pass -a_1111 1 -a 1122 1 etc). >> > I have added PetscBagIntArray() and PetscBagRealArray(). Please report > any problems.
Awesome! >> Also, fortran wrappers over PetscOptionsEnum and PetscBagRegisterEnum would >> be nice. I understand that it >> is a bit tricky since it involves passing fortran arrays of strings. > > Yup. We'd be willing to support these from FORTRAN but someone else has > to do the dirty work of figuring out how to handle those array of strings > (maybe F2003?). I'll go through my files tomorrow. Using the fortran 2003 C interoperability module, I was able to pass an array of strings between fortran and C. The issue is that all work is done from the fortran side through an interface. I am not completely sure how this would work with PETSc's fortran bindings. I'll see if I can at least write a proof of concept example, at least. Thanks again, for the arrays in bag. This will make my life MUCH easier. Blaise -- Department of Mathematics and Center for Computation & Technology Louisiana State University, Baton Rouge, LA 70803, USA Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin