# [petsc-users] I have a question for PETSc example

서승진 (기계항공및원자력공학부) mistloin at unist.ac.kr
Mon Jan 15 01:03:10 CST 2018

```Dear PETSc-user

I am Seungjin Seo, researcher of Korean Advanced Institute of Science and Technology, South Korea.

I am tring to understand the ex12.c in SNES examples, and I have a problem...

Could you give me some advise? Is there any good description or materials for PetscFE and DMPlex?

I will make a code with unstructured grid with PetscFE and SNES. My geometry is a rectangle mesh (the size is not fixed so I think this is unstructured grid).

The equation is

I will set boundry conditions as follow;

1. (Top-side boundary) Neumann boundary

2. (Bottom-side boundary) Neumann boundary

3. (Left-side boundary) Dirichlet boundary

4. (Right-side boundary) Dirichlet boundary

In example ex12.c in SNES, load vector f is defiend as f_0, and neumann boundary condition is defined as f_bd_0. f_1 means the test function gradient term. The example set general type of neumann boundary condition on f_bd_0, but I want to set each boundary condition individually. Could you give me some advise?

Thansk for reading my email.

Best regard,

Seungjin Seo

________________________________
보낸 사람: Smith, Barry F. <bsmith at mcs.anl.gov>
보낸 날짜: 2017년 12월 21일 목요일 오후 3:46:42
받는 사람: 서승진 (기계항공및원자력공학부)
참조: petsc-users at mcs.anl.gov
제목: Re: [petsc-users] I have a question for PETSc example

In deed you can, yes many PETSc examples only feature a single field for simplicity, but multiple fields are fine. You simple provide your FormFunction and FormJacobian to handle both degrees of freedom per cell/node at the same time. You use SNES or TS depending on if your problem is time dependent and then use -pc_type lu to start. Once you have the physics correct come back and ask us about optimizing the linear solver with preconditioners; but until you have the physics correct it is absurd to waste time worrying about making the linear solver efficient. What you want to do, many people do and is not a big deal.

Barry

> On Dec 21, 2017, at 12:27 AM, 서승진 (기계항공및원자력공학부) <mistloin at unist.ac.kr> wrote:
>
> Dear PETSc-user
>
>
> I am Seungjin Seo, researcher of Korean Advanced Institute of Science and Technology, South Korea.
>
>
>
> I am trying to solve thermal and fluid equations within a porous structure.
> The thermal equation includes a non-linear term of pressure and the fluid equation has a boundary condition using temperature gradient.
> Is there any way I can solve these two equations at the same time, instead of solving temperature first with previous pressure distribution and then pressure and update temperature?
> Many examples solve only one PDF instead of coupling several physics.
> Please recommend me which solver is appropriate for my case?
>
> Best regards,
> Seungjin Seo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180115/521b96fc/attachment.html>
```

More information about the petsc-users mailing list