BoundaryMesh with ghost cells


83
views
0
24 days ago by
Hi,

In my code I use the jump operator, therefore I set
parameters["ghost_mode"] = "shared_facet";

However, I get the following error from the BoundaryMesh:

*** Error: Unable to create BoundaryMesh with ghost cells.
*** Reason: Disable ghost mesh.
*** Where: This error was encountered inside BoundaryMesh.cpp.
*** Process: 1

If I disable the ghost_mesh, my jump function in the weak form does not work in parallel. I Believe I did not have this problem before. Is something changed lately? I am running dolfin-2017.1.0.

Thanks,
Murtazo
Community: FEniCS Project
Could you post an MWE and tell which version it works with?
written 24 days ago by Jan Blechta  
What is MWE? I think it worked with 2016.x versions, if I am not wrong.
written 24 days ago by Murtazo Nazarov  
MWE: Minimal working example
written 24 days ago by Stein  

Ok, here it comes MWE you said:

Test.ufl:

element = FiniteElement("Lagrange", triangle, 1)

u = TrialFunction(element)
v = TestFunction(element)
n = FacetNormal(triangle)

a = jump(inner(n, grad(u)))*avg(v)*dS


Then, main.cpp looks like:

#include <dolfin.h>
#include "Test.h"

using namespace dolfin;

int main()
{
  parameters["ghost_mode"] = "shared_vertex";

  // Create mesh and function space                                                                                                                                             
  auto mesh = std::make_shared<UnitSquareMesh>(32, 32);
  auto V = std::make_shared<Test::FunctionSpace>(mesh);

  // Define variational forms                                                                                                                                                   
  Test::BilinearForm a(V, V);

  // Create a matrix and assemble                                                                                                                                               
  Matrix A;
  assemble(A, a);

  // Create a boundary mesh                                                                                                                                                     
  BoundaryMesh boundary(*mesh, "exterior");


  return 0;
}


I have tried them with dolfin-2017.1.0 and dolfin-2016.2.0, both give

mpirun -np 2 ./demo
terminate called after throwing an instance of 'std::runtime_error'
  what():  

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to create BoundaryMesh with ghost cells.
*** Reason:  Disable ghost mesh.
*** Where:   This error was encountered inside BoundaryMesh.cpp.
*** Process: 0
*** 
*** DOLFIN version: 2017.1.0
*** Git changeset:  7f333cc629d5f12d2a9649f314e4ab02b2296ea6
*** -------------------------------------------------------------------------

terminate called after throwing an instance of 'std::runtime_error'
  what():  

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to create BoundaryMesh with ghost cells.
*** Reason:  Disable ghost mesh.
*** Where:   This error was encountered inside BoundaryMesh.cpp.
*** Process: 1
*** 
*** DOLFIN version: 2017.1.0
*** Git changeset:  7f333cc629d5f12d2a9649f314e4ab02b2296ea6
*** -------------------------------------------------------------------------


If I disable the ghost mesh, then I get another error:

mpirun -np 2 ./demo
terminate called after throwing an instance of 'std::runtime_error'
terminate called after throwing an instance of 'std::runtime_error'
  what():  

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to assemble form.
*** Reason:  Incorrect mesh ghost mode "none" (expected "shared_vertex" or "shared_facet" for interior facet integrals in parallel).
*** Where:   This error was encountered inside AssemblerBase.cpp.
*** Process: 1
*** 
*** DOLFIN version: 2017.1.0
*** Git changeset:  7f333cc629d5f12d2a9649f314e4ab02b2296ea6
*** -------------------------------------------------------------------------

  what():  

*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
***     fenics-support@googlegroups.com
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------------------------------------------------------------------------
*** Error:   Unable to assemble form.
*** Reason:  Incorrect mesh ghost mode "none" (expected "shared_vertex" or "shared_facet" for interior facet integrals in parallel).
*** Where:   This error was encountered inside AssemblerBase.cpp.
*** Process: 0
*** 
*** DOLFIN version: 2017.1.0
*** Git changeset:  7f333cc629d5f12d2a9649f314e4ab02b2296ea6
*** -------------------------------------------------------------------------

written 24 days ago by Murtazo Nazarov  
I believe this never worked, it does not work in 2016.1.0, the check is there for a long time: https://bitbucket.org/fenics-project/dolfin/commits/62bd2ae1420a5f927d8bcf0c0df717dc1aedf7bd. Contributions are welcome.
written 22 days ago by Jan Blechta  
I have double checked my code, it seems it works in dolfin-hpc, a branch developed at KTH. I thought it also did here, apparently not.
written 22 days ago by Murtazo Nazarov  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »