On Tue, May 20, 2014 at 3:31 PM, Jed Brown <[email protected]> wrote:
> Christophe Ortiz <[email protected]> writes: > > Since for some reasons I need global two-dimensional arrays, what I did > is > > the following. > > I declared a PetscScalar **array outside main(), ie before dof is > > determined. > > Then, knowing dof I use malloc inside main() to allocate memory to the > > array. I use then array in different functions and in order to pass it to > > MatSetValues, I copy it to a local and classical two-dimensional > > array[dof][dof] (contiguous memory) which is passed to MatSetValues. It > > works. > > This sounds like a perverse way to structure your code, but if you > insist... > Jeje. Just trying different options...
