diff --git a/kratos.gid/apps/Chimera/app.json b/kratos.gid/apps/Chimera/app.json
new file mode 100644
index 000000000..65b4121ce
--- /dev/null
+++ b/kratos.gid/apps/Chimera/app.json
@@ -0,0 +1,51 @@
+{
+ "id": "Chimera",
+ "name": "Chimera",
+ "prefix": "Chim",
+ "themed": false,
+ "kratos_name": "FluidDynamicsApplication",
+ "python_packages": [
+ ""
+ ],
+ "dimensions": [
+ "2D"
+ ],
+ "script_files": [
+ "start.tcl",
+ "examples/examples.tcl",
+ "examples/ChimeraCross.tcl",
+ "xml/XmlController.tcl",
+ "write/write.tcl",
+ "write/writeProjectParameters.tcl"
+ ],
+ "start_script": "::Chimera::Init",
+ "requirements": {
+ "apps": ["Fluid"],
+ "minimum_gid_version": "15.1.3d"
+ },
+ "permissions": {
+ "open_tree": true,
+ "show_toolbar": true,
+ "intervals": true,
+ "wizard": false
+ },
+ "unique_names": {
+ "parts": "FLParts",
+ "nodal_conditions": "FLNodalConditions",
+ "conditions": "FLBC",
+ "materials": "FLMaterials",
+ "results": "FLResults",
+ "drag": "FLDrags",
+ "time_parameters": "FLTimeParameters"
+ },
+ "write": {
+ "coordinates": "all",
+ "materials_file": "FluidMaterials.json",
+ "properties_location": "json",
+ "model_part_name": "FluidModelPart",
+ "output_model_part_name": "fluid_computational_model_part"
+ },
+ "main_launch_file": "python/KratosChimera.py",
+ "examples": "examples/examples.xml",
+ "description": ""
+}
\ No newline at end of file
diff --git a/kratos.gid/apps/Chimera/examples/ChimeraCross.tcl b/kratos.gid/apps/Chimera/examples/ChimeraCross.tcl
new file mode 100644
index 000000000..54d9ee476
--- /dev/null
+++ b/kratos.gid/apps/Chimera/examples/ChimeraCross.tcl
@@ -0,0 +1,216 @@
+
+namespace eval ::Chimera::examples::ChimeraCross {
+ namespace path ::Chimera::examples
+ Kratos::AddNamespace [namespace current]
+}
+
+proc ::Chimera::examples::ChimeraCross::Init {args} {
+ if {![Kratos::IsModelEmpty]} {
+ set txt "We are going to draw the example geometry.\nDo you want to lose your previous work?"
+ set retval [tk_messageBox -default ok -icon question -message $txt -type okcancel]
+ if { $retval == "cancel" } { return }
+ }
+ Kratos::ResetModel
+
+ DrawGeometry
+ AssignGroups
+ AssignMeshSizes
+ TreeAssignation
+
+ GiD_Process 'Redraw
+ GidUtils::UpdateWindow GROUPS
+ GidUtils::UpdateWindow LAYER
+ GiD_Process 'Zoom Frame
+}
+
+proc ::Chimera::examples::ChimeraCross::DrawGeometry {args} {
+ # Background mesh geometry creation
+ GiD_Layers create Background
+ GiD_Layers edit to_use Background
+
+ ## Points ##
+ set back_coords [list 0.0 0.0 0.0 15.0 0.0 0.0 15.0 10.0 0.0 0.0 10.0 0.0]
+ set back_points [list ]
+ foreach {x y z} $back_coords {
+ lappend back_points [GiD_Geometry create point append Background $x $y $z]
+ }
+
+ ## Lines ##
+ set back_lines [list ]
+ set initial [lindex $back_points 0]
+ foreach point [lrange $back_points 1 end] {
+ lappend back_lines [GiD_Geometry create line append stline Background $initial $point]
+ set initial $point
+ }
+ lappend back_lines [GiD_Geometry create line append stline Background $initial [lindex $back_points 0]]
+
+ ## Surface ##
+ GiD_Process Mescape Geometry Create NurbsSurface {*}$back_lines escape escape
+
+ # Patch mesh geometry creation
+ GiD_Layers create Patch
+ GiD_Layers edit to_use Patch
+
+ ## Points ##
+ set patch_coords [list 3.849 2.7749 0.0 8.0104 2.7749 0.0 8.0104 6.8667 0.0 3.849 6.8667 0.0]
+ set patch_points [list ]
+ foreach {x y z} $patch_coords {
+ lappend patch_points [GiD_Geometry create point append Patch $x $y $z]
+ }
+
+ ## Lines ##
+ set patch_lines [list ]
+ set initial [lindex $patch_points 0]
+ foreach point [lrange $patch_points 1 end] {
+ lappend patch_lines [GiD_Geometry create line append stline Patch $initial $point]
+ set initial $point
+ }
+ lappend patch_lines [GiD_Geometry create line append stline Patch $initial [lindex $patch_points 0]]
+
+ # Cross mesh geometry creation
+ ## Points ##
+ set cross_coords [list 5.0737 4.7791 0.0 5.7557 4.7791 0.0 5.7557 4.2084 0.0 5.9366 4.2084 0.0 5.9366 4.7791 0.0 6.7995 4.7791 0.0 6.7995 4.96 0.0 5.9366 4.96 0.0 5.9366 5.461 0.0 5.7557 5.461 0.0 5.7557 4.96 0.0 5.0737 4.96 0.0]
+ set cross_points [list ]
+ foreach {x y z} $cross_coords {
+ lappend cross_points [GiD_Geometry create point append Patch $x $y $z]
+ }
+
+ ## Lines ##
+ set initial [lindex $cross_points 0]
+ foreach point [lrange $cross_points 1 end] {
+ lappend patch_lines [GiD_Geometry create line append stline Patch $initial $point]
+ set initial $point
+ }
+ lappend patch_lines [GiD_Geometry create line append stline Patch $initial [lindex $cross_points 0]]
+
+
+ ## Surface ##
+ GiD_Process Mescape Geometry Create NurbsSurface {*}$patch_lines escape escape
+}
+
+# Group assign
+proc ::Chimera::examples::ChimeraCross::AssignGroups {args} {
+ # Create the groups
+ GiD_Groups create Fluid
+ GiD_Groups edit color Fluid "#26d1a8ff"
+ GiD_EntitiesGroups assign Fluid surfaces {1 2}
+
+ GiD_Groups create Background
+ GiD_Groups edit color Background "#26d1a8ff"
+ GiD_EntitiesGroups assign Background surfaces 1
+
+ GiD_Groups create Patch
+ GiD_Groups edit color Patch "#26d1a8ff"
+ GiD_EntitiesGroups assign Patch surfaces 2
+
+ GiD_Groups create Inlet
+ GiD_Groups edit color Inlet "#e0210fff"
+ GiD_EntitiesGroups assign Inlet lines 4
+
+ GiD_Groups create Outlet
+ GiD_Groups edit color Outlet "#42eb71ff"
+ GiD_EntitiesGroups assign Outlet lines 2
+
+ GiD_Groups create No_Slip_Walls
+ GiD_Groups edit color No_Slip_Walls "#3b3b3bff"
+ GiD_EntitiesGroups assign No_Slip_Walls lines {1 3}
+
+ GiD_Groups create No_Slip_Cross
+ GiD_Groups edit color No_Slip_Cross "#3b3b3bff"
+ GiD_EntitiesGroups assign No_Slip_Cross lines {9 10 11 12 13 14 15 16 17 18 19 20}
+}
+
+# Mesh sizes
+proc ::Chimera::examples::ChimeraCross::AssignMeshSizes {args} {
+ set cross_mesh_size 0.05
+ set surface_mesh_size 0.2
+ GiD_Process Mescape Meshing AssignSizes Lines $cross_mesh_size {*}[GiD_EntitiesGroups get No_Slip_Cross lines] escape escape
+ GiD_Process Mescape Meshing AssignSizes Lines $surface_mesh_size 5 7 8 6 escape escape
+ GiD_Process Mescape Meshing AssignSizes Surfaces $surface_mesh_size [GiD_EntitiesGroups get Fluid surfaces] escape escape
+ Kratos::Event_BeforeMeshGeneration $surface_mesh_size
+}
+
+# Tree assign
+proc ::Chimera::examples::ChimeraCross::TreeAssignation {args} {
+ set nd $::Model::SpatialDimension
+ set root [customlib::GetBaseRoot]
+
+ set condtype line
+ if {$nd eq "3D"} { set condtype surface }
+
+ # Monolithic solution strategy set
+ spdAux::SetValueOnTreeItem v "Monolithic" FLSolStrat
+
+ # Fluid Parts
+ set fluidParts [spdAux::getRoute "FLParts"]
+ set fluidNode [customlib::AddConditionGroupOnXPath $fluidParts Fluid]
+ set props [list Element Monolithic$nd ConstitutiveLaw Newtonian DENSITY 1000.0 DYNAMIC_VISCOSITY 0.001]
+ foreach {prop val} $props {
+ set propnode [$fluidNode selectNodes "./value\[@n = '$prop'\]"]
+ if {$propnode ne "" } {
+ $propnode setAttribute v $val
+ } else {
+ W "Warning - Couldn't find property Fluid $prop"
+ }
+ }
+
+ # Chimera Patches
+ set chimeraPatches [spdAux::getRoute "ChimParts"]
+ set chimeraNode [customlib::AddConditionGroupOnXPath $chimeraPatches Patch]
+ set chimera_patch_props [list overlap_distance 0.7]
+ foreach {prop val} $chimera_patch_props {
+ set propnode [$chimeraNode selectNodes "./value\[@n = '$prop'\]"]
+ if {$propnode ne ""} {
+ $propnode setAttribute v $val
+ } else {
+ W "Warning - Couldn't find property Chimera patches $prop"
+ }
+ }
+
+ # Set conditions
+ set fluidConditions [spdAux::getRoute "FLBC"]
+ ErasePreviousIntervals
+
+ # Fluid Inlet
+ ::Fluid::xml::CreateNewInlet Inlet {new false name Total ini 0 end 1} true 1.0
+
+ # Fluid Outlet
+ set fluidOutlet "$fluidConditions/condition\[@n='Outlet$nd'\]"
+ set outletNode [customlib::AddConditionGroupOnXPath $fluidOutlet Outlet]
+ $outletNode setAttribute ov $condtype
+ set props [list value 0.0]
+ foreach {prop val} $props {
+ set propnode [$outletNode selectNodes "./value\[@n = '$prop'\]"]
+ if {$propnode ne "" } {
+ $propnode setAttribute v $val
+ } else {
+ W "Warning - Couldn't find property Outlet $prop"
+ }
+ }
+
+ # Fluid Conditions
+ [customlib::AddConditionGroupOnXPath "$fluidConditions/condition\[@n='NoSlip$nd'\]" No_Slip_Walls] setAttribute ov $condtype
+ [customlib::AddConditionGroupOnXPath "$fluidConditions/condition\[@n='NoSlip$nd'\]" No_Slip_Cross] setAttribute ov $condtype
+ [customlib::AddConditionGroupOnXPath "$fluidConditions/condition\[@n='ChimeraInternalBoundary$nd'\]" No_Slip_Cross] setAttribute ov $condtype
+
+ # Time parameters
+ set time_parameters [list EndTime 1.0 DeltaTime 0.01]
+ set time_params_path [spdAux::getRoute "FLTimeParameters"]
+ foreach {n v} $time_parameters {
+ [$root selectNodes "$time_params_path/value\[@n = '$n'\]"] setAttribute v $v
+ }
+ # Output
+ set time_parameters [list OutputControlType step OutputDeltaStep 1]
+ set xpath "[spdAux::getRoute FLResults]/container\[@n='GiDOutput'\]/container\[@n='GiDOptions'\]"
+ foreach {n v} $time_parameters {
+ [$root selectNodes "$xpath/value\[@n = '$n'\]"] setAttribute v $v
+ }
+ # Parallelism
+ set time_parameters [list ParallelSolutionType OpenMP OpenMPNumberOfThreads 4]
+ set time_params_path [spdAux::getRoute "Parallelization"]
+ foreach {n v} $time_parameters {
+ [$root selectNodes "$time_params_path/value\[@n = '$n'\]"] setAttribute v $v
+ }
+
+ spdAux::RequestRefresh
+}
diff --git a/kratos.gid/apps/Chimera/examples/examples.tcl b/kratos.gid/apps/Chimera/examples/examples.tcl
new file mode 100644
index 000000000..b44745c6c
--- /dev/null
+++ b/kratos.gid/apps/Chimera/examples/examples.tcl
@@ -0,0 +1,20 @@
+namespace eval ::Chimera::examples {
+ namespace path ::Chimera
+ Kratos::AddNamespace [namespace current]
+
+}
+
+proc ::Chimera::examples::ErasePreviousIntervals { } {
+ set root [customlib::GetBaseRoot]
+ set interval_base [spdAux::getRoute "Intervals"]
+ foreach int [$root selectNodes "$interval_base/blockdata\[@n='Interval'\]"] {
+ if {[$int @name] ni [list Initial Total Custom1]} {$int delete}
+ }
+}
+
+proc ::Chimera::examples::AddCuts { } {
+ # Cuts
+ set results "[spdAux::getRoute FLResults]/container\[@n='GiDOutput'\]"
+ set cp [[customlib::GetBaseRoot] selectNodes "$results/container\[@n = 'CutPlanes'\]/blockdata\[@name = 'CutPlane'\]"]
+ [$cp selectNodes "./value\[@n = 'point'\]"] setAttribute v "0.0,0.5,0.0"
+}
\ No newline at end of file
diff --git a/kratos.gid/apps/Chimera/examples/examples.xml b/kratos.gid/apps/Chimera/examples/examples.xml
new file mode 100644
index 000000000..c6ecf19f6
--- /dev/null
+++ b/kratos.gid/apps/Chimera/examples/examples.xml
@@ -0,0 +1,11 @@
+
+
+
+ This example applies an inlet condition to the air surrounding a 2D building.
+ The default mesh is made of 4.000 trianglular elements, and the calculation generates results for 800 timesteps.
+ - Size of model: 0.4 MB
+ - Time: Avg calulation time: 2 minutes
+ - Size with results: 250 MB
+
+
+
\ No newline at end of file
diff --git a/kratos.gid/apps/Chimera/images/logo.png b/kratos.gid/apps/Chimera/images/logo.png
new file mode 100644
index 000000000..ddfe57475
Binary files /dev/null and b/kratos.gid/apps/Chimera/images/logo.png differ
diff --git a/kratos.gid/apps/Chimera/python/KratosChimera.py b/kratos.gid/apps/Chimera/python/KratosChimera.py
new file mode 100644
index 000000000..19d84a8c7
--- /dev/null
+++ b/kratos.gid/apps/Chimera/python/KratosChimera.py
@@ -0,0 +1,32 @@
+from __future__ import print_function, absolute_import, division #makes KratosMultiphysics backward compatible with python 2.6 and 2.7
+
+import KratosMultiphysics
+from KratosMultiphysics.ChimeraApplication.fluid_chimera_analysis import FluidChimeraAnalysis
+
+import sys
+import time
+
+class FluidChimeraAnalysisWithFlush(FluidChimeraAnalysis):
+
+ def __init__(self,model,project_parameters,flush_frequency=10.0):
+ super(FluidChimeraAnalysisWithFlush,self).__init__(model,project_parameters)
+ self.flush_frequency = flush_frequency
+ self.last_flush = time.time()
+
+ def FinalizeSolutionStep(self):
+ super(FluidChimeraAnalysisWithFlush,self).FinalizeSolutionStep()
+
+ if self.parallel_type == "OpenMP":
+ now = time.time()
+ if now - self.last_flush > self.flush_frequency:
+ sys.stdout.flush()
+ self.last_flush = now
+
+if __name__ == "__main__":
+
+ with open("ProjectParameters.json",'r') as parameter_file:
+ parameters = KratosMultiphysics.Parameters(parameter_file.read())
+
+ model = KratosMultiphysics.Model()
+ simulation = FluidChimeraAnalysisWithFlush(model,parameters)
+ simulation.Run()
diff --git a/kratos.gid/apps/Chimera/start.tcl b/kratos.gid/apps/Chimera/start.tcl
new file mode 100644
index 000000000..4c3fc4b0f
--- /dev/null
+++ b/kratos.gid/apps/Chimera/start.tcl
@@ -0,0 +1,24 @@
+namespace eval ::Chimera {
+ Kratos::AddNamespace [namespace current]
+ # Variable declaration
+ variable dir
+ variable _app
+
+ proc GetAttribute {name} {variable _app; return [$_app getProperty $name]}
+ proc GetUniqueName {name} {variable _app; return [$_app getUniqueName $name]}
+ proc GetWriteProperty {name} {variable _app; return [$_app getWriteProperty $name]}
+}
+proc ::Chimera::Init { app } {
+
+ # Variable initialization
+ variable _app
+ variable dir
+
+ set _app $app
+ set dir [apps::getMyDir "Chimera"]
+
+ # XML init event
+ ::Chimera::xml::Init
+ ::Chimera::write::Init
+}
+
diff --git a/kratos.gid/apps/Chimera/write/write.tcl b/kratos.gid/apps/Chimera/write/write.tcl
new file mode 100644
index 000000000..537bc3225
--- /dev/null
+++ b/kratos.gid/apps/Chimera/write/write.tcl
@@ -0,0 +1,159 @@
+namespace eval Chimera::write {
+ variable writeAttributes
+
+ variable ConditionMap
+}
+
+proc Chimera::write::Init { } {
+ # Namespace variables inicialization
+ variable writeAttributes
+ set writeAttributes [Fluid::write::GetAttributes]
+
+ SetAttribute chim_parts_un ChimParts
+ SetAttribute writeCoordinatesByGroups 1
+ SetAttribute validApps [list "Fluid" "Chimera"]
+ SetAttribute main_launch_file [::Chimera::GetAttribute main_launch_file]
+}
+
+# Events
+proc Chimera::write::writeModelPartEvent { } {
+ # Write the background mesh as the fluid
+ Fluid::write::writeModelPartEvent
+ write::CloseFile
+
+
+ InitConditionsMap
+
+ # Write the patches as independent mdpa
+ Chimera::write::writePatches
+
+ # Clean
+ unset Chimera::write::ConditionMap
+}
+
+proc Chimera::write::writePatches { } {
+ set iter $Fluid::write::last_condition_iterator
+ set condid ChimeraInternalBoundary${Model::SpatialDimension}
+ set ConditionMap [objarray new intarray [expr [GiD_Info Mesh MaxNumElements] +1] 0]
+ foreach patch [Chimera::write::GetPatchParts] {
+ set group_id [get_domnode_attribute $patch n]
+ set patch_name [write::GetWriteGroupName $group_id]
+ # New file for each patch
+ write::OpenFile [write::transformGroupName ${patch_name}].mdpa
+ # Properties 0
+ ::Fluid::write::writeProperties
+ # Nodes
+ write::writeNodalCoordinatesOnGroups [list $group_id]
+ # Elements
+ write::writeGroupElementConnectivities $patch ChimeraPatch$Model::SpatialDimension
+ # Internal patch boundary Conditions
+ set internal_boundaries_list [Chimera::write::GetInternalBoundaries $patch_name]
+ foreach internal_boundary_group $internal_boundaries_list {
+ set iter [write::writeGroupNodeConditionByUniqueId $internal_boundary_group $condid $iter $Chimera::write::ConditionMap]
+ }
+ # Patch Submodelpart
+ ::write::writeGroupSubModelPartByUniqueId "Patch" $group_id "" "Elements"
+ # Internal patch boundary Submodelparts
+ foreach internal_boundary_group $internal_boundaries_list {
+ ::write::writeGroupSubModelPartByUniqueId $condid [$internal_boundary_group @n] $Chimera::write::ConditionMap "Conditions"
+ }
+ # End file
+ write::CloseFile
+ }
+}
+
+proc Chimera::write::GetPatchParts { {what "xml"} } {
+ set root [customlib::GetBaseRoot]
+ set xp "[spdAux::getRoute [GetAttribute chim_parts_un]]/group"
+ set xml_nodes [$root selectNodes $xp]
+ if {$what eq "xml"} {
+ return $xml_nodes
+ } else {
+ set names [list ]
+ foreach patch $nodes {
+ lappend names [get_domnode_attribute $patch name]
+ }
+ return $names
+ }
+}
+
+proc Chimera::write::GetInternalBoundaries { {patch_group_id ""} {what "xml"} } {
+ # Empty means all
+ set all 0
+ if {$patch_group_id eq ""} {
+ set all 1
+ }
+ set name ChimeraInternalBoundary${Model::SpatialDimension}
+ set un [GetAttribute conditions_un]
+ set xp "[spdAux::getRoute $un]/condition\[@n = '$name'\]/group"
+
+ set internal_boundaries_list [list ]
+ set root [customlib::GetBaseRoot]
+ foreach cnd_group [$root selectNodes $xp] {
+ set cnd_group_name [get_domnode_attribute $cnd_group n]
+
+ if {$what eq "xml"} {
+ set gr $cnd_group
+ } else {
+ set gr [write::GetWriteGroupName $cnd_group_name]
+ }
+
+ if {$all} {
+ lappend internal_boundaries_list $gr
+ } else {
+ set first_node [objarray get [GiD_EntitiesGroups get $cnd_group_name node] 0]
+ set affected_groups [GiD_EntitiesGroups entity_groups nodes $first_node]
+ if {$patch_group_id in $affected_groups} {
+ lappend internal_boundaries_list $gr
+ }
+ # set part_names [Fluid::write::GetFluidPartGroups]
+ # set patch_names [Chimera::write::GetPatchParts names]
+ # foreach group $affected_groups {
+ # if {$group ni $part_names} {
+ # if {$group ni $patch_names} {
+ # if
+ # }
+ # }
+ # }
+ }
+ }
+ return $internal_boundaries_list
+}
+
+proc Chimera::write::writeCustomFilesEvent { } {
+ # Write the fluid materials json file
+ Fluid::write::WriteMaterialsFile
+ write::SetConfigurationAttribute main_launch_file [GetAttribute main_launch_file]
+}
+
+proc Chimera::write::InitConditionsMap { {map "" } } {
+
+ variable ConditionMap
+ if {$map eq ""} {
+ set ConditionMap [objarray new intarray [expr [GiD_Info Mesh MaxNumElements] +1] 0]
+ } {
+ set ConditionMap $map
+ }
+}
+proc Chimera::write::FreeConditionsMap { } {
+
+ variable ConditionMap
+ unset ConditionMap
+}
+
+
+# Mandatory - Attribute handler
+proc Chimera::write::GetAttribute {att} {
+ variable writeAttributes
+ return [dict get $writeAttributes $att]
+}
+
+proc Chimera::write::GetAttributes {} {
+ variable writeAttributes
+ return $writeAttributes
+}
+
+proc Chimera::write::SetAttribute {att val} {
+ variable writeAttributes
+ dict set writeAttributes $att $val
+}
diff --git a/kratos.gid/apps/Chimera/write/writeProjectParameters.tcl b/kratos.gid/apps/Chimera/write/writeProjectParameters.tcl
new file mode 100644
index 000000000..8484c4f6f
--- /dev/null
+++ b/kratos.gid/apps/Chimera/write/writeProjectParameters.tcl
@@ -0,0 +1,70 @@
+# Project Parameters
+proc ::Chimera::write::getParametersDict { } {
+ set param_dict [Fluid::write::getParametersDict]
+
+ # Check https://github.com/KratosMultiphysics/Kratos/blob/ChimeraApplication-development_2.0/applications/ChimeraApplication/tests/flow_over_cross_monolithic/flow_over_cross_monolithic.json
+ # in branch ChimeraApplication-development_2.0
+
+ set bound_condid ChimeraInternalBoundary${Model::SpatialDimension}
+ set chimera_settings_dict [dict create ]
+
+ # General parameters
+ dict set chimera_settings_dict chimera_echo_level 1
+ dict set chimera_settings_dict reformulate_chimera_every_step true
+
+ # Chimera parts
+ #set chimera_parts_dict [dict create ]
+ set chimera_parts_list [GetBackgroundPatch]
+ foreach patch_xml [Chimera::write::GetPatchParts] {
+ set patch_name [write::GetWriteGroupName [$patch_xml @n]]
+ set patch_name_write [write::transformGroupName $patch_name]
+ set overlap_distance [write::getValueByXPath "[$patch_xml toXPath]/value\[@n = 'overlap_distance'\]"]
+ set patch_dict [dict create ]
+ dict set patch_dict model_part_name FluidModelPart.Patch_${patch_name_write}
+ dict set patch_dict overlap_distance $overlap_distance
+ dict set patch_dict model_import_settings input_type mdpa
+ dict set patch_dict model_import_settings input_filename ${patch_name_write}
+
+ # Internal boundaries
+ set internal_parts_for_chimera_list [list ]
+ foreach internal_boundary [Chimera::write::GetInternalBoundaries $patch_name name] {
+ set internal_boundary_write_name "${bound_condid}_[write::transformGroupName ${internal_boundary}]"
+ lappend internal_parts_for_chimera_list FluidModelPart.$internal_boundary_write_name
+ }
+ dict set patch_dict internal_parts_for_chimera $internal_parts_for_chimera_list
+
+ set patch_list [list]
+ lappend patch_list $patch_dict
+ lappend chimera_parts_list $patch_list
+ }
+ dict set chimera_settings_dict chimera_parts $chimera_parts_list
+
+ dict set param_dict solver_settings chimera_settings $chimera_settings_dict
+
+ dict set param_dict solver_settings model_import_settings input_type chimera
+ dict set param_dict solver_settings model_import_settings input_filename ""
+
+ return $param_dict
+}
+
+proc Chimera::write::GetBackgroundPatch { } {
+ set patch_dict [dict create ]
+ dict set patch_dict model_part_name FluidModelPart
+ # dict set patch_dict overlap_distance $overlap_distance
+ dict set patch_dict model_import_settings input_type mdpa
+ dict set patch_dict model_import_settings input_filename [file tail [GiD_Info Project ModelName]]
+
+ # Internal boundaries
+ dict set patch_dict internal_parts_for_chimera [list FluidModelPart]
+
+ set patch_list [list ]
+ lappend patch_list $patch_dict
+ lappend chimera_parts_list $patch_list
+ return $chimera_parts_list
+}
+
+proc Chimera::write::writeParametersEvent { } {
+ set projectParametersDict [getParametersDict]
+ write::SetParallelismConfiguration
+ write::WriteJSON $projectParametersDict
+}
diff --git a/kratos.gid/apps/Chimera/xml/ChimeraParts.spd b/kratos.gid/apps/Chimera/xml/ChimeraParts.spd
new file mode 100644
index 000000000..fd52fc59b
--- /dev/null
+++ b/kratos.gid/apps/Chimera/xml/ChimeraParts.spd
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/kratos.gid/apps/Chimera/xml/Conditions.xml b/kratos.gid/apps/Chimera/xml/Conditions.xml
new file mode 100644
index 000000000..0df3764ae
--- /dev/null
+++ b/kratos.gid/apps/Chimera/xml/Conditions.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kratos.gid/apps/Chimera/xml/Elements.xml b/kratos.gid/apps/Chimera/xml/Elements.xml
new file mode 100644
index 000000000..a26c4d5da
--- /dev/null
+++ b/kratos.gid/apps/Chimera/xml/Elements.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kratos.gid/apps/Chimera/xml/Main.spd b/kratos.gid/apps/Chimera/xml/Main.spd
new file mode 100644
index 000000000..91a8d025d
--- /dev/null
+++ b/kratos.gid/apps/Chimera/xml/Main.spd
@@ -0,0 +1,2 @@
+
+
diff --git a/kratos.gid/apps/Chimera/xml/Process.xml b/kratos.gid/apps/Chimera/xml/Process.xml
new file mode 100644
index 000000000..d899199bd
--- /dev/null
+++ b/kratos.gid/apps/Chimera/xml/Process.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kratos.gid/apps/Chimera/xml/Procs.spd b/kratos.gid/apps/Chimera/xml/Procs.spd
new file mode 100644
index 000000000..cf2089264
--- /dev/null
+++ b/kratos.gid/apps/Chimera/xml/Procs.spd
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+ 1} {
+ foreach group [lrange $childs 1 end] {$group delete}
+ gid_groups_conds::actualize_conditions_window
+ error "You can only set one part"
+ }
+ ]]>
+
+
+
+
+
\ No newline at end of file
diff --git a/kratos.gid/apps/Chimera/xml/XmlController.tcl b/kratos.gid/apps/Chimera/xml/XmlController.tcl
new file mode 100644
index 000000000..da75adbfa
--- /dev/null
+++ b/kratos.gid/apps/Chimera/xml/XmlController.tcl
@@ -0,0 +1,52 @@
+namespace eval Chimera::xml {
+ namespace path ::Chimera
+ Kratos::AddNamespace [namespace current]
+ # Namespace variables declaration
+ variable dir
+}
+
+proc Chimera::xml::Init { } {
+ # Namespace variables inicialization
+ Model::InitVariables dir $Chimera::dir
+
+ Model::getProcesses Process.xml
+ Model::getConditions Conditions.xml
+ Model::getElements Elements.xml
+ spdAux::processIncludes
+}
+
+proc Chimera::xml::getUniqueName {name} {
+ return [Fluid::xml::getUniqueName $name]
+}
+
+proc Chimera::xml::CustomTree { args } {
+ spdAux::processIncludes
+ Fluid::xml::CustomTree {*}$args
+
+ # Protection of submodelparts
+ [[customlib::GetBaseRoot] selectNodes "[spdAux::getRoute FLBC]/condition\[@n = 'ChimeraInternalBoundary2D'\]"] setAttribute print_smp 0
+ [[customlib::GetBaseRoot] selectNodes "[spdAux::getRoute FLBC]/condition\[@n = 'ChimeraInternalBoundary3D'\]"] setAttribute print_smp 0
+
+ # Change the app name
+ [[customlib::GetBaseRoot] selectNodes "container\[@n = 'Fluid'\]"] setAttribute pn "Chimera"
+
+ # Add ChimeraParts.spd
+ set xpath "container\[@n = 'Fluid'\]/condition\[@n='ChimeraParts'\]"
+ if {[[customlib::GetBaseRoot] selectNodes $xpath] eq ""} {
+ set chimera_parts [gid_groups_conds::addF "container\[@n = 'Fluid'\]" include [list n ChimeraParts active 1 path {apps/Chimera/xml/ChimeraParts.spd}]]
+
+ customlib::UpdateDocument
+ set parts [[customlib::GetBaseRoot] selectNodes [spdAux::getRoute FLParts]]
+ set new [$chimera_parts cloneNode]
+ set parent [[$parts nextSibling] parent]
+ $chimera_parts delete
+ $parent insertBefore $new [$parts nextSibling]
+ }
+
+ customlib::ProcessIncludes $::Kratos::kratos_private(Path)
+ spdAux::parseRoutes
+}
+
+proc Chimera::xml::UpdateParts {domNode args} {
+ Fluid::xml::UpdateParts $domNode {*}$args
+}
diff --git a/kratos.gid/apps/Examples/xml/examples.xml b/kratos.gid/apps/Examples/xml/examples.xml
index 10a812902..2ae29d605 100644
--- a/kratos.gid/apps/Examples/xml/examples.xml
+++ b/kratos.gid/apps/Examples/xml/examples.xml
@@ -24,6 +24,7 @@
+
diff --git a/kratos.gid/apps/Fluid/start.tcl b/kratos.gid/apps/Fluid/start.tcl
index 4816d4682..7285efaca 100644
--- a/kratos.gid/apps/Fluid/start.tcl
+++ b/kratos.gid/apps/Fluid/start.tcl
@@ -1,6 +1,6 @@
namespace eval ::Fluid {
Kratos::AddNamespace [namespace current]
-
+
# Variable declaration
variable _app
variable dir
@@ -17,7 +17,7 @@ proc ::Fluid::Init { app } {
set _app $app
set dir [apps::getMyDir "Fluid"]
-
+
# XML init event
::Fluid::xml::Init
::Fluid::write::Init
diff --git a/kratos.gid/apps/Fluid/write/write.tcl b/kratos.gid/apps/Fluid/write/write.tcl
index b6d4d8b44..7c80b4017 100644
--- a/kratos.gid/apps/Fluid/write/write.tcl
+++ b/kratos.gid/apps/Fluid/write/write.tcl
@@ -257,7 +257,10 @@ proc ::Fluid::write::writeConditionsMesh { } {
foreach group [$root selectNodes $xp1] {
set groupid [$group @n]
set groupid [write::GetWriteGroupName $groupid]
- set condid [[$group parent] @n]
+ set condnode [$group parent]
+ set condid [$condnode @n]
+ set print_smp [get_domnode_attribute $condnode print_smp 1]
+ if {[write::isBooleanFalse $print_smp]} {continue}
set cond [::Model::getCondition $condid]
if {[$cond getGroupBy] eq "Condition"} {
# Grouped conditions will be written later
@@ -285,7 +288,20 @@ proc ::Fluid::write::writeConditionsMesh { } {
}
}
+proc Fluid::write::GetFluidPartGroups { } {
+ set xp "[spdAux::getRoute [GetAttribute parts_un]]/group"
+ set root [customlib::GetBaseRoot]
+ set parts_name_list [list]
+ foreach group [$root selectNodes $xp] {
+ lappend parts_name_list [get_domnode_attribute $group n]
+ }
+ return $parts_name_list
+}
+
+proc Fluid::write::InitConditionsMap { {map "" } } {
# Overwrite this function to print something at the end of the mdpa
+
+}
proc ::Fluid::write::writeCustomBlocks { } {
}
diff --git a/kratos.gid/apps/Fluid/xml/XmlController.tcl b/kratos.gid/apps/Fluid/xml/XmlController.tcl
index 87e63d6dc..e59df2bba 100644
--- a/kratos.gid/apps/Fluid/xml/XmlController.tcl
+++ b/kratos.gid/apps/Fluid/xml/XmlController.tcl
@@ -1,6 +1,7 @@
namespace eval ::Fluid::xml {
namespace path ::Fluid
Kratos::AddNamespace [namespace current]
+
# Namespace variables declaration
variable dir
}
diff --git a/kratos.gid/kratos_default.spd b/kratos.gid/kratos_default.spd
index a421d1f61..007284cf8 100644
--- a/kratos.gid/kratos_default.spd
+++ b/kratos.gid/kratos_default.spd
@@ -32,6 +32,7 @@
+
diff --git a/kratos.gid/scripts/Writing/WriteConditionsByUniqueId.tcl b/kratos.gid/scripts/Writing/WriteConditionsByUniqueId.tcl
index 8e9a75d47..0cbddb6ea 100644
--- a/kratos.gid/scripts/Writing/WriteConditionsByUniqueId.tcl
+++ b/kratos.gid/scripts/Writing/WriteConditionsByUniqueId.tcl
@@ -130,7 +130,6 @@ proc write::writeGroupConditionByUniqueId {groupid kname nnodes iter ConditionMa
return $iter
}
-
proc write::writeConditionGroupedSubmodelPartsByUniqueId {cid groups_dict conditions_map} {
set s [mdpaIndent]
WriteString "${s}Begin SubModelPart $cid // Condition $cid"
@@ -222,4 +221,3 @@ proc write::writeGroupSubModelPartByUniqueId { cid group ConditionsMap {what "El
if {[GetConfigurationAttribute time_monitor]} {set endtime [clock seconds]; set ttime [expr {$endtime-$inittime}]; W "writeGroupSubModelPartByUniqueId $group time: [Kratos::Duration $ttime]"}
return $mid
}
-
diff --git a/kratos.gid/scripts/Writing/WriteSubModelPart.tcl b/kratos.gid/scripts/Writing/WriteSubModelPart.tcl
index 3e34301d6..5a6e9eb0c 100644
--- a/kratos.gid/scripts/Writing/WriteSubModelPart.tcl
+++ b/kratos.gid/scripts/Writing/WriteSubModelPart.tcl
@@ -205,7 +205,6 @@ proc write::getSubModelPartNames { args } {
return $listOfProcessedGroups
}
-
proc write::GetSubModelPartFromCondition { base_UN condition_id } {
set root [customlib::GetBaseRoot]
@@ -263,4 +262,4 @@ proc write::getSubModelPartId {cid group} {
return 0
}
}
-}
\ No newline at end of file
+}