Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ default:
make example-0011
make example-0012
make example-0013
make example-0101
make example-0102
make example-0111
make example-0112
make example-0302-u
make example-0401
make example-0402
make example-0404-c
make example-0101 #fails!!!!
make example-0102 #fails!!!!
make example-0111 #fails!!!!
make example-0112 #fails!!!!
make example-0302-u #fails!!!! needs mesh reader!!!
make example-0401 #fails!!!! needs mesh reader!!!
make example-0402 #fails!!!! needs mesh reader!!!
make example-0404-c #fails!!!!
make collect-results
make create-figures
make latexmk-once
Expand Down
5 changes: 3 additions & 2 deletions examples/example-0001-u/src/iron/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
add_executable(${ExampleName} ${ExampleName}.F90 ${IRON_MESH_READER_ROOT}/src/meshReader.F90)
add_executable(${ExampleName} ${ExampleName}.F90 ~/software/opencmiss/dependencies/meshReader-master/src/meshReader.F90)

target_link_libraries(${ExampleName} opencmisslibs)

install(TARGETS ${ExampleName} DESTINATION ${PROJECT_SOURCE_DIR}/bin)
configure_file(visualise.cmgui visualise.cmgui)


21 changes: 14 additions & 7 deletions examples/example-0001-u/src/iron/example.F90
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ PROGRAM LAPLACEEXAMPLE
CALL cmfe_Basis_CreateFinish(Basis,Err)

! get user-defined mesh file name
WRITE(Filename, "(A26,I1,A1,I1,A1,I1,A2,I1,A1,I1,A1,I1,A2,I1,A3)") &
& "src/cheart/meshes/domain_l", &
WRITE(Filename, "(A29,I1,A1,I1,A1,I1,A2,I1,A1,I1,A1,I1,A2,I1,A3)") &
& "../src/cheart/meshes/domain_l", &
& INT(WIDTH),"x",INT(HEIGHT),"x",INT(LENGTH), &
& "_n", &
& NUMBER_GLOBAL_X_ELEMENTS,"x",NUMBER_GLOBAL_Y_ELEMENTS,"x",NUMBER_GLOBAL_Z_ELEMENTS, &
Expand Down Expand Up @@ -384,6 +384,8 @@ PROGRAM LAPLACEEXAMPLE
END DO
CALL cmfe_Field_ParameterSetUpdateStart(GeometricField, &
& CMFE_FIELD_U_VARIABLE_TYPE,CMFE_FIELD_VALUES_SET_TYPE,Err)
CALL cmfe_Field_ParameterSetUpdateFinish(GeometricField, &
& CMFE_FIELD_U_VARIABLE_TYPE,CMFE_FIELD_VALUES_SET_TYPE,Err)

!Create the Standard Laplace Equations set
CALL cmfe_EquationsSet_Initialise(EquationsSet,Err)
Expand Down Expand Up @@ -502,11 +504,16 @@ PROGRAM LAPLACEEXAMPLE
& NUMBER_GLOBAL_X_ELEMENTS,"x",NUMBER_GLOBAL_Y_ELEMENTS,"x",NUMBER_GLOBAL_Z_ELEMENTS, &
& "_i",INTERPOLATION_TYPE,"_s",SOLVER_TYPE,"/Example"
filename=trim(filename)
CALL cmfe_Fields_NodesExport(Fields,filename,"FORTRAN",Err)
CALL cmfe_Fields_ElementsExport(Fields,filename,"FORTRAN",Err)
CALL cmfe_Fields_Finalise(Fields,Err)

!Finialise CMISS
! With develop 10.2018: Directory should be created first, this call will cause an error:
!CALL cmfe_Fields_NodesExport(Fields,filename,"FORTRAN",Err)
!CALL cmfe_Fields_ElementsExport(Fields,filename,"FORTRAN",Err)
! Easy alternative:
CALL cmfe_Fields_NodesExport(Fields,"laplace_equation","FORTRAN",Err)
CALL cmfe_Fields_ElementsExport(Fields,"laplace_equation","FORTRAN",Err)

CALL cmfe_Fields_Finalise(Fields,Err)

!Finalise CMISS
! Deallocate variables that store mesh data as soon as we don't need them anymore
IF(ALLOCATED(NodesImport)) DEALLOCATE(NodesImport)
IF(ALLOCATED(ElementsImport)) DEALLOCATE(ElementsImport)
Expand Down
22 changes: 22 additions & 0 deletions examples/example-0001-u/src/iron/visualise.cmgui
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$name = "laplace_equation";

gfx read node $name.part0.exnode;
gfx read elem $name.part0.exelem;

gfx def faces egroup $name;

gfx modify g_element $name general clear circle_discretization 6 default_coordinate Coordinate element_discretization "4*4*4" native_discretization none;
gfx modify g_element $name lines select_on invisible material default selected_material default_selected;
gfx modify g_element $name surfaces select_on material default data Phi spectrum default selected_material default_selected render_shaded;
gfx modify g_element $name node_points glyph sphere general size "0.025*0.025*0.025" centre 0,0,0 font default label cmiss_number select_on material blue selected_material default_selected;
gfx modify g_element $name cylinders constant_radius 0.005 select_on material gold selected_material default_selected render_shaded;

gfx create window 1 double_buffer;
gfx modify window 1 image scene default light_model default;
gfx modify window 1 image add_light default;
gfx modify window 1 layout simple ortho_axes z -y eye_spacing 0.25 width 567 height 653;
gfx modify window 1 set current_pane 1;
gfx modify window 1 background colour 0 0 0 texture none;
gfx modify window 1 view parallel eye_point -1.32423 -1.97615 2.23909 interest_point 0.5 0.5 0.5 up_vector 0.305326 0.386341 0.870354 view_angle 37.5028 near_clipping_plane 0.0353321 far_clipping_plane 12.6265 relative_viewport ndc_placement -1 1 2 2 viewport_coordinates 0 0 1 1;
gfx modify window 1 overlay scene none;
gfx modify window 1 set transform_tool current_pane 1 std_view_angle 40 normal_lines no_antialias depth_of_field 0.0 fast_transparency blend_normal;
6 changes: 6 additions & 0 deletions examples/example-0001/src/iron/example.F90
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,14 @@ PROGRAM LAPLACEEXAMPLE
& NUMBER_GLOBAL_X_ELEMENTS,"x",NUMBER_GLOBAL_Y_ELEMENTS,"x",NUMBER_GLOBAL_Z_ELEMENTS, &
& "_i",INTERPOLATION_TYPE,"_s",SOLVER_TYPE,"/Example"
filename=trim(filename)

! With develop 10.2018: Directory should be created first, this call will cause an error:
CALL cmfe_Fields_NodesExport(Fields,filename,"FORTRAN",Err)
CALL cmfe_Fields_ElementsExport(Fields,filename,"FORTRAN",Err)
! Easy alternative:
!CALL cmfe_Fields_NodesExport(Fields,"laplace_equation","FORTRAN",Err)
!CALL cmfe_Fields_ElementsExport(Fields,"laplace_equation","FORTRAN",Err)

CALL cmfe_Fields_Finalise(Fields,Err)

!Finialise CMISS
Expand Down
4 changes: 3 additions & 1 deletion examples/example-0201-u/src/iron/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
add_executable(${ExampleName} ${ExampleName}.F90 ${IRON_MESH_READER_ROOT}/src/meshReader.F90)
#add_executable(${ExampleName} ${ExampleName}.F90 ${IRON_MESH_READER_ROOT}/src/meshReader.F90)
add_executable(${ExampleName} ${ExampleName}.F90 ~/software/opencmiss/dependencies/meshReader/src/meshReader.F90)

target_link_libraries(${ExampleName} opencmisslibs)

install(TARGETS ${ExampleName} DESTINATION ${PROJECT_SOURCE_DIR}/bin)

#configure_file(visualise.cmgui visualise.cmgui) #???
13 changes: 7 additions & 6 deletions examples/example-0201-u/src/iron/example.F90
Original file line number Diff line number Diff line change
Expand Up @@ -252,16 +252,16 @@ PROGRAM FORTRANEXAMPLE
WIDTH = 1.0_CMISSRP
HEIGHT = 0.2_CMISSRP
LENGTH = 0.2_CMISSRP
NumberGlobalXElements = 2
NumberGlobalYElements = 2
NumberGlobalZElements = 2
NumberGlobalXElements = 2!1
NumberGlobalYElements = 2!1
NumberGlobalZElements = 2!1
SolverIsDirect = 1 ! direct solver by default
JACOBIAN_FD = 1 ! finite-difference Jacobian by default
MooneyRivlin1 = 0.5_CMISSRP*35.7_CMISSRP ! see note above for Neo-Hookean solid
MooneyRivlin2 = 0.0_CMISSRP ! If MooneyRivlin2 == 0 --> Neo-Hookean solid
useGeneratedMesh = 1 ! generated mesh by default
BCDISP_MAX = 0.2_CMISSRP
bcDirichlet = 1 ! Dirichlet BC by default
bcDirichlet = 2 ! Dirichlet BC by default
ENDIF
IF(NumberGlobalZElements >= 1) THEN
NumberOfDimensions = 3
Expand Down Expand Up @@ -542,7 +542,8 @@ PROGRAM FORTRANEXAMPLE
CALL cmfe_Equations_Initialise(Equations,Err)
CALL cmfe_EquationsSet_EquationsCreateStart(EquationsSet,Equations,Err)
CALL cmfe_Equations_SparsityTypeSet(Equations,CMFE_EQUATIONS_SPARSE_MATRICES,Err)
CALL cmfe_Equations_OutputTypeSet(Equations,CMFE_EQUATIONS_NO_OUTPUT,Err)
! CALL cmfe_Equations_OutputTypeSet(Equations,CMFE_EQUATIONS_NO_OUTPUT,Err)
CALL cmfe_Equations_OutputTypeSet(equations,CMFE_EQUATIONS_MATRIX_OUTPUT,err)
CALL cmfe_EquationsSet_EquationsCreateFinish(EquationsSet,Err)

!Initialise dependent field from undeformed geometry and displacement bcs and set hydrostatic pressure
Expand Down Expand Up @@ -652,7 +653,7 @@ PROGRAM FORTRANEXAMPLE
! corresponding traction value
NeumannBCvalue = 2.0_CMISSRP * MooneyRivlin1 * (lambda - 1.0_CMISSRP / lambda / lambda) * HEIGHT * LENGTH
WRITE(*,*) " getting nodal weights"
! compute consistent nodal weights
! compute consistent nodal weights (mesh_reader function!)
CALL GeneratedMesh_SurfaceWeightsGet(nodalWeights,CMFE_GENERATED_MESH_REGULAR_RIGHT_SURFACE, &
& numberGlobalXelements,numberGlobalYelements,numberGlobalZelements,Err)
WRITE(*,*) " applying consistent nodal forces"
Expand Down
20 changes: 20 additions & 0 deletions examples/example-0201-u_mod/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
debug/
release/
doc/*.aux
*-eps-converted-to.pdf
*.log
*.out
*.diag
*~
results/results.summary
results/failed.tests
CMakeCache.txt
CMakeFiles/
Makefile
cmake_install.cmake
install_manifest.txt
src/iron/CMakeFiles
src/iron/Makefile
src/iron/cmake_install.cmake
src/iron/example
src/iron/*.mod
12 changes: 12 additions & 0 deletions examples/example-0201-u_mod/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(ExampleName "example")

cmake_minimum_required(VERSION 3.4 FATAL_ERROR)

project(${ExampleName} VERSION 1.0 LANGUAGES C Fortran)

list(APPEND CMAKE_PREFIX_PATH "${OPENCMISS_INSTALL_DIR}")

find_package(OpenCMISSLibs 1.3.0 REQUIRED COMPONENTS Iron CONFIG)

add_subdirectory(src/iron)

Loading