Skip to content

Commit d1903af

Browse files
Merge branch 'master' into add-testings
2 parents 986a7f9 + 12096d9 commit d1903af

681 files changed

Lines changed: 12979 additions & 16560 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
*.lnk
33

44
# Kratos execution folder
5-
kratos.gid/exec/*
6-
!kratos.gid/exec/README.md
5+
kratos.gid/exec/Kratos*
6+
# !kratos.gid/exec/README.md
7+
!kratos.gid/exec/MainKratos.py
78
*.orig
89
.vscode/
910

1011
custom_tools/*
12+
.DS_Store
13+
14+
*.zip
15+
*.tgz

README.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,45 @@
1-
# GiDInterface
1+
# KratosMultiphysics <-> GiD Interface
22

3-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/07a116949d2a437eb99b1423a18ecdb6)](https://app.codacy.com/app/jginternational/GiDInterface?utm_source=github.com&utm_medium=referral&utm_content=KratosMultiphysics/GiDInterface&utm_campaign=badger)
3+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/36d3d305c87e4bb398bc87ea2e3b890e)](https://www.codacy.com/gh/KratosMultiphysics/GiDInterface/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=KratosMultiphysics/GiDInterface&amp;utm_campaign=Badge_Grade)
44

5-
The interface of Kratos with [GiD](http://www.gidhome.com).
5+
The user interface of Kratos with [GiD](http://www.gidhome.com).
66

7-
If you need the latest release, launch your GiD, navigate to Data > Problemtype > Internet retrieve and download Kratos there. Available for Linux. Windows, and macOS. If you need the developer version, you are on the right place
7+
If you need the latest stable release, launch your GiD, navigate to Data > Problemtype > Internet retrieve and download Kratos there.
8+
Available for Linux. Windows, and macOS.
9+
10+
If you need the developer version, you are on the right place.
811

912
## First steps
10-
* Install the latest GiD developer version -> [Developer version](http://www.gidhome.com/download/developer-versions)
11-
* Navigate to GiD's problemtype folder and delete previous kratos.gid
12-
* Create there a link to our [kratos.gid](./kratos.gid/)
13-
* Navigate to kratos.gid/exec/
14-
* Create there a symbolic link to the kratos installation folder (where runkratos is located)
15-
* Unix : `ln -s ~/Kratos Kratos` or maybe `ln -s ~/Kratos/bin/Release Kratos` if that's the destination folder
16-
* Windows : `mklink /J Kratos C:\kratos` or maybe `mklink /J Kratos C:\kratos\bin\Release` (choose actual Kratos installation folder)
17-
18-
## Usage
13+
* 1- Clone this repository, or install a stable [release](https://github.com/KratosMultiphysics/GiDInterface/releases)
14+
* 2- Install the latest GiD developer version -> [Developer version](http://www.gidhome.com/download/developer-versions)
15+
* 3- Navigate to GiD's problemtype folder and delete any previous kratos.gid
16+
* Create there a link to our [kratos.gid](./kratos.gid/) downloaded in step 1
17+
* Windows: Simple shortcut to kratos.gid folder
18+
* 4- Choose your execution mode:
19+
* 4.1- To execute Kratos using the standard pip packages:
20+
* Python version recommended: 3.9
21+
* Open a terminal and run `python3 -m pip install --upgrade --force-reinstall --no-cache-dir KratosMultiphysics-all==9.1.3`
22+
* 4.2- To execute Kratos using your compiled binaries:
23+
* Navigate to kratos.gid/exec/
24+
* Create there a symbolic link to the kratos installation folder (where runkratos is located)
25+
* Unix : `ln -s ~/Kratos Kratos` or maybe `ln -s ~/Kratos/bin/Release Kratos` if that's the destination folder
26+
* Windows : `mklink /J Kratos C:\kratos\bin\Release` (choose actual Kratos installation folder)
27+
* Step by step video: https://www.youtube.com/watch?v=zZq7ypDdudo
28+
* 4.3- To execute Kratos using docker, just install docker
29+
30+
### Launch modes
31+
In Kratos preferences, select the execution mode:
32+
* Pip packages: Kratos will be installed via `pip install`
33+
* local compiled: If you are a developer and build your applications, use this one
34+
* docker: If you do not want to install any dependency, just run via docker!
35+
* The default image is [fjgarate/kratos-run](https://hub.docker.com/repository/docker/fjgarate/kratos-run)
36+
37+
### Usage
1938
* Run GiD
2039
* Go to: Data / Problem type / kratos
2140
* kratos top menu / Developer mode (recommended)
41+
42+
### Examples
2243
* [Fluid dynamics example](https://github.com/KratosMultiphysics/Kratos/wiki/Running-an-example-from-GiD#3-set-a-fluid-dynamics-problem)
2344
* [Structural mechanics example](https://github.com/KratosMultiphysics/Kratos/wiki/Running-an-example-from-GiD#4-set-a-structural-mechanics-problem)
2445
* [Fluid-Structure interaction example](https://github.com/KratosMultiphysics/Kratos/wiki/Running-an-example-from-GiD#5-set-a-fluid-structure-interaction-problem)

dockers/dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM python:3.9
2+
3+
RUN pip install KratosMultiphysics-all numpy
4+
WORKDIR "/model"
5+
RUN chmod 777 /model
6+
ENTRYPOINT [ "python3", "MainKratos.py" ]
7+
8+
# docker build --tag="kratos-run:latest" -t kratos-run .
9+
# docker tag kratos-run:latest fjgarate/kratos-run:latest
10+
# docker push fjgarate/kratos-run:0.0.1

kratos.gid/apps/Buoyancy/app.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"id": "Buoyancy",
3+
"name": "Buoyancy",
4+
"prefix": "Buoyancy_",
5+
"themed": false,
6+
"kratos_name": "Buoyancyapplication",
7+
"python_packages": [
8+
"KratosFluidDynamicsApplication",
9+
"KratosConvectionDiffusionApplication"
10+
],
11+
"dimensions": [
12+
"2D",
13+
"3D"
14+
],
15+
"script_files": [
16+
"start.tcl",
17+
"examples/examples.tcl",
18+
"examples/HeatedSquare.tcl",
19+
"xml/XmlController.tcl",
20+
"write/write.tcl",
21+
"write/writeProjectParameters.tcl"
22+
],
23+
"start_script": "::Buoyancy::Init",
24+
"requeriments": {
25+
"apps": [
26+
"Fluid",
27+
"ConvectionDiffusion"
28+
],
29+
"minimum_gid_version": "15.1.3d"
30+
},
31+
"permissions": {
32+
"open_tree": true,
33+
"show_toolbar": true,
34+
"intervals": true,
35+
"wizard": false
36+
},
37+
"write": {
38+
"coordinates": "all",
39+
"properties_location": "json",
40+
"model_part_name": "ThermalModelPart"
41+
},
42+
"main_launch_file": "../../exec/MainKratos.py",
43+
"examples": "examples/examples.xml"
44+
}

kratos.gid/apps/Buoyancy/examples/HeatedSquare.tcl

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
namespace eval ::Buoyancy::examples::HeatedSquare {
2+
namespace path ::Buoyancy::examples
3+
Kratos::AddNamespace [namespace current]
4+
}
15

2-
proc ::Buoyancy::examples::HeatedSquare {args} {
6+
proc ::Buoyancy::examples::HeatedSquare::Init {args} {
37
if {![Kratos::IsModelEmpty]} {
48
set txt "We are going to draw the example geometry.\nDo you want to lose your previous work?"
59
set retval [tk_messageBox -default ok -icon question -message $txt -type okcancel]
610
if { $retval == "cancel" } { return }
711
}
8-
DrawSquareGeometry$::Model::SpatialDimension
9-
AssignSquareGeometryMeshSizes$::Model::SpatialDimension
12+
DrawGeometry$::Model::SpatialDimension
13+
AssignMeshSizes$::Model::SpatialDimension
1014
AssignGroups$::Model::SpatialDimension
1115
TreeAssignation$::Model::SpatialDimension
1216

@@ -18,14 +22,14 @@ proc ::Buoyancy::examples::HeatedSquare {args} {
1822

1923

2024
# Draw Geometry
21-
proc Buoyancy::examples::DrawSquareGeometry3D {args} {
25+
proc ::Buoyancy::examples::HeatedSquare::DrawGeometry3D {args} {
2226
# DrawSquareGeometry2D
2327
# GiD_Process Mescape Utilities Copy Surfaces Duplicate DoExtrude Volumes MaintainLayers Translation FNoJoin 0.0,0.0,0.0 FNoJoin 0.0,0.0,1.0 1 escape escape escape
2428
# GiD_Layers edit opaque Fluid 0
2529

2630
# GiD_Process escape escape 'Render Flat escape 'Rotate Angle 270 90 escape escape escape escape 'Rotate objaxes x -150 y -30 escape escape
2731
}
28-
proc Buoyancy::examples::DrawSquareGeometry2D {args} {
32+
proc ::Buoyancy::examples::HeatedSquare::DrawGeometry2D {args} {
2933
Kratos::ResetModel
3034
GiD_Layers create Fluid
3135
GiD_Layers edit to_use Fluid
@@ -53,18 +57,18 @@ proc Buoyancy::examples::DrawSquareGeometry2D {args} {
5357
}
5458

5559
# Mesh sizes assign
56-
proc Buoyancy::examples::AssignSquareGeometryMeshSizes2D {args} {
60+
proc ::Buoyancy::examples::HeatedSquare::AssignMeshSizes2D {args} {
5761
set default_mesh_size 0.0125
5862
GiD_Process Mescape Meshing AssignSizes Surfaces $default_mesh_size 1 escape escape
5963
GiD_Process Mescape Meshing AssignSizes Lines $default_mesh_size 1 2 3 4 escape escape
6064
}
6165

62-
proc Buoyancy::examples::AssignSquareGeometryMeshSizes3D {args} {
66+
proc ::Buoyancy::examples::HeatedSquare::AssignMeshSizes3D {args} {
6367
# To be implemented
6468
}
6569

6670
# Group assign
67-
proc Buoyancy::examples::AssignGroups2D {args} {
71+
proc ::Buoyancy::examples::HeatedSquare::AssignGroups2D {args} {
6872
# Create the groups
6973
GiD_Groups create Fluid
7074
GiD_Groups edit color Fluid "#26d1a8ff"
@@ -91,7 +95,7 @@ proc Buoyancy::examples::AssignGroups2D {args} {
9195
GiD_EntitiesGroups assign Pressure point 1
9296

9397
}
94-
proc Buoyancy::examples::AssignGroups3D {args} {
98+
proc ::Buoyancy::examples::HeatedSquare::AssignGroups3D {args} {
9599
# Create the groups
96100
# GiD_Groups create Fluid
97101
# GiD_Groups edit color Fluid "#26d1a8ff"
@@ -115,11 +119,11 @@ proc Buoyancy::examples::AssignGroups3D {args} {
115119
}
116120

117121
# Tree assign
118-
proc Buoyancy::examples::TreeAssignation3D {args} {
122+
proc ::Buoyancy::examples::HeatedSquare::TreeAssignation3D {args} {
119123
# TreeAssignationCylinderInFlow2D
120124
# AddCuts
121125
}
122-
proc Buoyancy::examples::TreeAssignation2D {args} {
126+
proc ::Buoyancy::examples::HeatedSquare::TreeAssignation2D {args} {
123127
set nd $::Model::SpatialDimension
124128
set root [customlib::GetBaseRoot]
125129

@@ -189,18 +193,3 @@ proc Buoyancy::examples::TreeAssignation2D {args} {
189193

190194
spdAux::RequestRefresh
191195
}
192-
193-
proc Buoyancy::examples::ErasePreviousIntervals { } {
194-
set root [customlib::GetBaseRoot]
195-
set interval_base [spdAux::getRoute "Intervals"]
196-
foreach int [$root selectNodes "$interval_base/blockdata\[@n='Interval'\]"] {
197-
if {[$int @name] ni [list Initial Total Custom1]} {$int delete}
198-
}
199-
}
200-
201-
proc Buoyancy::examples::AddCuts { } {
202-
# Cuts
203-
set results "[spdAux::getRoute Results]/container\[@n='GiDOutput'\]"
204-
set cp [[customlib::GetBaseRoot] selectNodes "$results/container\[@n = 'CutPlanes'\]/blockdata\[@name = 'CutPlane'\]"]
205-
[$cp selectNodes "./value\[@n = 'point'\]"] setAttribute v "0.0,0.5,0.0"
206-
}
Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
namespace eval Buoyancy::examples {
2-
1+
namespace eval ::Buoyancy::examples {
2+
namespace path ::Buoyancy
3+
Kratos::AddNamespace [namespace current]
34
}
45

5-
proc Buoyancy::examples::Init { } {
6-
uplevel #0 [list source [file join $::Buoyancy::dir examples HeatedSquare.tcl]]
6+
proc ::Buoyancy::examples::ErasePreviousIntervals { } {
7+
set root [customlib::GetBaseRoot]
8+
set interval_base [spdAux::getRoute "Intervals"]
9+
foreach int [$root selectNodes "$interval_base/blockdata\[@n='Interval'\]"] {
10+
if {[$int @name] ni [list Initial Total Custom1]} {$int delete}
11+
}
712
}
813

9-
10-
Buoyancy::examples::Init
14+
proc ::Buoyancy::examples::AddCuts { } {
15+
# Cuts
16+
set results "[spdAux::getRoute Results]/container\[@n='GiDOutput'\]"
17+
set cp [[customlib::GetBaseRoot] selectNodes "$results/container\[@n = 'CutPlanes'\]/blockdata\[@name = 'CutPlane'\]"]
18+
[$cp selectNodes "./value\[@n = 'point'\]"] setAttribute v "0.0,0.5,0.0"
19+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Group id="Thermic" name="Thermic examples">
3-
<Example id="BuoyancyHeatedSquare2D" app="Buoyancy" logo="HeatedSquare2D.png" name="Buoyancy heated\nsquare 2D" dim="2D" cmd="::Buoyancy::examples::HeatedSquare"/>
3+
<Example id="BuoyancyHeatedSquare2D" app="Buoyancy" logo="HeatedSquare2D.png" name="Buoyancy heated\nsquare 2D" dim="2D" cmd="::Buoyancy::examples::HeatedSquare::Init">
4+
<Description></Description>
5+
</Example>
46
</Group>

kratos.gid/apps/Buoyancy/python/KratosFluid.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

kratos.gid/apps/Buoyancy/python/MainKratos.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)