Input Data

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
 
(33 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The current input data consist of five archives with followin extensions:
+
The current input data consist of one archive with <tt>.mdpa</tt> extension. The input file is free format and the reading is not depend to the spaces, tabs, endlines etc.
  
* <tt>.node</tt> for the nodal coordinates
+
This format contains all ModelPart's data in a minimalistic block form:
* <tt>.prop</tt> which containes the elemental properties
+
* <tt>.elem</tt> for elemental connectivities
+
* <tt>.cond</tt> containing conditions connectivities and node's fixed dofs
+
* <tt>.init</tt> for nodal initial values
+
  
All files are free format and the reading is not depend to the spaces, tabs, endlines etc.
+
Begin ModelPartData
 +
  //  VARIABLE_NAME value
 +
End ModelPartData
 +
 +
Begin Table table_id variable1 variable2
 +
  // table_x table_y
 +
End Table
 +
 
 +
Begin Properties  properties_id
 +
  //  VARIABLE_NAME value
 +
End Properties
 +
 
 +
Begin Nodes
 +
  // id   X Y Z
 +
End Nodes
 +
 
 +
Begin Elements element_name
 +
  // id prop_id n1 n2 n3 ...
 +
End Elements
 +
 
 +
Begin Conditions condition_name
 +
  // id prop_id n1 n2 n3 ...
 +
End Conditions
 +
 
 +
Begin NodalData VARIABLE_NAME
 +
  //  id is_fixed value              //data accessible by GetSolutionStepValue
 +
End NodalData
 +
 
 +
Begin ElementalData VARIABLE_NAME
 +
  //  id value                        //data accessible by GetValue
 +
End ElementalData
 +
 
 +
Begin ConditionalData VARIABLE_NAME
 +
  //  id value                        //data accessible by GetValue
 +
End ConditionalData
 +
 
 +
Begin Mesh mesh_id  // mesh_id cannot be zero!
 +
  Begin MeshData
 +
    //VARIABLE_NAME value                //data accessible by GetValue or operator []
 +
  End MeshData
 +
  Begin MeshNodes
 +
    // node_id
 +
  End MeshNodes
 +
 
 +
  Begin MeshElements
 +
    // element_id
 +
  End MeshElements
 +
 
 +
  Begin MeshConditions
 +
    // condition_id
 +
  End MeshConditions
 +
End Mesh
 +
 +
Begin SubModelPart SubModelPartName
 +
  Begin SubModelPartData
 +
    // VARIABLE_NAME value
 +
  End SubModelPartData
 +
  Begin SubModelPartTables
 +
    // Table_id
 +
  End SubModelPartTables
 +
 +
  Begin SubModelPartNodes
 +
    // node_id
 +
  End SubModelPartNodes
 +
 +
  Begin SubModelPartElements
 +
    // element_id
 +
  End SubModelPartElements
 +
 +
  Begin SubModelPartConditions
 +
    // condition_id
 +
  End SubModelPartConditions
 +
 +
  Begin SubModelPart SubModelPartName // Note that this would be a sub sub modelpart
 +
    Begin SubModelPartTables
 +
      // Table_id
 +
    End SubModelPartTables
 +
 
 +
    Begin SubModelPartNodes
 +
      // node_id
 +
    End SubModelPartNodes
 +
 +
    Begin SubModelPartElements
 +
      // element_id
 +
    End SubModelPartElements
 +
 +
    Begin SubModelPartConditions
 +
      // condition_id
 +
    End SubModelPartConditions
 +
  End SubModelPart
 +
End SubModelPart
 +
 +
Each block starts with a <tt>Begin</tt> statement following by the block name and ends with the <tt>End</tt> statement again following by the block name. Some block may have some additional parameter like id or variable in their definitions.
  
 +
=== ModelPartData Block ===
 +
== Example ==
  
== Nodal Coordinates File ==
+
Here is an example of mdpa file:
This file must have the <tt>.node</tt> extension with following format:
+
  
  NODES = NodesList([
+
  Begin ModelPartData
  [NodeId,   X,   Y,   Z],
+
  // VARIABLE_NAME value
[NodeId,   X,   Y,   Z],
+
  AMBIENT_TEMPERATURE 250.00
  ...
+
End ModelPartData
  ...
+
 
  ...
+
Begin Table 1 TEMPERATURE VISCOSITY
  [NodeId,  X,  Y,  Z],
+
  200. 2e-6
   ])
+
  300. 3e-6
 +
  400. 4e-6
 +
End Table
 +
 +
Begin Properties 1
 +
  DENSITY 3.4E-5  //scalar
 +
  THICKNESS 19.5
 +
  VOLUME_ACCELERATION [3] (0.00,0.00,9.8) //vector
 +
  LOCAL_INERTIA [3,3] ((0, 0.27,0.27),(0.087,0,0.27),(0.075,0.23,0)) // matrix
 +
   
 +
  Begin Table TEMPERATURE VISCOSITY
 +
    200. 2e-6
 +
    300. 3e-6
 +
    400. 4e-6
 +
  End Table
 +
   
 +
End Properties
 +
 +
Begin Nodes
 +
  1                  16                  0                  0
 +
  2                  16                0.4                  0
 +
  3                15.6                  0                  0
 +
  972                  0                7.2                  0
 +
  973                  0                7.6                  0
 +
  974                  0                  8                  0
 +
  End Nodes
 +
 +
Begin Elements Element2D3N
 +
  1 1        1        2        3
 +
  2 1        2        3        972
 +
  3 1        3        972      973
 +
  1796 1    972      973      974
 +
End Elements
 +
 
 +
Begin Conditions Condition2D
 +
  1    1        1          2
 +
  1800 1        2          3
 +
  1801 1        3          972
 +
  1947 1        972        973
 +
  1948 1        973        974
 +
End Conditions
 +
 +
 +
Begin NodalData DISPLACEMENT_X
 +
  1 1 0.100000
 +
  2 1 0.200000
 +
  973 1 0.000000
 +
  974 1 0.000000
 +
End NodalData
 +
 +
Begin NodalData DISPLACEMENT_Y
 +
   1 1 0.000000
 +
  2 1 0.000000
 +
  973 1 0.000973
 +
  974 1 0.000974
 +
End NodalData
 +
 +
Begin NodalData DISPLACEMENT_Z
 +
  1 1 0.000000
 +
  2 1 0.000000
 +
  973 1 0.000000
 +
  974 1 0.000000
 +
End NodalData
 +
 +
Begin NodalData VISCOSITY
 +
  1 0 0.010000
 +
  2 0 0.010000
 +
  973 0 0.010000
 +
  974 0 0.010000
 +
End NodalData
 +
 +
Begin SubModelPart Inlets
 +
  Begin SubModelPartTables
 +
    1
 +
  End SubModelPartTables
 +
 +
  Begin SubModelPartNodes
 +
    1
 +
    2
 +
  End SubModelPartNodes
 +
 +
  Begin SubModelPartElements
 +
    1
 +
  End SubModelPartElements
 +
 +
  Begin SubModelPartConditions
 +
    1
 +
    1800
 +
  End SubModelPartConditions
 +
 +
  Begin SubModelPart Inlet1
 +
    Begin SubModelPartNodes
 +
      1
 +
      3
 +
    End SubModelPartNodes
 +
 +
    Begin SubModelPartConditions
 +
      1
 +
      1800
 +
    End SubModelPartConditions
 +
 +
  End SubModelPart // Inlet1
 +
 +
  Begin SubModelPart Inlet2
 +
    Begin SubModelPartConditions
 +
      1800
 +
      1801
 +
    End SubModelPartConditions
 +
  End SubModelPart // Inlet2
 +
 +
End SubModelPart // Inlets
 +
 +
Begin SubModelPart Outlet
 +
  Begin SubModelPartProperties
 +
    1
 +
  End SubModelPartProperties
 +
 +
  Begin SubModelPartConditions
 +
    1948
 +
  End SubModelPartConditions
 +
 +
End SubModelPart // Outlet
  
for example:
+
The old format for data file is still supported due to the backward compatibility but without further improvement. The old format description can be found [[Old Input Data | here]]
  
NODES = NodesList([
 
[1,  0.05000,  0.00000,  0.00000],
 
[2,  0.05000,  0.01000,  0.00000],
 
...
 
...
 
...
 
[1000,  0.00000,  1.00000,  0.00000]
 
])
 
  
The <tt>NodeId</tt>s can be noconsequtive and also not in order, however the ordered input can improve the reading time.
 
  
 
+
[[Category:Kernel]]
== Properties File ==
+
This file must have the <tt>.prop</tt> extension with following format:
+
 
+
 
+
PROPERTIES[PropertiesId][ScalarVariableName] =  Value
+
PROPERTIES[PropertiesId][VectorialVariableName] =  [Value1, Value2, Value3]
+
PROPERTIES[PropertiesId][MatricialVariableName] =  [[Value11, Value12, Value13],
+
                                                    [Value21, Value22, Value23],
+
                                                    [Value31, Value32, Value33]]
+
 
+
For example:
+
PROPERTIES[1][END_TIME] =  0.1;
+
PROPERTIES[1][DELTA_TIME] = 0.001;
+
 
+
PROPERTIES[2][DENSITY] = 2700.000000;
+
PROPERTIES[2][YOUNG_MODULUS] = 7000000.000000;
+
PROPERTIES[2][GRAVITY] = [-39.5, 0.00, 0.00];
+
 
+
 
+
== Elemental Connectivities File ==
+
This file must have the <tt>.elem</tt> extension and defines the elements with following format:
+
 
+
ELEMENTS[ElementId] = ElementName([NodeId1,NodeId2, ..,NodeIdn],PropertiesId);
+
 
+
For example:
+
 
+
ELEMENTS[1] = TotalLagrangian2D3N([1,2,3],1);
+
ELEMENTS[2] = TotalLagrangian2D3N([2,6,4],1);
+
ELEMENTS[3] = TotalLagrangian2D3N([6,11,8],1);
+
ELEMENTS[4] = TotalLagrangian2D3N([11,18,17],2);
+
ELEMENTS[5] = TotalLagrangian2D3N([18,26,24],2);
+
ELEMENTS[6] = TotalLagrangian2D3N([26,36,33],2);
+
 
+
 
+
== Conditions File ==
+
This file must have the <tt>.cond</tt> extension and defines the fixed dofs in each node and boundary conditions. The fixed dofs can be define in following form:
+
 
+
NODES[NodeId].Fix(VariableName);
+
 
+
For example
+
NODES[27].Fix(DISPLACEMENT_X);
+
NODES[27].Fix(DISPLACEMENT_T);
+
NODES[29].Fix(PRESSURE);
+
 
+
The boundary conditions can be defined similar to the elements by their connectivity as follow:
+
 
+
CONDITIONS[ConditionId] = ConditionName([NodeId1,NodeId2, ..,NodeIdn],PropertiesId);
+
 
+
For example:
+
 
+
CONDITIONS[1176] = Face2D([684,678],1);
+
CONDITIONS[1175] = Face2D([693,684],1);
+
CONDITIONS[1176] = Face2D([684,678],1);
+

Latest revision as of 13:57, 23 September 2016

The current input data consist of one archive with .mdpa extension. The input file is free format and the reading is not depend to the spaces, tabs, endlines etc.

This format contains all ModelPart's data in a minimalistic block form:

Begin ModelPartData
  //  VARIABLE_NAME value
End ModelPartData

Begin Table table_id variable1 variable2 
  // table_x table_y
End Table
 
Begin Properties  properties_id 
  //  VARIABLE_NAME value
End Properties
 
Begin Nodes
  // id	  X	Y	Z
End Nodes
 
Begin Elements element_name
  // id prop_id	 n1	n2	n3	...
End Elements
 
Begin Conditions condition_name 
  // id prop_id	 n1	n2	n3	...
End Conditions
 
Begin NodalData VARIABLE_NAME
  //  id is_fixed value               //data accessible by GetSolutionStepValue
End NodalData
 
Begin ElementalData VARIABLE_NAME
  //  id value                        //data accessible by GetValue
End ElementalData
 
Begin ConditionalData VARIABLE_NAME
  //  id value                        //data accessible by GetValue
End ConditionalData 
 
Begin Mesh mesh_id   // mesh_id cannot be zero!
  Begin MeshData
    //VARIABLE_NAME value                 //data accessible by GetValue or operator []
  End MeshData
  Begin MeshNodes
    // node_id
  End MeshNodes
 
  Begin MeshElements
    // element_id
  End MeshElements
 
  Begin MeshConditions
    // condition_id
  End MeshConditions
End Mesh

Begin SubModelPart SubModelPartName
  Begin SubModelPartData
    // VARIABLE_NAME value 
  End SubModelPartData
  Begin SubModelPartTables
    // Table_id
  End SubModelPartTables

  Begin SubModelPartNodes
    // node_id
  End SubModelPartNodes

  Begin SubModelPartElements
    // element_id
  End SubModelPartElements

  Begin SubModelPartConditions
    // condition_id
  End SubModelPartConditions

  Begin SubModelPart SubModelPartName // Note that this would be a sub sub modelpart
    Begin SubModelPartTables
      // Table_id
    End SubModelPartTables
  
    Begin SubModelPartNodes
      // node_id
    End SubModelPartNodes

    Begin SubModelPartElements
      // element_id
    End SubModelPartElements

    Begin SubModelPartConditions
      // condition_id
    End SubModelPartConditions
  End SubModelPart
End SubModelPart

Each block starts with a Begin statement following by the block name and ends with the End statement again following by the block name. Some block may have some additional parameter like id or variable in their definitions.

ModelPartData Block

Example

Here is an example of mdpa file:

Begin ModelPartData
  //  VARIABLE_NAME value
  AMBIENT_TEMPERATURE 250.00
End ModelPartData
 
Begin Table 1 TEMPERATURE VISCOSITY
  200. 2e-6
  300. 3e-6
  400. 4e-6
End Table

Begin Properties 1
  DENSITY 3.4E-5  //scalar
  THICKNESS 19.5
  VOLUME_ACCELERATION [3] (0.00,0.00,9.8) //vector
  LOCAL_INERTIA [3,3] ((0, 0.27,0.27),(0.087,0,0.27),(0.075,0.23,0)) // matrix

  Begin Table TEMPERATURE VISCOSITY
    200. 2e-6
    300. 3e-6
    400. 4e-6
  End Table

End Properties

Begin Nodes
  1                  16                   0                   0
  2                  16                 0.4                   0
  3                15.6                   0                   0
  972                   0                 7.2                   0
  973                   0                 7.6                   0
  974                   0                   8                   0
End Nodes

Begin Elements Element2D3N
  1 1        1        2        3
  2 1        2        3        972
  3 1        3        972      973
  1796 1     972      973      974
End Elements
 
Begin Conditions Condition2D
  1    1        1          2
  1800 1        2          3
  1801 1        3          972
  1947 1        972        973
  1948 1        973        974
End Conditions


Begin NodalData DISPLACEMENT_X
  1 1 0.100000
  2 1 0.200000
  973 1 0.000000
  974 1 0.000000
End NodalData

Begin NodalData DISPLACEMENT_Y
  1 1 0.000000
  2 1 0.000000
  973 1 0.000973
  974 1 0.000974
End NodalData

Begin NodalData DISPLACEMENT_Z
  1 1 0.000000
  2 1 0.000000
  973 1 0.000000
  974 1 0.000000
End NodalData

Begin NodalData VISCOSITY
  1 0 0.010000
  2 0 0.010000
  973 0 0.010000
  974 0 0.010000
End NodalData

Begin SubModelPart Inlets
  Begin SubModelPartTables
    1
  End SubModelPartTables

  Begin SubModelPartNodes
    1
    2
  End SubModelPartNodes

  Begin SubModelPartElements
    1
  End SubModelPartElements

  Begin SubModelPartConditions
    1
    1800
  End SubModelPartConditions

  Begin SubModelPart Inlet1
    Begin SubModelPartNodes
      1
      3
    End SubModelPartNodes

    Begin SubModelPartConditions
      1
      1800
    End SubModelPartConditions

  End SubModelPart // Inlet1

  Begin SubModelPart Inlet2
    Begin SubModelPartConditions
      1800
      1801
    End SubModelPartConditions
  End SubModelPart // Inlet2

End SubModelPart // Inlets

Begin SubModelPart Outlet
  Begin SubModelPartProperties
    1
  End SubModelPartProperties

  Begin SubModelPartConditions
    1948
  End SubModelPartConditions

End SubModelPart // Outlet

The old format for data file is still supported due to the backward compatibility but without further improvement. The old format description can be found here

Personal tools
Categories