Modify the whole mesh divided in two subdomains by moving the interface using ALE.


257
views
0
5 months ago by
Hi,

I would like to know how to update the moving interface between two subdomains of a Mesh using the ALE class in FEniCS. I have two subdomains \(\Omega_1\,  \Omega_2\) separated by an internal interface  \(\Gamma\). I have constructed the initial mesh using gmsh and my plan is to update the moving surface using the ALE class instead of recompiling another mesh, which I believe will be much more expensive computationally.

Here is the piece of code:

import fenics
import dolfin

import numpy as np
import scipy as sp

import matplotlib.pyplot as plt


mesh = fenics.Mesh("DMESHUPDATE.xml")
boundaries = fenics.MeshFunction("size_t", mesh, "DMESHUPDATE_facet_region.xml")
domains = fenics.MeshFunction("size_t", mesh, "DMESHUPDATE_physical_region.xml")
meshReference = Mesh(mesh) #make a copy of the mesh for referencing the vertices IDs

#the interface is marked in boundaries with number 1
# Get unique indices of vertices on the interface

ivertex = list(set(sum((facet.entities(0).tolist()
                        for facet in SubsetIterator(boundaries, 1)), [])))

# Move
coordinates = mesh.coordinates()

#Change from excited interface to relaxed
coordinates[ivertex, 1] = 0.0

ALE.move(meshReference,mesh)
meshplot = File('updatemeshtests/test.pvd')
meshplot << mesh​

I get an error

"*** Error: Unable to access mesh data.
*** Reason: Mesh data array named "parent_vertex_indices" does not exist.
*** Where: This error was encountered inside MeshData.cpp.

Can somebody help me?

Thank you!
Community: FEniCS Project

1 Answer


0
5 months ago by
I double if you can move mesh, by only moving interface coordinates.  the nearly vertices need also some displacement to keep topo?

# Move
coordinates = mesh.coordinates()

#Change from excited interface to relaxed
coordinates[ivertex, 1] = 0.0​
Please login to add an answer/comment or follow this question.

Similar posts:
Search »