How to write a .config file to set the boundary conditions?

79 views
Skip to first unread message

alex.a...@gmail.com

unread,
Jun 3, 2017, 4:29:34 AM6/3/17
to mofem...@googlegroups.com
Hello,

I using Salome to make meshes. I was wondering how to write a .config file to set the boundary conditions on a .med file and which code to use?
Thank you for the help

Lukasz Kaczmraczyk

unread,
Jun 3, 2017, 5:05:21 AM6/3/17
to mofem...@googlegroups.com
Hello Alex,

In Salome, you name groups; also you can name mesh or meshes.  For example, you make cube mesh, face on the bottom you can name "FixAll", faces on the top you can name "Pressure". Those are just names; you have to add them meaning in the configurational file.

All groups and meshes created in Salome are visible in MoFEM as blocksets, config file is to define them so that you can run analysis. Let look at example, upload or go to fracture mechanics module. 

First, run, you will see all groups meshes as blocksets and numbers next to them,
../tools/read_med -med_file examples/circular_pate_in_infinite_body/forma07.med
As result of this command, file on native MoAB format is created, i.e. out.h5m. On the screen you will see, 
lib version 0.5.63
git commit id
338ae20859909d8ed9169dbe3e817aedc166bf71
Reading MED file V3.2.0 using MED library V3.2.0
Check mesh Mesh_1 nsteps 1
Reading mesh Mesh_1 nsteps 1
Read number of nodes 1044
meshset
12682136550675316739 type BLOCKSET UNKNOWNNAME msId 1 name Mesh_1
meshset
12682136550675316740 type BLOCKSET UNKNOWNNAME msId 2 name Bottom
meshset
12682136550675316741 type BLOCKSET UNKNOWNNAME msId 3 name Crack
meshset
12682136550675316742 type BLOCKSET UNKNOWNNAME msId 4 name Node1
meshset
12682136550675316743 type BLOCKSET UNKNOWNNAME msId 5 name Node2
meshset
12682136550675316744 type BLOCKSET UNKNOWNNAME msId 6 name Node3
meshset
12682136550675316745 type BLOCKSET UNKNOWNNAME msId 7 name SYMX
meshset
12682136550675316746 type BLOCKSET UNKNOWNNAME msId 8 name SYMY
meshset
12682136550675316747 type BLOCKSET UNKNOWNNAME msId 9 name Top
meshset
12682136550675316739 type BLOCKSET UNKNOWNNAME msId 1 name Mesh_1
meshset
12682136550675316740 type BLOCKSET UNKNOWNNAME msId 2 name Bottom
meshset
12682136550675316741 type BLOCKSET UNKNOWNNAME msId 3 name Crack
meshset
12682136550675316742 type BLOCKSET UNKNOWNNAME msId 4 name Node1
meshset
12682136550675316743 type BLOCKSET UNKNOWNNAME msId 5 name Node2
meshset
12682136550675316744 type BLOCKSET UNKNOWNNAME msId 6 name Node3
meshset
12682136550675316745 type BLOCKSET UNKNOWNNAME msId 7 name SYMX
meshset
12682136550675316746 type BLOCKSET UNKNOWNNAME msId 8 name SYMY
meshset
12682136550675316747 type BLOCKSET UNKNOWNNAME msId 9 name Top
Note blocks are printed twice, for the state during reading and state at the writing to out.h5m.

With the blocksets number, you can write config file,
# See details here:
# http://mofem.eng.gla.ac.uk/mofem/html/struct_mo_f_e_m_1_1_meshsets_manager.html#ace97ea769e74c3d83ede26e38c3a09a2

[block_1]
# Applying material block (isotropic elastic material)
id
=1001
add
=BLOCKSET
name
=MAT_ELASTIC
young
=200000000000
poisson
=0.3
thermalexpansion
=0

[block_2]
# Applying pressure boundary conditions
id
=1002
add
=SIDESET
pressure_flag2
=1       # 0: Pressure is interpreted as pure pressure 1: pressure is interpreted as total force
pressure_magnitude
=1000000  # Positive pressure means tension.

[block_3]
# Crack surface
id
=200   # ID must be 200
add
=SIDESET

[block_9]
id
=1009
add
=SIDESET
pressure_flag2
=1       # 0: Pressure is interpreted as pure pressure 1: pressure is interpreted as total force
pressure_magnitude
=1000000  # Positive pressure means tension.

[block_4]
# Applying displacement
id
=1004
add
=NODESET   # This is a NODESET bu group could be nodes and / or elements
disp_flag3
=1
disp_uz
=0.0

[block_7]
# Applying displacement
id
=1007
add
=NODESET   # This is a NODESET bu group could be nodes and / or elements
disp_flag1
=1
disp_ux
=0.0

[block_8]
# Applying displacement
id
=1008
add
=NODESET   # This is a NODESET bu group could be nodes and / or elements
disp_flag2
=1
disp_uy
=0.0

Now when you have config file you run again use read_med tool,
../tools/read_med -med_file examples/circular_pate_in_infinite_body/forma07.med -meshsets_config examples/circular_pate_in_infinite_body/forma07.config
as result you will get
meshset 12682136550675316739 type BLOCKSET UNKNOWNNAME msId 1 name Mesh_1
meshset
12682136550675316740 type BLOCKSET UNKNOWNNAME msId 2 name Bottom
meshset
12682136550675316741 type BLOCKSET UNKNOWNNAME msId 3 name Crack
meshset
12682136550675316742 type BLOCKSET UNKNOWNNAME msId 4 name Node1
meshset
12682136550675316743 type BLOCKSET UNKNOWNNAME msId 5 name Node2
meshset
12682136550675316744 type BLOCKSET UNKNOWNNAME msId 6 name Node3
meshset
12682136550675316745 type BLOCKSET UNKNOWNNAME msId 7 name SYMX
meshset
12682136550675316746 type BLOCKSET UNKNOWNNAME msId 8 name SYMY
meshset
12682136550675316747 type BLOCKSET UNKNOWNNAME msId 9 name Top
meshset
12682136550675316748 type BLOCKSET MAT_ELASTICSET msId 1001 name MAT_ELASTIC
meshset
12682136550675316749 type SIDESET PRESSURESET msId 1002
meshset
12682136550675316750 type SIDESET msId 200
meshset
12682136550675316751 type NODESET DISPLACEMENTSET msId 1004
meshset
12682136550675316752 type NODESET DISPLACEMENTSET msId 1007
meshset
12682136550675316753 type NODESET DISPLACEMENTSET msId 1008
meshset
12682136550675316754 type SIDESET PRESSURESET msId 1009

List of all implemented boundary conditions is in  
http://mofem.eng.gla.ac.uk/mofem/html/struct_mo_f_e_m_1_1_meshsets_manager.html#afdd9da98ddc1d19433aad506c1f5218e

Note that in this particular example you have special case, where you need identify crack surface, always this blockset has to be copied to sideset with id 200, this is convention in fracture module, 
[block_3]
# Crack surface
id
=200   # ID must be 200
add
=SIDESET


If something is not clear, pleas ask,
Lukasz

alex.amar.aa

unread,
Jun 12, 2017, 8:39:15 AM6/12/17
to mofem Group
Hello Lukasz,

Could it be possible to have an example for a peel test?

Lukasz Kaczmraczyk

unread,
Jun 12, 2017, 10:46:53 AM6/12/17
to mofem Group
Pleas see attached files, you can geometry, medfile and config file for boundary condition,

../tools/read_med -med_file PeelTest.med -meshsets_config confog_peel.cfg


confog_peel.cfg
PeelTest.med
peel_half.hdf

Lukasz Kaczmraczyk

unread,
Jun 14, 2017, 2:41:23 AM6/14/17
to mofem Group
Hello Alex,

I've updated mofem, to fix some problems with naming of forces. I add more other improvements, you can pull new version, follow instruction,

Installation,
docker pull likask/mofem_fracture_mechanics:latest
docker run
--name mofem_fracture_volume_v0.5.66 likask/mofem_fracture_mechanics:latest
and running container
docker run --rm=true -it \
--volumes-from mofem_fracture_volume_v0.5.66 -v $HOME:$HOME -e HOSTHOME=$HOME \
likask
/mofem_fracture_mechanics /bin/bash

Any problems, pleas contact me.
Reply all
Reply to author
Forward
0 new messages