[petsc-users] Question for time dependent problems

2011-07-05 Thread Barry Smith

On Jul 5, 2011, at 5:42 PM, Lisandro Dalcin wrote:

> On 5 July 2011 17:35, Barry Smith  wrote:
>> 
>>> Beginning of a time step (1st implicit stage of RK scheme):
>>> 1. Use MatZeroEntries on the preconditioner
>> 
>>  Do not call MatZeroEntries on a freshly created matrix (that destroys the 
>> preallocation pattern) so skip the MatZeroEntries the first time.
>> 
> 
> What do you mean? The OP said that the nonzero structure was set at
> problem set up.

   Perhaps I miss understood. I interpreted that to mean the matrix was 
provided with the correct preallocation information (and not the nonzero 
structure) but yes if the nonzero structure is already set then one can call 
MatZeroEntries() at that point.

   Perhaps we should "fix" MatZeroEntries()" to not screw up preallocation 
information!

   Barry


> 
> -- 
> Lisandro Dalcin
> ---
> CIMEC (INTEC/CONICET-UNL)
> Predio CONICET-Santa Fe
> Colectora RN 168 Km 472, Paraje El Pozo
> 3000 Santa Fe, Argentina
> Tel: +54-342-4511594 (ext 1011)
> Tel/Fax: +54-342-4511169



[petsc-users] Question for time dependent problems

2011-07-05 Thread Lisandro Dalcin
On 5 July 2011 17:35, Barry Smith  wrote:
>
>> Beginning of a time step (1st implicit stage of RK scheme):
>> 1. Use MatZeroEntries on the preconditioner
>
> ?Do not call MatZeroEntries on a freshly created matrix (that destroys the 
> preallocation pattern) so skip the MatZeroEntries the first time.
>

What do you mean? The OP said that the nonzero structure was set at
problem set up.

-- 
Lisandro Dalcin
---
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169


[petsc-users] A Beginner Question

2011-07-05 Thread Matthew Knepley
On Tue, Jul 5, 2011 at 2:04 PM, Stefan Kolb  wrote:

> Hi all,
> i have written a littel test program, to check how PETSc stores a matrix
> across two processes.
>
> static char help[] = "PETSc test";
>
> #include "stdio.h"
>
> #include "petscksp.h"
>
> int main(int argc,char **args)
> {
>Mat A;
>PetscIntN=100,M=100, row_start = 0,
> column_start = 0, row_end = 0, column_end = 0, rank = 0, local_rows = 0,
> local_columns = 0,nproc=0;
>PetscErrorCode  ierr;
>PetscScalar value =0.;
>
>PetscInitialize(&argc,&args,(char *)0,help);
>
>MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
>MPI_Comm_size(PETSC_COMM_WORLD,&nproc);
>
>ierr = PetscPrintf(PETSC_COMM_WORLD,"Number of Processes
> %d\n",nproc);CHKERRQ(ierr);
>ierr = MatCreate(PETSC_COMM_WORLD,&A); CHKERRQ(ierr);
>ierr = MatSetSizes(A,PETSC_DECIDE, PETSC_DECIDE,N,M); CHKERRQ(ierr);
>ierr = MatSetFromOptions(A);CHKERRQ(ierr);
>ierr = MatGetOwnershipRange(A,&row_start,&row_end);CHKERRQ(ierr);
>ierr =
> MatGetOwnershipRangeColumn(A,&column_start,&column_end);CHKERRQ(ierr);
>ierr = MatGetLocalSize(A,&local_rows,&local_columns);CHKERRQ(ierr);
>
>printf("process=%d \t row_start=%d \t row_end=%d \t column_start=%d
> \t column_end=%d \t local_rows=%d \t
> local_columns=%d\n",rank,row_start,row_end,column_start,column_end,local_rows,local_columns);
>
>ierr = MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
>ierr = MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
>
>ierr = MatDestroy(A); CHKERRQ(ierr);
>
>ierr = PetscFinalize();CHKERRQ(ierr);
>return 0;
> }
>
> The output of the program (using 2 processes) is:
> Number of Processes 2
> process=0row_start=0 row_end=50  column_start=0
>  column_end=50   local_rows=50   local_columns=50
> process=1row_start=50row_end=100 column_start=50
> column_end=100  local_rows=50   local_columns=50
>
> So if the output of my program is right the process with rank=0 owns a
> matrix with 50 rows and 50 columns in the same way the process with rank=1.
> This cant be right because on both processes only one half of the global
> matrix is stored. Wat is the error in my test programm?
> I tried to set the local size of the matrix by hand with the command
> MatSetSizes(A,50, 100,N,M) but then i get an error from PETSc. How can i
> tell PETSc to store the first 50 rows on process 0 and the next 50 rows on
> process 1?
>

All matrix formats store by row. The column ownership is only used to
determine compatibility with vector it might act on.

  Thanks,

 Matt


> Regards,
> Stefan
>



-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110705/7d965ae6/attachment.htm>


[petsc-users] PETSc recommended visualization packages

2011-07-05 Thread Blaise Bourdin
Hi,

Let me add to Barry's frustration. I have spent most the last week trying to 
render animations of reasonably large computations (about 25M 3d unstructured 
elements divided in up to 25,000 exodusII files).

- Paraview is simple to get started with in the GUI. In theory, it is 
scriptable in python, but there is pretty much no documentation on the python 
API, which seems to be a mismatched combination of vtk calls, and several 
levels / revisions / versions of paraview interfaces. It is possible to 
generate a python trace of gui interactions, but for some reasons, some actions 
(image format and sizes, movies framnerates, for instance) are not recorded.
- visit's gui take a little more time to master, it is also scriptable in 
python. The python capture is more readable, and is somewhat documented (the 
doc is for 1.4.0, the current version 2.3.0). Movie generation is a pain and as 
far as I understand not feasible inside a python script. Instead, one has to 
save a session, and reopen it with the -movie CL interface. 
- Unless you are willing to rebuild visit or paraview from source (which is 
highly non-trivial and poorly documented), all these package install their own 
python, so that you don't have access to all other packages you may have on 
your system. I was not able to figure out how to import paraview or visit from 
my own python using the binary distributions
- EnSight is a good alternate choice if you can afford it. It is not open and 
not cheap but is quite good, reads most major format and has a pretty 
responsive support team. Their python scripting is well documented, but as far 
as I understand, it is not possible to import ensight from a python script. 
Instead, Ensight runs python scripts.

- About data formats: hdf5 / xdmf seems very well supported, but again, 
human-readable documentation on xdmf is lacking. It would be really nice if one 
could generate the proper xdmf description and geometry from a dm of a dmmesh. 
Would it be also possible to interface with moab and gain access to all the 
file formats they support?

Finally, I am skeptical about the benefit of implementing yet another file 
format that is incompatible with existing analysis, post processing, and mesh 
generation tools. 

Blaise


> Jed Brown wrote:
>> On Mon, Jul 4, 2011 at 21:44, Barry Smith > > wrote:
>> 
>>What are the recommended visualization packages for use with PETSc
>>(for example making movies of contour plots and isosurfaces) and
>>what are the recommended data formats to use to save Vecs for
>>visualization?
>> 
>> 
>> VisIt
> Any links to VisIt? Goggle produced nothing.
> Thanks,
> Stephen
> 
>> and ParaView are the primary choices. In my experience, VisIt is a more 
>> complete system, but ParaView is easier to install and probably easier to 
>> get started with.
>> 
>> The VTK XML or binary formats are the easiest to get started with. See 
>> src/ts/examples/tutorials/ex14.c for an example of writing an XML file 
>> containing two fields on different grids (2D and 3D, structured, but 
>> deformed) in parallel. All file formats are horrible non-extensible crud, 
>> usually grown out of a particular application with structured grids of 
>> low-order/non-exotic basis functions on unstructured grids. They tend not to 
>> retain enough semantic information to reconstruct a state for further 
>> computations and also work for visualization without needing additional 
>> application-provided information.
> 
> 
> -- 
> stephen.wornom at inria.fr
> 2004 route des lucioles - BP93
> Sophia Antipolis
> 06902 CEDEX
>   
> Tel: 04 92 38 50 54
> Fax: 04 97 15 53 51
> 
> 

-- 
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









[petsc-users] A Beginner Question

2011-07-05 Thread Stefan Kolb
Hi all,
i have written a littel test program, to check how PETSc stores a matrix across 
two processes.

static char help[] = "PETSc test";

#include "stdio.h"

#include "petscksp.h"

int main(int argc,char **args)
{
Mat A;
PetscIntN=100,M=100, row_start = 0, 
column_start = 0, row_end = 0, column_end = 0, rank = 0, local_rows = 0, 
local_columns = 0,nproc=0;
PetscErrorCode  ierr;
PetscScalar value =0.;

PetscInitialize(&argc,&args,(char *)0,help);

MPI_Comm_rank(PETSC_COMM_WORLD,&rank);
MPI_Comm_size(PETSC_COMM_WORLD,&nproc);

ierr = PetscPrintf(PETSC_COMM_WORLD,"Number of Processes 
%d\n",nproc);CHKERRQ(ierr);
ierr = MatCreate(PETSC_COMM_WORLD,&A); CHKERRQ(ierr);
ierr = MatSetSizes(A,PETSC_DECIDE, PETSC_DECIDE,N,M); CHKERRQ(ierr);
ierr = MatSetFromOptions(A);CHKERRQ(ierr);
ierr = MatGetOwnershipRange(A,&row_start,&row_end);CHKERRQ(ierr);
ierr = 
MatGetOwnershipRangeColumn(A,&column_start,&column_end);CHKERRQ(ierr);
ierr = MatGetLocalSize(A,&local_rows,&local_columns);CHKERRQ(ierr);

printf("process=%d \t row_start=%d \t row_end=%d \t column_start=%d \t 
column_end=%d \t local_rows=%d \t 
local_columns=%d\n",rank,row_start,row_end,column_start,column_end,local_rows,local_columns);

ierr = MatAssemblyBegin(A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
ierr = MatAssemblyEnd(A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);

ierr = MatDestroy(A); CHKERRQ(ierr);

ierr = PetscFinalize();CHKERRQ(ierr);
return 0;
}

The output of the program (using 2 processes) is:
Number of Processes 2
process=0row_start=0 row_end=50  column_start=0  
column_end=50   local_rows=50   local_columns=50
process=1row_start=50row_end=100 column_start=50 
column_end=100  local_rows=50   local_columns=50

So if the output of my program is right the process with rank=0 owns a matrix 
with 50 rows and 50 columns in the same way the process with rank=1. This cant 
be right because on both processes only one half of the global matrix is 
stored. Wat is the error in my test programm?
I tried to set the local size of the matrix by hand with the command 
MatSetSizes(A,50, 100,N,M) but then i get an error from PETSc. How can i tell 
PETSc to store the first 50 rows on process 0 and the next 50 rows on process 1?

Regards,
Stefan


[petsc-users] Matrix Construction Question

2011-07-05 Thread Barry Smith

  MatSolve() and MatMatSolve() will not return the transpose of the solution, 
they will return the solution. If you want the transpose solve you can use 
MatSolveTranspose() for a single Vec or use MatMatSolve() for the matrix case 
after transposing the original matrix if you want the transpose.

   Barry


On Jul 5, 2011, at 12:17 PM, Adam Byrd wrote:

> I have working code that produces the correct answer now, thank you. One 
> (hopefully) final question, though. The solution is actually transposed. What 
> causes this? Presumably I can use MatMatSolveTranspose to get around this, 
> but there's no man page and I want to be sure of what will happen in all 
> cases.
> 
> Respectfully,
> Adam
> 
> On Thu, Jun 30, 2011 at 4:18 PM, Hong Zhang  wrote:
> Add
>  ierr = MatGetOrdering(testMat,MATORDERING_ND,&isrow,&iscol);CHKERRQ(ierr);
> before the line
>ierr = MatFactorInfoInitialize(&luinfo);CHKERRQ(ierr);
> 
> Somehow, your matrix is numerically singular. With
> MATORDERING_NATURAL
> I get
> [0]PETSC ERROR: Detected zero pivot in LU factorization
> 
> even using MATDENSE matrix format, which calls lapack.
> With MATORDERING_ND, I get useless inverseMat.
> 
> The modified code I used is attached.
> 
> Hong
> 
> On Thu, Jun 30, 2011 at 2:30 PM, Adam Byrd  wrote:
> > I'm trying to work through what I need to do, again by practicing with a
> > small scale random problem. The general order of events seems to be: create
> > a matrix, fill it, assemble it, factor it, then one can use solvers with it.
> > When I use MatLUFactor on my matrix before using it with a solver I get this
> > error:
> > [0]PETSC ERROR: - Error Message
> > 
> > [0]PETSC ERROR: Null argument, when expecting valid pointer!
> > [0]PETSC ERROR: Null Object: Parameter # 1!
> > [0]PETSC ERROR:
> > 
> > [0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 8, Thu Mar 17 13:37:48
> > CDT 2011
> > [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> > [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> > [0]PETSC ERROR: See docs/index.html for manual pages.
> > [0]PETSC ERROR:
> > 
> > [0]PETSC ERROR: ./test on a osx-gnu-c named Macintosh-3.local by adambyrd
> > Thu Jun 30 15:27:30 2011
> > [0]PETSC ERROR: Libraries linked from
> > /Users/adambyrd/soft/petsc-3.1-p8/osx-gnu-cpp/lib
> > [0]PETSC ERROR: Configure run at Tue Jun 28 12:56:55 2011
> > [0]PETSC ERROR: Configure options PETSC_ARCH=osx-gnu-cpp --with-fc=gfortran
> > -download-f-blas-lapack=1 --download-mpich=1 --with-scalar-type=complex
> > --with-clanguage=c++
> > [0]PETSC ERROR:
> > 
> > [0]PETSC ERROR: ISInvertPermutation() line 209 in
> > src/vec/is/interface/index.c
> > [0]PETSC ERROR: MatLUFactorSymbolic_SeqAIJ() line 306 in
> > src/mat/impls/aij/seq/aijfact.c
> > [0]PETSC ERROR: MatLUFactorSymbolic() line 2534 in
> > src/mat/interface/matrix.c
> > [0]PETSC ERROR: MatLUFactor_SeqAIJ() line 945 in
> > src/mat/impls/aij/seq/aijfact.c
> > [0]PETSC ERROR: MatLUFactor() line 2417 in src/mat/interface/matrix.c
> > [0]PETSC ERROR: main() line 62 in WDtest.cpp
> > application called MPI_Abort(MPI_COMM_WORLD, 85) - process 0[unset]:
> > aborting job:
> > application called MPI_Abort(MPI_COMM_WORLD, 85) - process 0
> > I don't understand what I'm doing wrong.
> > Respectfully,
> > Adam
> > On Wed, Jun 29, 2011 at 1:26 AM, Matthew Knepley  
> > wrote:
> >>
> >> On Tue, Jun 28, 2011 at 10:20 PM, Adam Byrd  
> >> wrote:
> >>>
> >>> Matt,
> >>>
> >>> Alright, that means I need to continue learning how to use
> >>> MatSetValues(). With my 6x6 example I tried filling it with four 3x3 sub
> >>> matrices, but when I do that I get the error 'sum of local sizes 12 does 
> >>> not
> >>> equal global size.' I had 4 processors each calling MatSetValues for their
> >>> own 3x3. Graphically, I arranged the nodes 0 1
> >>>
> >>>2 3
> >>> where process 0 had global rows 0-2 and global columns 0-2; process 1 had
> >>> 0-2, 3-5; process 2 had 3-5, 0-2; and process 3 had 3-5, 3-5. >From the
> >>> documentation, I think this should be correct, but I'm not sure. Also, 
> >>> which
> >>> format would you recommend for storing the matrix?
> >>
> >> 1) With any error, send the Entire error message.
> >> 2) PETSc matrices are divided by rows, not rows and columns, see the
> >> manual section. Rows & columns only makes sense for dense matrices
> >> 3) You can still set arbitrary blocks no matter how the matrix is divided
> >> 4) The error means you tried to set both local and global dimensions, and
> >> they do not add up correctly. Just set the global dimensions
> >>Matt
> >>
> >>>
> >>> Jack,
> >>>
> >>> I'm a summer intern just getting star

[petsc-users] Question for time dependent problems

2011-07-05 Thread Travis C. Fisher
I am wondering if there is a "right way" to set up preconditioning for 
time dependent nonlinear problems (using precondtioned matrix free 
SNES). For example, I want to use implicit Runge Kutta, and freeze my 
preconditioner at the beginning of each step. Currently how I do this is:

Problem set up:
1. Specify nonzero structure of precondtioner matrix.
2. Specify MAT_NEW_NONZERO_LOCATION_ERR and MAT_KEEP_NONZERO_PATTERN.

Beginning of a time step (1st implicit stage of RK scheme):
1. Use MatZeroEntries on the preconditioner
2. Calculate and assemble preconditioning matrix
3. In the jacobian evaluation routine, use flag = SAME_NONZERO_PATTERN 
(I'd like it to use the nonzero structure I've already specified)

Subsequent nonlinear solves in time step:
1. Use flag = SAME_PRECONDITIONER in the jacobian evaluation

In this way, I only initialize the preconditioning matrix structure 
once. I am wondering if I have made any large mistakes here or if I am 
misunderstanding the character of the solver?

Is there a tutorial case for this situation? I want to note that my 
initial nonzero structure may contain entries that are zero, but may not 
be zero in subsequent calculations. I am wondering what PETSC does with 
these during ASM/ILU preconditioning? i.e. Does it remove them from my 
originally specified nonzero structure?

I appreciate any direction you can give me.

Thanks,

Travis Fisher


[petsc-users] Question for time dependent problems

2011-07-05 Thread Barry Smith

On Jul 5, 2011, at 2:38 PM, Travis C. Fisher wrote:

> I am wondering if there is a "right way" to set up preconditioning for time 
> dependent nonlinear problems (using precondtioned matrix free SNES). For 
> example, I want to use implicit Runge Kutta, and freeze my preconditioner at 
> the beginning of each step. Currently how I do this is:
> 
> Problem set up:
> 1. Specify nonzero structure of precondtioner matrix.
> 2. Specify MAT_NEW_NONZERO_LOCATION_ERR and MAT_KEEP_NONZERO_PATTERN.
> 
> Beginning of a time step (1st implicit stage of RK scheme):
> 1. Use MatZeroEntries on the preconditioner

  Do not call MatZeroEntries on a freshly created matrix (that destroys the 
preallocation pattern) so skip the MatZeroEntries the first time.

> 2. Calculate and assemble preconditioning matrix
> 3. In the jacobian evaluation routine, use flag = SAME_NONZERO_PATTERN (I'd 
> like it to use the nonzero structure I've already specified)
> 
> Subsequent nonlinear solves in time step:
> 1. Use flag = SAME_PRECONDITIONER in the jacobian evaluation
> 
> In this way, I only initialize the preconditioning matrix structure once. I 
> am wondering if I have made any large mistakes here or if I am 
> misunderstanding the character of the solver?
> 
> Is there a tutorial case for this situation? I want to note that my initial 
> nonzero structure may contain entries that are zero, but may not be zero in 
> subsequent calculations.

   Just make sure you put the zeros into the matrix the first time you build it 
and PETSc will keep the space around for the later calculations. 

> I am wondering what PETSC does with these during ASM/ILU preconditioning? 
> i.e. Does it remove them from my originally specified nonzero structure?

   It does not remove zeros so long as you put them in.

   Barry

> 
> I appreciate any direction you can give me.
> 
> Thanks,
> 
> Travis Fisher



[petsc-users] PETSc recommended visualization packages

2011-07-05 Thread Lisandro Dalcin
On 5 July 2011 12:53, Brad Aagaard  wrote:
> Hi,
>
> I agree with Blaise's assessment of ParaView. It is good for quick and
> dirty visualization, but its scripting interface is very limited.
>
> MayaVi provides a GUI along with high-level API access to VTK data
> structures through Python. One can update/modify the data values through
> the API without ever writing VTK compatible files. I read my data from
> HDF5 files using PyTables and create VTK data objects using the API. A
> similar mechanism could be used for data stored using SQLite. I think
> some Linux and Mac packaging systems include MayaVi; I usually build
> from source.
>

I recently added support (requires petsc4py, of course) for
-ksp|snes|ts_monitor_python filename.py:function|class. Perhaps you
can find this useful for "live" monitoring of simulations.


-- 
Lisandro Dalcin
---
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169


[petsc-users] Matrix Construction Question

2011-07-05 Thread Adam Byrd
s you tried to set both local and global dimensions,
> and
> >> they do not add up correctly. Just set the global dimensions
> >>Matt
> >>
> >>>
> >>> Jack,
> >>>
> >>> I'm a summer intern just getting started with this project, so I don't
> >>> know all the details yet (I can ask though). I know I need to find the
> >>> Green's function which will involve the trace of the inverted
> Hamiltonian,
> >>> as well as the rest of the matrix. I have inquired about avoiding the
> >>> inversion altogether, but my instructor doesn't believe there is a way
> >>> around it. Once I've worked through the math I want to explore other
> options
> >>> though.
> >>>
> >>> Respectfully,
> >>> Adam
> >>>
> >>> On Tue, Jun 28, 2011 at 6:08 PM, Matthew Knepley 
> >>> wrote:
> >>>>
> >>>> On Tue, Jun 28, 2011 at 5:01 PM, Adam Byrd 
> wrote:
> >>>>>
> >>>>> Actually, it's quite sparse. In the 3600x3600 there are only just 4
> >>>>> nonzero entries in each row. This means it's 99.9% empty. My smaller
> 6x6
> >>>>> example is dense, but it's only practice building and manipulating
> matrices.
> >>>>
> >>>> Ah, then its easy. Just call MatSetValues() with each block. Then use
> >>>> MUMPS to do a sparse direct solve.
> >>>>   Matt
> >>>>
> >>>>>
> >>>>> Respectfully,
> >>>>> Adam
> >>>>>
> >>>>> On Tue, Jun 28, 2011 at 5:55 PM, Matthew Knepley 
> >>>>> wrote:
> >>>>>>
> >>>>>> It sounds like you have a dense matrix (from your example). Is this
> >>>>>> true? If so, you should use Elemental (on Google Code).
> >>>>>>   Thanks,
> >>>>>>  Matt
> >>>>>>
> >>>>>> On Tue, Jun 28, 2011 at 8:55 AM, Adam Byrd 
> >>>>>> wrote:
> >>>>>>>
> >>>>>>> Hi,
> >>>>>>> I'm rather new to PETSc and trying to work out the best way to
> create
> >>>>>>> and fill a large sparse matrix distributed over many processors.
> Currently,
> >>>>>>> my goal is to create a 3600x3600 matrix in units of 12x12 blocks
> with
> >>>>>>> several blocks on any given node. I'd like to create the matrix in
> such a
> >>>>>>> way that each node only holds the information in it's handful of
> blocks and
> >>>>>>> not the entire matrix. Eventually, this matrix is to be inverted (I
> know,
> >>>>>>> inversion should be avoided, but as this is a Hamiltonian matrix
> from which
> >>>>>>> I need the Green's function, I'm unaware of a way to forgo carrying
> out the
> >>>>>>> inversion). Additionally, the values will be changed slightly and
> the matrix
> >>>>>>> will be repeatedly inverted. It's structure will remain the same.
> In order
> >>>>>>> to learn how to do this is I am starting with a small 6x6 matrix
> broken into
> >>>>>>> four 3x3 blocks and distributed one block per node. I've been able
> to create
> >>>>>>> a local 3x3 matrix on each node, with it's own values, and with the
> global
> >>>>>>> row/column IDs correctly set to [0, 1, 2] or [3, 4, 5] depending on
> where
> >>>>>>> the block is in the matrix. My problem manifests when I try to
> create the
> >>>>>>> larger matrix from the individual smaller ones. When the matrix is
> >>>>>>> constructed I'm trying to use MatSetValues and having each node
> pass in it's
> >>>>>>> 3x3 block. I end up with an error that the sum of local lengths
> 12x12 does
> >>>>>>> not match the global length 6x6. It appears as though this is from
> passing
> >>>>>>> in four 3x3s and the program interpreting that as a 12x12 instead
> of as a
> >>>>>>> 6x6 with the blocks in a grid.
> >>>>>>> My question is then: is it possible to fill a matrix as a grid of
> >>>>>>> blocks, or can I only fill it in groups of rows or columns? Also,
> am I
> >>>>>>> approaching this problem the correct way, or are there more
> efficient ways
> >>>>>>> of building this matrix with the ultimate goal of inverting it?
> >>>>>>> I have included my copy of a modified example if it helps. I do
> >>>>>>> apologize if this is answered somewhere in the documentation, I
> have been
> >>>>>>> unable to find a solution.
> >>>>>>> Respectfully,
> >>>>>>> Adam
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> What most experimenters take for granted before they begin their
> >>>>>> experiments is infinitely more interesting than any results to which
> their
> >>>>>> experiments lead.
> >>>>>> -- Norbert Wiener
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> What most experimenters take for granted before they begin their
> >>>> experiments is infinitely more interesting than any results to which
> their
> >>>> experiments lead.
> >>>> -- Norbert Wiener
> >>>
> >>
> >>
> >>
> >> --
> >> What most experimenters take for granted before they begin their
> >> experiments is infinitely more interesting than any results to which
> their
> >> experiments lead.
> >> -- Norbert Wiener
> >
> >
>
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110705/d8bdf7d9/attachment.htm>


[petsc-users] PETSc recommended visualization packages

2011-07-05 Thread Ivo Roghair
https://wci.llnl.gov/codes/visit/

This one. I agree the name is too generic to find it with just visit.
I always use "visit llnl".

2011/7/5 Stephen Wornom :
> Jed Brown wrote:
>>
>> On Mon, Jul 4, 2011 at 21:44, Barry Smith > > wrote:
>>
>> ? ?What are the recommended visualization packages for use with PETSc
>> ? ?(for example making movies of contour plots and isosurfaces) and
>> ? ?what are the recommended data formats to use to save Vecs for
>> ? ?visualization?
>>
>>
>> VisIt
>
> Any links to VisIt? Goggle produced nothing.
> Thanks,
> Stephen
>
>> and ParaView are the primary choices. In my experience, VisIt is a more
>> complete system, but ParaView is easier to install and probably easier to
>> get started with.
>>
>> The VTK XML or binary formats are the easiest to get started with. See
>> src/ts/examples/tutorials/ex14.c for an example of writing an XML file
>> containing two fields on different grids (2D and 3D, structured, but
>> deformed) in parallel. All file formats are horrible non-extensible crud,
>> usually grown out of a particular application with structured grids of
>> low-order/non-exotic basis functions on unstructured grids. They tend not to
>> retain enough semantic information to reconstruct a state for further
>> computations and also work for visualization without needing additional
>> application-provided information.
>
>
> --
> stephen.wornom at inria.fr
> 2004 route des lucioles - BP93
> Sophia Antipolis
> 06902 CEDEX
>
> Tel: 04 92 38 50 54
> Fax: 04 97 15 53 51
>
>


[petsc-users] A Beginner Question

2011-07-05 Thread Jed Brown
On Tue, Jul 5, 2011 at 09:04, Stefan Kolb  wrote:

> I tried to set the local size of the matrix by hand with the command
> MatSetSizes(A,50, 100,N,M) but then i get an error from PETSc. How can i
> tell PETSc to store the first 50 rows on process 0 and the next 50 rows on
> process 1?


What you did is correct, but MatGetOwnershipRangeColumn() returns the
ownership range of a vector that the matrix can be applied to. See the this
man page for details on how MPIAIJ matrices are stored:

http://www.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-dev/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110705/1f389a6b/attachment.htm>


[petsc-users] Number of decimals in Viewer

2011-07-05 Thread Elias Goldmann
Thank you both for the replies.
I write a few real eigenvalues to a file using PetscRealView. Do you really 
think going binary is better here? Why would that be the case?

Kind regards,
Elias


Date: Mon, 4 Jul 2011 12:21:16 -0500
From: Barry Smith
Subject: Re: [petsc-users] Number of decimals in Viewer
To: PETSc users list
Message-ID:<8302C6CC-5335-4BD3-A24A-40B2D4822959 at mcs.anl.gov>
Content-Type: text/plain; charset=us-ascii


You can simply edit the PetscRealView() src/sys/error/err.c function which 
is very simple and add more digits



On Jul 4, 2011, at 10:27 AM, Jed Brown wrote:


> >  On Mon, Jul 4, 2011 at 10:24, Elias Goldmann > itp.uni-bremen.de>  wrote:
> >  is there any possibility to change the number of decimals written to the 
> > file
> >  while using PetscRealView ?
> >  
> >  There is not currently a way to set the format/precision of ASCII numeric 
> > output, but it is generally better to use binary files for anything other 
> > than casual inspection by a human.


[petsc-users] PETSc recommended visualization packages

2011-07-05 Thread Stephen Wornom
Jed Brown wrote:
> On Mon, Jul 4, 2011 at 21:44, Barry Smith  <mailto:bsmith at mcs.anl.gov>> wrote:
>
> What are the recommended visualization packages for use with PETSc
> (for example making movies of contour plots and isosurfaces) and
> what are the recommended data formats to use to save Vecs for
> visualization?
>
>
> VisIt
Any links to VisIt? Goggle produced nothing.
Thanks,
Stephen

> and ParaView are the primary choices. In my experience, VisIt is a 
> more complete system, but ParaView is easier to install and probably 
> easier to get started with.
>
> The VTK XML or binary formats are the easiest to get started with. See 
> src/ts/examples/tutorials/ex14.c for an example of writing an XML file 
> containing two fields on different grids (2D and 3D, structured, but 
> deformed) in parallel. All file formats are horrible non-extensible 
> crud, usually grown out of a particular application with structured 
> grids of low-order/non-exotic basis functions on unstructured grids. 
> They tend not to retain enough semantic information to reconstruct a 
> state for further computations and also work for visualization without 
> needing additional application-provided information.


-- 
stephen.wornom at inria.fr
2004 route des lucioles - BP93
Sophia Antipolis
06902 CEDEX

Tel: 04 92 38 50 54
Fax: 04 97 15 53 51

-- next part --
A non-text attachment was scrubbed...
Name: stephen_wornom.vcf
Type: text/x-vcard
Size: 160 bytes
Desc: not available
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110705/5d409b73/attachment.vcf>


[petsc-users] Start multiple Jobs from one process

2011-07-05 Thread Yixun Liu
Hi,
I have a PETSc application and I can start it using the command:
mpiexec -n 4 app.exe

I would like to know if I can start the four processes in one process.

Thanks.

Yixun
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110705/45593a25/attachment-0001.htm>


[petsc-users] PETSc recommended visualization packages

2011-07-05 Thread Brad Aagaard
Hi,

I agree with Blaise's assessment of ParaView. It is good for quick and
dirty visualization, but its scripting interface is very limited.

MayaVi provides a GUI along with high-level API access to VTK data
structures through Python. One can update/modify the data values through
the API without ever writing VTK compatible files. I read my data from
HDF5 files using PyTables and create VTK data objects using the API. A
similar mechanism could be used for data stored using SQLite. I think
some Linux and Mac packaging systems include MayaVi; I usually build
from source.

Regards,
Brad


On 07/05/2011 07:58 AM, Blaise Bourdin wrote:
> Hi,
>
> Let me add to Barry's frustration. I have spent most the last week
> trying to render animations of reasonably large computations (about
> 25M 3d unstructured elements divided in up to 25,000 exodusII
> files).
>
> - Paraview is simple to get started with in the GUI. In theory, it is
> scriptable in python, but there is pretty much no documentation on
> the python API, which seems to be a mismatched combination of vtk
> calls, and several levels / revisions / versions of paraview
> interfaces. It is possible to generate a python trace of gui
> interactions, but for some reasons, some actions (image format and
> sizes, movies framnerates, for instance) are not recorded. - visit's
> gui take a little more time to master, it is also scriptable in
> python. The python capture is more readable, and is somewhat
> documented (the doc is for 1.4.0, the current version 2.3.0). Movie
> generation is a pain and as far as I understand not feasible inside a
> python script. Instead, one has to save a session, and reopen it with
> the -movie CL interface. - Unless you are willing to rebuild visit or
> paraview from source (which is highly non-trivial and poorly
> documented), all these package install their own python, so that you
> don't have access to all other packages you may have on your system.
> I was not able to figure out how to import paraview or visit from my
> own python using the binary distributions - EnSight is a good
> alternate choice if you can afford it. It is not open and not cheap
> but is quite good, reads most major format and has a pretty
> responsive support team. Their python scripting is well documented,
> but as far as I understand, it is not possible to import ensight from
> a python script. Instead, Ensight runs python scripts.
>
> - About data formats: hdf5 / xdmf seems very well supported, but
> again, human-readable documentation on xdmf is lacking. It would be
> really nice if one could generate the proper xdmf description and
> geometry from a dm of a dmmesh. Would it be also possible to
> interface with moab and gain access to all the file formats they
> support?
>
> Finally, I am skeptical about the benefit of implementing yet another
> file format that is incompatible with existing analysis, post
> processing, and mesh generation tools.
>
> Blaise


[petsc-users] Start multiple Jobs from one process

2011-07-05 Thread Jed Brown
2011/7/5 Yixun Liu 

> I have a PETSc application and I can start it using the command:
> mpiexec -n 4 app.exe
>
> I would like to know if I can start the four processes in one process.
>

Yes, but you would have to use the MPI-2 dynamic process management. It will
take some effort and I don't recommend it unless you're really sure that's
what you want.
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110705/5b852fd6/attachment.htm>


[petsc-users] Number of decimals in Viewer

2011-07-05 Thread Jed Brown
On Tue, Jul 5, 2011 at 02:42, Elias Goldmann wrote:

> I write a few real eigenvalues to a file using PetscRealView. Do you really
> think going binary is better here? Why would that be the case?


This is entirely reasonable unless your results are very nearly as accurate
as machine precision, in which case using text may lose a couple low bits in
a platform-dependent way.


Maybe it would be worth adding something like:

PetscViewerASCIIPushRealFormat(viewer,"% 20.12e");
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110705/f8513e47/attachment.htm>