Copying a mesh from a interphase to another

Hi,
I have a cube with two inclusions and then two interphases. I want to copy the mesh of one interphase to another (the two interphases are geometrically exact matches). Here it’s my code, but it’s not work.

reset

{var_L=150.2999}

{var_P1_x=35.4839}
{var_P1_y=40.2234}
{var_P1_z=25.6357}

{var_P2_x=-44.4762}
{var_P2_y=-12.8528}
{var_P2_z=36.9290}

########## le cube
brick x {var_L}

########## inclusion numero 1
create sphere radius 35
move Volume 2 location {var_P1_x} {var_P1_y} {var_P1_z} include_merged
subtract body 2 from body 1

create sphere radius 35 inner radius 15
move Volume 4 location {var_P1_x} {var_P1_y} {var_P1_z} include_merged

create sphere radius 15
move Volume 5 location {var_P1_x} {var_P1_y} {var_P1_z} include_merged

########## inclusion numero 2
create sphere radius 35
move Volume 6 location {var_P2_x} {var_P2_y} {var_P2_z} include_merged
subtract body 5 from body 1

create sphere radius 35 inner radius 15
move Volume 8 location {var_P2_x} {var_P2_y} {var_P2_z} include_merged

create sphere radius 15
move Volume 9 location {var_P2_x} {var_P2_y} {var_P2_z} include_merged

########## maillage
imprint body all
merge body all

volume 4 size auto factor 5
mesh volume 4
volume 8 scheme copy source volume 4 nosmoothing
#copy mesh volume 4 onto volume 8nosmoothing
mesh volume 8

quality volume 4 allmetrics global
quality volume 8 allmetrics global

Thanks if you have any suggestion!

First, the syntax for setting variables in Trelis journal files is

#{var_name=value}

So the journal file should include a # in front of the variables like this:

#{var_L=150.2999}

#{var_P1_x=35.4839}
#{var_P1_y=40.2234}
#{var_P1_z=25.6357}

#{var_P2_x=-44.4762}
#{var_P2_y=-12.8528}
#{var_P2_z=36.9290}

Second, check your volume IDs in your move commands. After the “subtract body 2 from body 1” command, your volume IDs might be incorrect.

Hi,
Thanks for your sugesstion. It’s right, I have some error on the volume IDs.
Here it’s the new code:

reset
#{var_L=190.2999}
#{var_P1_x=35.4839}
#{var_P1_y=40.2234}
#{var_P1_z=25.6357}
#{var_P2_x=-44.4762}
#{var_P2_y=-12.8528}
#{var_P2_z=36.9290}
########## le cube
brick x {var_L}
########## inclusion numero 1
create sphere radius 35
move Volume 2 location {var_P1_x} {var_P1_y} {var_P1_z} include_merged
subtract body 2 from body 1
create sphere radius 35 inner radius 15
move Volume 4 location {var_P1_x} {var_P1_y} {var_P1_z} include_merged
create sphere radius 15
move Volume 5 location {var_P1_x} {var_P1_y} {var_P1_z} include_merged
########## inclusion numero 2
create sphere radius 35
move Volume 6 location {var_P2_x} {var_P2_y} {var_P2_z} include_merged
subtract body 5 from body 1
create sphere radius 35 inner radius 15
move Volume 8 location {var_P2_x} {var_P2_y} {var_P2_z} include_merged
create sphere radius 15
move Volume 9 location {var_P2_x} {var_P2_y} {var_P2_z} include_merged
########## maillage
imprint body all
merge body all
volume 4 size auto factor 5
mesh volume 4
volume 8 scheme copy source volume 4 nosmoothing
copy mesh volume 4 onto volume 8 nosmoothing
mesh volume 8
quality volume 4 allmetrics global
quality volume 8 allmetrics global

I want to mesh the two hollow-spheres (volume 4 and 8) as the same. They have surfaces and volumes exact matches.
I read discussion in the Trelis’s guide about the copy mesh command and I tried, but it isn’t working.
The syntax I used to copy mesh, it’s right?
Thanks!

The syntax for “scheme copy” is correct; however, this command links the two volumes together so that the scheme of volume 8 is dynamically connected to volume 4. Changing the scheme on vol 4 automatically changes the scheme on vol 8. It is not a one-time copy of the scheme.

Currently, the hollow spheres are not meshing. This is because Trelis needs to know how the mesh is to be structure. Trelis knows what to do with a sphere, but the hollow sphere doesn’t have a starting or stopping place. The attached journal file cuts the spheres and meshes them. The meshes are identical.

Is this what you are looking to do?
interface.jou (1.59 KB)