Re: [petsc-users] Using DMPlex

2017-12-25 Thread Mohammad Hassan Baghaei
Hello

I want to know whether is it possible that a specific field in the section have 
been defined at some time on edges and other times on the vertices. This change 
in the dof , I think, may cause problem, especially in the global vector size 
of the dm. At times when the field changes to be defined on the edges, I think, 
I need to reset the dof with routine. I know how to do this, thanks to Matt.  
But, how I can deal with the global vector. At first, the global vector was 
defined on the vertices, but by this change. How would the global vector would 
response? Do I need to change the global vector?

Thanks

Amir

 

 

 

Hello

I am using the DMPlex interface for the solving PDEs.

 

Great. What discretization are you using?

 

A  part of mesh, considering, is staggered grid, at the location of middle of 
each edge.

 

So you would like to put variables at each edge midpoint?

 

After generation of main grid points, I find it hard to have the staggered grid 
at the prescribed location.

 

In Plex, the topology is specified by the DMPlex, but the dof layout is 
specified by a PetscSection. To put

variables on edges, you could use:

 

DMGetDefaultSection(dm, &s);

DMPlexGetDepthStratum(dm, 1, &eStart, &eEnd);

for (e = eStart; e < eEnd; ++e) {

  PetscSectionAddDof(s, e, 1);

}

 

and of course any other dofs you are using.

 

I want to know how to deal with the staggered besides of main grid. Is it 
better to have another DM for the staggered?

 

Another option is to use several DMDA. This has its own drawbacks.

 

Is it possible to extend the DMChart and inserting the points.

 

If the chart does not have edges, it is because it has not been interpolated. 
Either pass the PETSC_TRUE, or call

 

  
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexInterpolate.html

 

  Thanks,

 

  Matt

 

I would really appreciate for your time.

Amir  





 

-- 

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

 

https://www.cse.buffalo.edu/~knepley/  



Re: [petsc-users] Linear system solvers for unsymmetrical matrix

2017-12-25 Thread Smith, Barry F.

  Normally for pressure Poisson's with standard discretizations such as finite 
differences, finite elements/volumes multigrid (either geometric or algebraic 
depending on the circumstances) is absolutely the go to method and it is rare 
to have a reason to use something else.

  For SPH you will need to do a literature search to see what is viable for 
solving the pressure Poisson. Intuitively for very large problems you will need 
a hierarchical solver (like multigrid) that takes advantage of the elliptic 
nature of the problem. Simple arguments about communication of information seem 
to indicate that solvers such as conjugate gradient with Jacobi preconditioner 
will not scale for large problems.

   Barry




> On Dec 25, 2017, at 8:11 AM, 我  wrote:
> 
> Thanks for your reply. My research is focused on the in-compressible SPH 
> which is kind of particle method in CFD and I want to solve the pressure 
> Poisson's equation during the computation. I think the PDE is an elliptic 
> one. The matrix size is as large as possible. For now, the problem is just 2 
> dimension and the number of unknowns is about 250,000. But in the future, it 
> will expand to 3D and the number of unknowns will be millions. In addition, 
> choosing the suitable preconditioner should be another key factor for the 
> iterative algorithm, would you mind providing me some suggestions about it ?
> Thank you again!
> Daye
> 
> 
> 
> 
> 
> 
> At 2017-12-25 19:56:31, "Smith, Barry F."  wrote:
> >
> >  Most of the linear solvers in PETSc are suitable for non symmetric 
> > problems. You should not use KSPCG, KSPCR or PCCHOLESKY since they are only 
> > for symmetric problems.
> >
> >   Finding the best solver for your problem depends on your problem and how 
> > large a problem you want to solve. Please tell use as much as possible 
> >
> >1) where the comes from, for example CFD, structural mechanics, etc
> >
> >2) if it comes from an elliptic, parabolic, or hyperbolic PDE
> >
> >and 
> >
> >3) how large a problem you need to solve, 100,000 unknowns, 10 million, a 
> >billion?
> >
> >   Barry
> >
> >
> >> On Dec 25, 2017, at 12:17 AM, 我  wrote:
> >> 
> >> Hello,
> >> I want to use PETSC to solve an unsymmetrical matrix. I find many linear 
> >> system solvers in PETSC. But I don't know which one is suitable for the 
> >> unsymmetrical matrix. I want to choose the best solver for my problem. 
> >> Would you mind give me some alternative solvers for the unsymmetrical 
> >> matrix in PETSC?
> >> Thank you very much!
> >> Daye
> >> 
> >> 
> >>  
> >
> 
> 
> 
>  



Re: [petsc-users] Linear system solvers for unsymmetrical matrix

2017-12-25 Thread Smith, Barry F.

  Most of the linear solvers in PETSc are suitable for non symmetric problems. 
You should not use KSPCG, KSPCR or PCCHOLESKY since they are only for symmetric 
problems.

   Finding the best solver for your problem depends on your problem and how 
large a problem you want to solve. Please tell use as much as possible 

1) where the comes from, for example CFD, structural mechanics, etc

2) if it comes from an elliptic, parabolic, or hyperbolic PDE

and 

3) how large a problem you need to solve, 100,000 unknowns, 10 million, a 
billion?

   Barry


> On Dec 25, 2017, at 12:17 AM, 我  wrote:
> 
> Hello,
> I want to use PETSC to solve an unsymmetrical matrix. I find many linear 
> system solvers in PETSC. But I don't know which one is suitable for the 
> unsymmetrical matrix. I want to choose the best solver for my problem. Would 
> you mind give me some alternative solvers for the unsymmetrical matrix in 
> PETSC?
> Thank you very much!
> Daye
> 
> 
>