How to install bone remodelling module and run simple example?

48 views
Skip to first unread message

Lukasz Kaczmraczyk

unread,
Jun 2, 2017, 2:14:17 PM6/2/17
to mofem...@googlegroups.com
Hello Karol,

Student using docker installation on mac os x, we have basic mofem installation working already. We need to add bone remodelling module and run a simple example. How to do it? Also, do you have links to some simple meshses for testing? 

Regards,
Lukasz

Lukasz Kaczmraczyk

unread,
Jun 3, 2017, 11:09:29 AM6/3/17
to mofem...@googlegroups.com
The web-page to start is here,
http://mofem.eng.gla.ac.uk/mofem/html/um_bone_remodelling_readnme.html

There is a way to how you can install precompiled version? Can you also show how to run example with bike frame?

Karol Lewandowski

unread,
Jun 3, 2017, 9:16:13 PM6/3/17
to mofem...@googlegroups.com
To install bone remodelling on docker go to users modules source directory e.g.: 
cd $MOFEM_INSTALL_DIR/um/users_modules/users_modules/

Next, clone the repository with the following command: 
git clone https://bitbucket.org/likask/mofem_um_bone_remodelling.git bone_remodelling

go back to users modules build and re-configure with METAIO library: 
cd ..

cmake -DCMAKE_BUILD_TYPE=Release -DWITH_METAIO=1  -DCMAKE_C_FLAGS="-Wall"  \
-DCMAKE_CXX_FLAGS="-Wall -Wno-bind-to-temporary-copy -Wno-overloaded-virtual" \
-DCMAKE_EXE_LINKER_FLAGS="-L$MOFEM_INSTALL_DIR/local/lib" users_modules

on docker command is slightly different: 
cmake -DWITH_METAIO=1 -DBUILD_SHARED_LIBS=yes -DCMAKE_BUILD_TYPE=Release users_modules

At last, compile user modules with:
make -j2 

To run the code use command: 
./bone_adaptation -my_file frame_bike.cub -my_order 2 -my_output_prt 5 -ksp_type fgmres -pc_type lu -pc_factor_mat_solver_package mumps -ksp_atol 1e-12 -ksp_rtol 1e-12 -snes_monitor -snes_type newtonls -snes_linesearch_type basic -snes_max_it 20 -snes_atol 1e-8 -snes_rtol 1e-8 -ts_type beuler -ts_dt 0.01 -ts_final_time 1 -ts_max_snes_failures -1 -my_load_history load_history2.in -young_modulus 1000 -poisson_ratio 0.3 -rho_ref 0.1 -psi_ref 2.0 -c 1.0 -m 3 -n 2 -mass_postproc -ts_monitor | tee log

VTK files can be generated using script:
./do_vtk.sh

I added the .cub file. I also presented similar procedure with basic post-processing in Youtube video.


For bike frame optimisation mesh can be generated in cubit: 
reset
set geometry engine acis
set duplicate block elements on
#
#{height=0.5}
#{width=0.01}
#
brick x 1 y 0.5 z 0.03
brick x 0.03 y 0.03 z 0.03
move volume 2 location surface 5 include_merged
chop volume 2 with volume 1 keep
imprint volume 1 with curve 37 39
delete volume 2 3 4
brick x 0.03 y 0.03 z 0.03
move volume 5 location surface 27 include_merged
chop volume 5 with volume 1 keep
imprint volume 1 with curve 71 81
delete volume 5 6 7
brick x 0.03 y 0.03 z 0.03
move volume 8 location surface 25 include_merged
chop volume 8 with volume 1 keep
imprint volume 1 with curve 127 125
delete volume 8 9 10
#MESH ALL
volume all size auto factor 6
#volume all size auto factor 5
volume all scheme tetmesh
mesh volume all
volume all scale 2
#DEFINE BOUNDARY CONDITIONS
#{area1=SurfaceArea(46)}
#{area2=SurfaceArea(26)}
#{area3=SurfaceArea(69)}

#{area6=TriArea(2478)+TriArea(2448)}
#{area4=TriArea(2350)+TriArea(2383)}
#{area5=TriArea(2511)+TriArea(2514)}

#{length=Length(11)}
#{load=1.5}
block 4 surface 46
block 4 name "FORCE_01"
block 4 attribute count 3
block 4 attribute index 1 0
block 4 attribute index 2 {-load/area1}
block 4 attribute index 3 0
block 5 surface 69
block 5 name "FORCE_02"
block 5 attribute count 3
block 5 attribute index 1 0
block 5 attribute index 2 {-load/area2}
block 5 attribute index 3 0
block 6 surface 26
block 6 name "FORCE_03"
block 6 attribute count 3 0
block 6 attribute index 2 {-load/area3}
block 6 attribute index 3 0
#DEFINE BOUNDARY CONDITIONS 
block 2 curve 10
block 2 name "DISPLACEMENT"
block 2 attribute count 6
block 2 attribute index 1 0
block 2 attribute index 2 0
block 2 attribute index 3 0
block 2 attribute index 4 1
block 2 attribute index 5 1
block 2 attribute index 6 1
block 3 curve 9
block 3 name "DISPLACEMENT_2"
block 3 attribute count 6
block 3 attribute index 1 0
block 3 attribute index 2 0
block 3 attribute index 3 0
block 3 attribute index 4 1
block 3 attribute index 5 1
block 3 attribute index 6 1
block 9 surface 1 2
block 9 name "DISPLACEMENT_3"
block 9 attribute count 6
block 9 attribute index 1 0
block 9 attribute index 2 0
block 9 attribute index 3 0
block 9 attribute index 4 0
block 9 attribute index 5 0
block 9 attribute index 6 1
block 8 volume all
block 8 name "MAT_ELASTIC"
block 8 attribute count 6
block 8 attribute index 1 1000
block 8 attribute index 2 0.2
save as "/Users/karollewandowski/moFEM/users_modules/bone_remodelling/frame_bike.cub" overwrite

While in docker you can copy the file above from Downloads folder with: 
cp  $HOSTHOME/Downloads/frame_bike.cub ./


frame_bike.cub
Reply all
Reply to author
Forward
0 new messages