Skip to content

Commit 91b4cbe

Browse files
Merge branch 'master' into feature/add-pfem-fluid-thermic
2 parents e2e4d3d + d8606ea commit 91b4cbe

734 files changed

Lines changed: 17631 additions & 18203 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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
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

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
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. 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 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)
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- Navigate to kratos.gid/exec/
19+
* Create there a symbolic link to the kratos installation folder (where runkratos is located)
20+
* Unix : `ln -s ~/Kratos Kratos` or maybe `ln -s ~/Kratos/bin/Release Kratos` if that's the destination folder
21+
* Windows : `mklink /J Kratos C:\kratos\bin\Release` (choose actual Kratos installation folder)
22+
23+
### Step by step video
24+
https://www.youtube.com/watch?v=zZq7ypDdudo
25+
26+
## Launch modea
27+
In Kratos preferences, select the execution mode:
28+
* Pip packages: Kratos will be installed via `pip install`
29+
* local compiled: If you are a developer and build your applications, use this one
1730

1831
## Usage
1932
* Run GiD
2033
* Go to: Data / Problem type / kratos
2134
* kratos top menu / Developer mode (recommended)
35+
36+
### Examples
2237
* [Fluid dynamics example](https://github.com/KratosMultiphysics/Kratos/wiki/Running-an-example-from-GiD#3-set-a-fluid-dynamics-problem)
2338
* [Structural mechanics example](https://github.com/KratosMultiphysics/Kratos/wiki/Running-an-example-from-GiD#4-set-a-structural-mechanics-problem)
2439
* [Fluid-Structure interaction example](https://github.com/KratosMultiphysics/Kratos/wiki/Running-an-example-from-GiD#5-set-a-fluid-structure-interaction-problem)

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: 17 additions & 28 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

26-
# GiD_Process escape escape 'Render Flat escape 'Rotate Angle 270 90 escape escape escape escape 'Rotate obj x -150 y -30 escape escape
30+
# 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

@@ -133,7 +137,7 @@ proc Buoyancy::examples::TreeAssignation2D {args} {
133137
# Fluid Parts
134138
set fluidParts [spdAux::getRoute "FLParts"]
135139
set fluidNode [customlib::AddConditionGroupOnXPath $fluidParts Fluid]
136-
set props [list Element Monolithic$nd ConstitutiveLaw Newtonian DENSITY 1.2039 DYNAMIC_VISCOSITY 0.000587 CONDUCTIVITY 0.83052 SPECIFIC_HEAT 1004.84]
140+
set props [list Element QSVMS$nd ConstitutiveLaw Newtonian2DLaw DENSITY 1.2039 DYNAMIC_VISCOSITY 0.000587 CONDUCTIVITY 0.83052 SPECIFIC_HEAT 1004.84]
137141
spdAux::SetValuesOnBaseNode $fluidNode $props
138142

139143
set fluidConditions [spdAux::getRoute "FLBC"]
@@ -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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
namespace eval Buoyancy::examples {
2-
3-
}
4-
5-
proc Buoyancy::examples::Init { } {
6-
uplevel #0 [list source [file join $::Buoyancy::dir examples HeatedSquare.tcl]]
1+
namespace eval ::Buoyancy::examples {
2+
namespace path ::Buoyancy
3+
Kratos::AddNamespace [namespace current]
74
}
85

9-
proc Buoyancy::examples::UpdateMenus { } {
10-
GiDMenu::InsertOption "Kratos" [list "---"] 8 PRE "" "" "" insertafter =
11-
GiDMenu::InsertOption "Kratos" [list "Heated square" ] 8 PRE [list ::Buoyancy::examples::HeatedSquare] "" "" insertafter =
12-
GiDMenu::UpdateMenus
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+
}
1312
}
1413

15-
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<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::Init">
4+
<Description></Description>
5+
</Example>
6+
</Group>
11.3 KB
Loading

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

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

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

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

0 commit comments

Comments
 (0)