(* Genenerated from: ../../irs/wg12n550.exp *)

SCHEMA structural_response_representation_schema;

  REFERENCE FROM fea_scalar_vector_tensor_schema
      (scalar,
       symmetric_tensor2_2d,
       symmetric_tensor2_3d,
       symmetric_tensor4_2d,
       symmetric_tensor4_3d);

  REFERENCE FROM finite_element_analysis_control_and_result_schema
      (curve_element_variable,
       measure_or_unspecified_value,
       surface_2d_edge,
       surface_2d_face,
       surface_3d_edge,
       surface_3d_face,
       surface_element_variable,
       volume_2d_edge,
       volume_2d_face,
       volume_3d_edge,
       volume_3d_face,
       volume_variable);

  REFERENCE FROM geometric_model_schema 
      (solid_model);

  REFERENCE FROM geometry_schema 
      (axis2_placement_2d,
       axis2_placement_3d,
       cartesian_point,
       cross_product,
       curve,
       cylindrical_point,
       degenerate_pcurve,
       direction,
       geometric_representation_context,
       geometric_representation_item,
       normalise,
       point,
       point_on_curve,
       point_on_surface,
       point_replica,
       spherical_point,
       surface);

  REFERENCE FROM group_schema 
      (group,
       group_relationship);

  REFERENCE FROM material_property_definition_schema 
      (material_property);

  REFERENCE FROM material_property_representation_schema 
      (material_property_representation);

  REFERENCE FROM measure_schema 
      (context_dependent_measure,
       length_measure,
       parameter_value,
       plane_angle_measure,
       thermodynamic_temperature_measure);

  REFERENCE FROM product_property_representation_schema 
      (property_definition_representation);

  REFERENCE FROM representation_schema 
      (representation,
       representation_item,
       representation_relationship,
       using_representations);

  REFERENCE FROM structural_response_definition_schema
      (element_definition,
       fea_model_definition,
       node_definition,
       structural_response_property);

  REFERENCE FROM support_resource_schema 
      (identifier,
       label,
       text);

TYPE axi_or_plane = ENUMERATION OF
  (axisymmetric,
   planar);
END_TYPE;

TYPE coordinate_system_type = ENUMERATION OF
     (cartesian,
      cylindrical,
      spherical);
END_TYPE;

TYPE element_order = ENUMERATION OF
     (linear,
      quadratic,
      cubic);
END_TYPE;

TYPE plane_2d_element_purpose = SELECT
     (enumerated_plane_2d_element_purpose,
      application_defined_element_purpose);
END_TYPE;

TYPE enumerated_plane_2d_element_purpose = ENUMERATION OF
     (plane_stress,
      plane_strain);
END_TYPE;

TYPE application_defined_element_purpose = STRING;
END_TYPE;

TYPE volume_element_purpose = SELECT
     (enumerated_volume_element_purpose,
      application_defined_element_purpose);
END_TYPE;

TYPE enumerated_volume_element_purpose = ENUMERATION OF
     (stress_displacement);
END_TYPE;

TYPE surface_element_purpose = SELECT
     (enumerated_surface_element_purpose,
      application_defined_element_purpose);
END_TYPE;

TYPE enumerated_surface_element_purpose = ENUMERATION OF
     (membrane_direct,
      membrane_shear,
      bending_direct,
      bending_torsion,
      normal_to_plane_shear);
END_TYPE;

TYPE curve_element_purpose = SELECT
     (enumerated_curve_element_purpose,
      application_defined_element_purpose);
END_TYPE;

TYPE enumerated_curve_element_purpose = ENUMERATION OF
     (axial,
      y_y_bending,
      z_z_bending,
      torsion,
      x_y_shear,
      x_z_shear,
      warping);
END_TYPE;

TYPE volume_3d_element_shape = ENUMERATION OF
     (hexahedron,
      wedge,
      tetrahedron,
      pyramid);
END_TYPE;

TYPE element_2d_shape = ENUMERATION OF
     (quadrilateral,
      triangle);
END_TYPE;

TYPE matrix_property_type = SELECT
  (enumerated_matrix_property_type,
   application_defined_matrix_property_type);
END_TYPE;

TYPE enumerated_matrix_property_type = ENUMERATION OF
     (stiffness,
      mass,
      damping);
END_TYPE;

TYPE application_defined_matrix_property_type = STRING;
END_TYPE;

TYPE surface_matrix_property_type = SELECT
  (enumerated_surface_matrix_property_type,
   application_defined_matrix_property_type);
END_TYPE;

TYPE enumerated_surface_matrix_property_type = ENUMERATION OF
     (membrane_direct,
      membrane_shear,
      bending_direct,
      bending_torsion,
      normal_to_plane_shear,
      membrane_direct_mass,
      membrane_shear_mass,
      bending_direct_mass,
      bending_torsion_mass,
      normal_to_plane_shear_mass,
      mass);
END_TYPE;

TYPE curve_matrix_property_type = SELECT
  (enumerated_curve_matrix_property_type,
   application_defined_matrix_property_type);
END_TYPE;

TYPE enumerated_curve_matrix_property_type = ENUMERATION OF
     (axial,
      y_y_bending,
      z_z_bending,
      torsion,
      x_y_shear,
      x_z_shear,
      warping,
      axial_mass,
      y_y_bending_mass,
      z_z_bending_mass,
      torsion_mass,
      x_y_shear_mass,
      x_z_shear_mass,
      warping_mass,
      mass);
END_TYPE;

TYPE matrix_symmetry = ENUMERATION OF
     (symmetric,
      diagonal);
END_TYPE;

TYPE degree_of_freedom = SELECT
  (enumerated_degree_of_freedom,
   application_defined_degree_of_freedom);
END_TYPE;

TYPE enumerated_degree_of_freedom = ENUMERATION OF
     (x_translation, y_translation, z_translation,
      x_rotation, y_rotation, z_rotation,
      warp);
END_TYPE;

TYPE application_defined_degree_of_freedom = STRING;
END_TYPE;

TYPE curve_element_freedom = SELECT
     (enumerated_curve_element_freedom,
      application_defined_degree_of_freedom);
END_TYPE;

TYPE enumerated_curve_element_freedom = ENUMERATION OF
     (x_translation, y_translation, z_translation,
      x_rotation, y_rotation, z_rotation,
      warp,
      none);
END_TYPE;

TYPE integration_rule = ENUMERATION OF
     (gaussian,
      simpson);
END_TYPE;

TYPE shape_function = ENUMERATION OF
     (lagrangian,
      serendipity,
      hermitian,
      unspecified);
END_TYPE;

TYPE volume_2d_element_representation = SELECT
  (axisymmetric_volume_2d_element_representation,
   plane_volume_2d_element_representation);
END_TYPE;

TYPE surface_2d_element_representation = SELECT
  (axisymmetric_surface_2d_element_representation,
   plane_surface_2d_element_representation);
END_TYPE;

TYPE curve_2d_element_representation = SELECT
  (axisymmetric_curve_2d_element_representation,
   plane_curve_2d_element_representation);
END_TYPE;

TYPE volume_2d_element_descriptor = SELECT
     (axisymmetric_volume_2d_element_descriptor,
      plane_volume_2d_element_descriptor);
END_TYPE;

TYPE surface_2d_element_descriptor = SELECT
     (axisymmetric_surface_2d_element_descriptor,
      plane_surface_2d_element_descriptor);
END_TYPE;

TYPE curve_2d_element_descriptor = SELECT
     (axisymmetric_curve_2d_element_descriptor,
      plane_curve_2d_element_descriptor);
END_TYPE;

TYPE volume_3d_element_coordinate_system = SELECT
  (arbitrary_volume_3d_element_coordinate_system,
   parametric_volume_3d_element_coordinate_system);
END_TYPE;

TYPE volume_2d_element_coordinate_system = SELECT
  (arbitrary_volume_2d_element_coordinate_system,
   parametric_volume_2d_element_coordinate_system);
END_TYPE;

TYPE surface_3d_element_coordinate_system = SELECT
  (aligned_surface_3d_element_coordinate_system,
   parametric_surface_3d_element_coordinate_system,
   constant_surface_3d_element_coordinate_system);
END_TYPE;

TYPE surface_2d_element_coordinate_system = SELECT
  (aligned_surface_2d_element_coordinate_system,
   parametric_surface_2d_element_coordinate_system);
END_TYPE;

TYPE curve_3d_element_coordinate_system = SELECT
  (aligned_curve_3d_element_coordinate_system,
   parametric_curve_3d_element_coordinate_system);
END_TYPE;

TYPE curve_element_end_coordinate_system = SELECT
     (fea_axis2_placement_3d,
      curve_3d_element_coordinate_system);
END_TYPE;

TYPE directionally_explicit_element_coordinate_system = SELECT
  (directionally_explicit_element_coordinate_system_arbitrary,
   directionally_explicit_element_coordinate_system_aligned);
END_TYPE;

TYPE element_aspect = SELECT
     (element_volume,
      volume_3d_face,
      volume_2d_face,
      volume_3d_edge,
      volume_2d_edge,
      surface_3d_face,
      surface_2d_face,
      surface_3d_edge,
      surface_2d_edge,
      curve_edge);
END_TYPE;

TYPE element_volume = ENUMERATION OF
     (volume);
END_TYPE;

TYPE curve_edge = ENUMERATION OF
     (element_edge);
END_TYPE;

TYPE node_or_node_group = SELECT
     (node_representation,
      node_group);
END_TYPE;

TYPE element_or_element_group = SELECT
     (element_representation,
      element_group);
END_TYPE;

ENTITY fea_model
  SUPERTYPE OF (ONEOF(fea_model_2d,
                      fea_model_3d))
  SUBTYPE OF (representation);
  creating_software         : text;
  intended_analysis_code    : SET [1:?] OF text;
--  description               : text; -- SEDS
  analysis_type             : text;
UNIQUE
  UR1:  SELF\representation.name;
END_ENTITY;

ENTITY fea_model_3d
  SUBTYPE OF (fea_model);
WHERE
  WR1: SELF\representation.context_of_items\
       geometric_representation_context.coordinate_space_dimension = 3;
END_ENTITY;

ENTITY fea_model_2d
  SUBTYPE OF (fea_model);
  type_of_2d_analysis       : axi_or_plane;
WHERE
  WR1: SELF\representation.context_of_items\
       geometric_representation_context.coordinate_space_dimension = 2;
END_ENTITY;

ENTITY structural_response_property_definition_representation
  SUBTYPE OF (property_definition_representation);
WHERE
  WR1: (('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
         'STRUCTURAL_RESPONSE_PROPERTY') IN TYPEOF 
         (SELF\property_definition_representation.definition));
  WR2: ((('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.FEA_MODEL'
        IN TYPEOF 
        (SELF\property_definition_representation.used_representation))
        AND
        ('STRUCTURAL_RESPONSE_DEFINITION_SCHEMA.FEA_MODEL_DEFINITION'
        IN TYPEOF 
        (SELF\property_definition_representation.definition.definition)))
       OR
      (('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.ELEMENT_REPRESENTATION'
        IN TYPEOF 
        (SELF\property_definition_representation.used_representation))
        AND
        ('STRUCTURAL_RESPONSE_DEFINITION_SCHEMA.ELEMENT_DEFINITION'
        IN TYPEOF 
        (SELF\property_definition_representation.definition.definition)))
       OR
      (('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.NODE_REPRESENTATION'
        IN TYPEOF 
        (SELF\property_definition_representation.used_representation))
        AND
        ('STRUCTURAL_RESPONSE_DEFINITION_SCHEMA.NODE_DEFINITION'
        IN TYPEOF 
        (SELF\property_definition_representation.definition.definition))));
END_ENTITY;

ENTITY fea_representation_item
  SUPERTYPE OF (ONEOF
               (arbitrary_volume_3d_element_coordinate_system,
                parametric_volume_3d_element_coordinate_system,
                arbitrary_volume_2d_element_coordinate_system,
                parametric_volume_2d_element_coordinate_system,
                aligned_surface_3d_element_coordinate_system,
                parametric_surface_3d_element_coordinate_system,
                constant_surface_3d_element_coordinate_system,
                aligned_surface_2d_element_coordinate_system,
                parametric_surface_2d_element_coordinate_system,
                aligned_curve_3d_element_coordinate_system,
                parametric_curve_3d_element_coordinate_system,
                parametric_curve_3d_element_coordinate_direction,
                curve_2d_element_coordinate_system,
                directionally_explicit_element_coordinate_system_arbitrary,
                directionally_explicit_element_coordinate_system_aligned))
  SUBTYPE OF (representation_item);
END_ENTITY;

ENTITY direction_node
  SUBTYPE OF (direction);
  node_1                    : node_representation;
  node_2                    : node_representation;
DERIVE
  SELF\direction.direction_ratios : LIST [2:3] OF REAL := 
                                    build_direction_node (node_1, node_2);
WHERE
  WR1: SIZEOF (QUERY(item <* node_1\representation.items |
              'GEOMETRY_SCHEMA.CARTESIAN_POINT' IN TYPEOF (item))) = 1;
  WR2: SIZEOF (QUERY(item <* node_2\representation.items |
              'GEOMETRY_SCHEMA.CARTESIAN_POINT' IN TYPEOF (item))) = 1;
  WR3: NOT ((direction_ratios[1] = 0.0) AND
            (direction_ratios[2] = 0.0) AND
            (direction_ratios[3] = 0.0));
END_ENTITY;

ENTITY fea_axis2_placement_2d
  SUBTYPE OF (axis2_placement_2d);
  system_type               : coordinate_system_type;
  description               : text;
END_ENTITY;

ENTITY fea_axis2_placement_3d
  SUBTYPE OF (axis2_placement_3d);
  system_type               : coordinate_system_type;
  description               : text;
END_ENTITY;

ENTITY node_set
  SUBTYPE OF (geometric_representation_item);
  nodes                     : SET [1:?] OF node_representation;
WHERE
  WR1: SIZEOF (QUERY (tmp <* nodes | 
               tmp\representation.context_of_items :<>:
               nodes[1]\representation.context_of_items)) = 0;
END_ENTITY;

ENTITY analysis_item_within_representation;
  name                      : label;
  description               : text;
  item                      : representation_item;
  rep                       : representation;
WHERE
  WR1: SIZEOF (QUERY (tmp <* using_representations(item) | 
                      tmp :=: rep)) = 1;
END_ENTITY;

ENTITY node_geometric_relationship;
  node_ref                  : node_or_node_group;
  item                      : analysis_item_within_representation;
WHERE
  WR1: 'GEOMETRY_SCHEMA.GEOMETRIC_REPRESENTATION_ITEM' IN TYPEOF(item.item);
END_ENTITY;

ENTITY element_geometric_relationship;
  element_ref               : element_or_element_group;
  item                      : analysis_item_within_representation;
  aspect                    : element_aspect;
WHERE
  WR1: 'GEOMETRY_SCHEMA.GEOMETRIC_REPRESENTATION_ITEM' IN TYPEOF(item.item);
  WR2: consistent_geometric_reference (aspect, item.item);
  WR3: consistent_element_or_group_reference (aspect, element_ref);
END_ENTITY;

ENTITY node_representation
  SUPERTYPE OF (ONEOF
                     (node,
                      dummy_node,
                      geometric_node))
  SUBTYPE OF (representation);
  model_ref                 : fea_model;
UNIQUE
  UR1: model_ref, SELF\representation.name;
END_ENTITY;

ENTITY node
  SUPERTYPE OF (node_with_vector ANDOR
                node_with_solution_coordinate_system)
  SUBTYPE OF (node_representation);
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
              'GEOMETRY_SCHEMA.POINT' 
              IN TYPEOF (item))) = 1;
END_ENTITY;

ENTITY node_with_vector
  SUBTYPE OF (node);
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
              'GEOMETRY_SCHEMA.DIRECTION' 
              IN TYPEOF (item))) = 1;
END_ENTITY;

ENTITY node_with_solution_coordinate_system
  SUBTYPE OF (node);
WHERE
  WR1: ( (SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'FEA_AXIS2_PLACEMENT_3D' 
              IN TYPEOF (item))) = 1)
          AND
          (SELF\representation.context_of_items\
       geometric_representation_context.coordinate_space_dimension = 3) )
     OR
       ( (SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'FEA_AXIS2_PLACEMENT_2D' 
              IN TYPEOF (item))) = 1)
          AND
          (SELF\representation.context_of_items\
       geometric_representation_context.coordinate_space_dimension = 2) );
END_ENTITY;

ENTITY dummy_node
  SUBTYPE OF (node_representation);
END_ENTITY;

ENTITY geometric_node
  SUBTYPE OF (node_representation);
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
              'GEOMETRY_SCHEMA.POINT' 
              IN TYPEOF (item))) = 1;
END_ENTITY;

ENTITY substructure_node_relationship
  SUBTYPE OF (representation_relationship);
WHERE
  WR1: 'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.NODE_REPRESENTATION' 
        IN TYPEOF (SELF\representation_relationship.rep_1);
  WR2: 'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.NODE_REPRESENTATION' 
        IN TYPEOF (SELF\representation_relationship.rep_2);
END_ENTITY;

ENTITY element_representation
  SUPERTYPE OF (ONEOF(volume_3d_element_representation,
                      axisymmetric_volume_2d_element_representation,
                      plane_volume_2d_element_representation,
                      surface_3d_element_representation,
                      axisymmetric_surface_2d_element_representation,
                      plane_surface_2d_element_representation,
                      curve_3d_element_representation,
                      axisymmetric_curve_2d_element_representation,
                      plane_curve_2d_element_representation,
                      point_element_representation,
                      directionally_explicit_element_representation,
                      explicit_element_representation,
                      substructure_element_representation))
  SUBTYPE OF (representation);
  node_list                 : LIST [1:?] OF node_representation;
WHERE
  WR1: SIZEOF (QUERY(item <* node_list |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'GEOMETRIC_NODE' 
              IN TYPEOF (item))) = 0;
 END_ENTITY;

ENTITY volume_3d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_3d;
  element_descriptor        : volume_3d_element_descriptor;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
               'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
               'PARAMETRIC_VOLUME_3D_ELEMENT_COORDINATE_SYSTEM'
               IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
               'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
               'ARBITRARY_VOLUME_3D_ELEMENT_COORDINATE_SYSTEM'
               IN TYPEOF (item))) = 1;
  WR2: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR3: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_3d_nodes (
        SELF\element_representation.node_list,
        element_descriptor.shape,
        element_descriptor\element_descriptor.topology_order);
END_ENTITY;

ENTITY axisymmetric_volume_2d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_2d;
  element_descriptor        : axisymmetric_volume_2d_element_descriptor;
  angle_property            : axisymmetric_2d_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: model_ref.type_of_2d_analysis = axisymmetric;
  WR2: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'PARAMETRIC_VOLUME_2D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'ARBITRARY_VOLUME_2D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) = 1;
  WR3: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR4: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_2d_nodes (
        SELF\element_representation.node_list,
        element_descriptor.shape,
        element_descriptor\element_descriptor.topology_order);
END_ENTITY;

ENTITY plane_volume_2d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_2d;
  element_descriptor        : plane_volume_2d_element_descriptor;
  depth_property            : plane_2d_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: model_ref.type_of_2d_analysis = planar;
  WR2: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'PARAMETRIC_VOLUME_2D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'ARBITRARY_VOLUME_2D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) = 1;
  WR3: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR4: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_2d_nodes (
        SELF\element_representation.node_list,
        element_descriptor.shape,
        element_descriptor\element_descriptor.topology_order);
END_ENTITY;

ENTITY surface_3d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_3d;
  element_descriptor        : surface_3d_element_descriptor;
  property                  : surface_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'PARAMETRIC_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'CONSTANT_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'ALIGNED_SURFACE_3D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) = 1;
  WR2: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_BENDING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_BENDING_COUPLING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_SHEAR_STIFFNESS'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR3: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_2d_nodes (
        SELF\element_representation.node_list,
        element_descriptor.shape,
        element_descriptor\element_descriptor.topology_order);
END_ENTITY;

ENTITY axisymmetric_surface_2d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_2d;
  element_descriptor        : axisymmetric_surface_2d_element_descriptor;
  property                  : surface_element_property;
  angle_property            : axisymmetric_2d_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: model_ref.type_of_2d_analysis = axisymmetric;
  WR2: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'PARAMETRIC_SURFACE_2D_ELEMENT_COORDINATE_SYSTEM'
               IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'ALIGNED_SURFACE_2D_ELEMENT_COORDINATE_SYSTEM' 
               IN TYPEOF (item))) = 1;
  WR3: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_BENDING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_BENDING_COUPLING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_SHEAR_STIFFNESS'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR4: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_1d_nodes (
        SELF\element_representation.node_list,
        element_descriptor\element_descriptor.topology_order);
END_ENTITY;

ENTITY plane_surface_2d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_2d;
  element_descriptor        : plane_surface_2d_element_descriptor;
  property                  : surface_element_property;
  depth_property            : plane_2d_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: model_ref.type_of_2d_analysis = planar;
  WR2: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'PARAMETRIC_SURFACE_2D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'ALIGNED_SURFACE_2D_ELEMENT_COORDINATE_SYSTEM' 
              IN TYPEOF (item))) = 1;
  WR3: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_BENDING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_BENDING_COUPLING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_SHEAR_STIFFNESS'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR4: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_1d_nodes (
        SELF\element_representation.node_list,
        element_descriptor\element_descriptor.topology_order);
END_ENTITY;

ENTITY curve_3d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_3d;
  element_descriptor        : curve_3d_element_descriptor;
  property                  : curve_3d_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'PARAMETRIC_CURVE_3D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) +
       SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'ALIGNED_CURVE_3D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) = 1;
  WR2: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR3: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_1d_nodes (
        SELF\element_representation.node_list,
        element_descriptor\element_descriptor.topology_order);
END_ENTITY;

ENTITY axisymmetric_curve_2d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_2d;
  element_descriptor        : axisymmetric_curve_2d_element_descriptor;
  property                  : curve_2d_element_property;
  angle_property            : axisymmetric_2d_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: model_ref.type_of_2d_analysis = axisymmetric;
  WR2: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'CURVE_2D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) = 1;
  WR3: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR4: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_0d_nodes (
        SELF\element_representation.node_list);
END_ENTITY;

ENTITY plane_curve_2d_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model_2d;
  element_descriptor        : plane_curve_2d_element_descriptor;
  property                  : curve_2d_element_property;
  depth_property            : plane_2d_element_property;
  material                  : element_material;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: model_ref.type_of_2d_analysis = planar;
  WR2: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'CURVE_2D_ELEMENT_COORDINATE_SYSTEM'
              IN TYPEOF (item))) = 1;
  WR3: SIZEOF (QUERY(item1 <* material.properties |
        (SIZEOF (QUERY (item2 <* 
        item1\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION'] * TYPEOF (item2)
                  ) = 1
        )) = 1
       ))) >= 1;
  WR4: 'REPRESENTATION_SCHEMA.PARAMETRIC_REPRESENTATION_CONTEXT'
        IN TYPEOF (SELF\representation.context_of_items); 
  FU1:  required_0d_nodes (
        SELF\element_representation.node_list);
END_ENTITY;

ENTITY element_descriptor
  SUPERTYPE OF (ONEOF (volume_3d_element_descriptor,
                       axisymmetric_volume_2d_element_descriptor,
                       plane_volume_2d_element_descriptor,
                       surface_3d_element_descriptor,
                       axisymmetric_surface_2d_element_descriptor,
                       plane_surface_2d_element_descriptor,
                       curve_3d_element_descriptor,
                       axisymmetric_curve_2d_element_descriptor,
                       plane_curve_2d_element_descriptor));
  topology_order            : element_order;
  description               : text;
END_ENTITY;

ENTITY volume_3d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF volume_element_purpose;
  shape                     : volume_3d_element_shape;
END_ENTITY;

ENTITY axisymmetric_volume_2d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              volume_element_purpose;
  shape                     : element_2d_shape;
END_ENTITY;

ENTITY plane_volume_2d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              volume_element_purpose;
  shape                     : element_2d_shape;
  assumption                : plane_2d_element_purpose;
END_ENTITY;

ENTITY volume_3d_element_basis;
  descriptor                : volume_3d_element_descriptor;
  variable                  : volume_variable;
  variable_order            : element_order;
  variable_shape_function   : shape_function;
  evaluation_points         : LIST [1:?] OF volume_element_location;
END_ENTITY;

ENTITY volume_2d_element_basis;
  descriptor                : volume_2d_element_descriptor;
  variable                  : volume_variable;
  variable_order            : element_order;
  variable_shape_function   : shape_function;
  evaluation_points         : LIST [1:?] OF volume_element_location;
END_ENTITY;

ENTITY surface_3d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              surface_element_purpose;
  shape                     : element_2d_shape;
END_ENTITY;

ENTITY axisymmetric_surface_2d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              surface_element_purpose;
END_ENTITY;

ENTITY plane_surface_2d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              surface_element_purpose;
  assumption                : plane_2d_element_purpose;
END_ENTITY;

ENTITY surface_3d_element_basis;
  descriptor                : surface_3d_element_descriptor;
  variable                  : surface_element_variable;
  variable_order            : element_order;
  variable_shape_function   : shape_function;
  evaluation_points         : LIST [1:?] OF surface_element_location;
END_ENTITY;

ENTITY surface_2d_element_basis;
  descriptor                : surface_2d_element_descriptor;
  variable                  : surface_element_variable;
  variable_order            : element_order;
  variable_shape_function   : shape_function;
  evaluation_points         : LIST [1:?] OF surface_element_location;
END_ENTITY;

ENTITY curve_3d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              curve_element_purpose;
END_ENTITY;

ENTITY axisymmetric_curve_2d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              curve_element_purpose;
END_ENTITY;

ENTITY plane_curve_2d_element_descriptor
  SUBTYPE OF (element_descriptor);
  purpose                   : SET [1:?] OF SET [1:?] OF 
                              curve_element_purpose;
  assumption                : plane_2d_element_purpose;
END_ENTITY;

ENTITY curve_3d_element_basis;
  descriptor                : curve_3d_element_descriptor;
  variable                  : curve_element_variable;
  variable_order            : element_order;
  variable_shape_function   : shape_function;
  evaluation_points         : LIST [1:?] OF curve_element_location;
END_ENTITY;

ENTITY curve_2d_element_basis;
  descriptor                : curve_2d_element_descriptor;
  variable                  : curve_element_variable;
END_ENTITY;

ENTITY point_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model;
--  description               : text; -- SEDS
  matrix_set                : SET [1:?] OF point_element_matrix;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
              'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'FEA_AXIS2_PLACEMENT_3D'
              IN TYPEOF (item))) = 1;
  FU1:  required_0d_nodes (
        SELF\element_representation.node_list);
END_ENTITY;

ENTITY point_element_matrix
  SUPERTYPE OF (ONEOF(stationary_mass,
                      grounded_spring,
                      grounded_damper));
END_ENTITY;

ENTITY stationary_mass
  SUBTYPE OF (point_element_matrix);
  mass                      : ARRAY [1:3] OF context_dependent_measure;
  moments_of_inertia        : symmetric_tensor2_3d;
  coordinate_system         : fea_axis2_placement_3d;
  offset_vector             : ARRAY [1:3] OF context_dependent_measure;
END_ENTITY;

ENTITY grounded_spring
  SUBTYPE OF (point_element_matrix);
  stiffness_coefficients    : ARRAY [1:6] OF context_dependent_measure;
END_ENTITY;

ENTITY grounded_damper
  SUBTYPE OF (point_element_matrix);
  damping_coefficients      : ARRAY [1:6] OF context_dependent_measure;
END_ENTITY;

ENTITY directionally_explicit_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model;
  systems_and_freedoms      : LIST [2:2] OF system_and_freedom;
--  description               : text; -- SEDS
  coefficient               : directionally_explicit_element_coefficient;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  FU1:  required_1d_nodes (
        SELF\element_representation.node_list,
        linear);
END_ENTITY;

ENTITY system_and_freedom;
  matrix_coordinate_system  : 
                     directionally_explicit_element_coordinate_system;
  freedom                   : degree_of_freedom;
END_ENTITY;

ENTITY directionally_explicit_element_coefficient;
  property_type             : matrix_property_type;
  coefficient               : context_dependent_measure;
END_ENTITY;

ENTITY explicit_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model;
--  description               : text; -- SEDS
  matrix                    : explicit_element_matrix;
UNIQUE
  UR1: model_ref, SELF\representation.name;
WHERE
  WR1: SIZEOF (QUERY(item <* SELF\representation.items |
              ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' +
              'FEA_AXIS2_PLACEMENT_3D') 
              IN TYPEOF (item))) = 1;
  WR2:  SIZEOF (matrix.node_dof_list) = 
        SIZEOF (SELF\element_representation.node_list);
END_ENTITY;

ENTITY explicit_element_matrix;
  property_type             : matrix_property_type;
  symmetry                  : matrix_symmetry;
  node_dof_list             : LIST [1:?] OF LIST [1:?] OF degree_of_freedom;
  matrix_values             : LIST [1:?] OF context_dependent_measure;
WHERE
  WR1: SIZEOF (matrix_values) = number_of_terms (node_dof_list, symmetry);
END_ENTITY;

ENTITY substructure_element_representation
  SUBTYPE OF (element_representation);
  model_ref                 : fea_model;
  substructure_model_ref    : fea_model;
UNIQUE
  UR1: model_ref, SELF\representation.name;
END_ENTITY;

ENTITY aligned_axis_tolerance;
  model_ref                 : fea_model;
  tolerance                 : context_dependent_measure;
END_ENTITY;

ENTITY arbitrary_volume_3d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  coordinate_system         : fea_axis2_placement_3d;
END_ENTITY;

ENTITY parametric_volume_3d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  axis_1                    : INTEGER;
  axis_2                    : INTEGER;
  eu_angles                 : euler_angles;
WHERE
  WR1:  (axis_1 >= 1) AND (axis_1 <= 3) AND
        (axis_2 >= 1) AND (axis_2 <= 3) AND
        NOT (axis_1 = axis_2);
END_ENTITY;

ENTITY arbitrary_volume_2d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  orientation               : direction;
WHERE
  WR1: SELF\geometric_representation_item.dim=2;
END_ENTITY;

ENTITY parametric_volume_2d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  axis                      : INTEGER;
  angle                     : plane_angle_measure;
WHERE
  WR1:  (axis >= 1) AND (axis <= 2);
END_ENTITY;

ENTITY aligned_surface_3d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  coordinate_system         : fea_axis2_placement_3d;
END_ENTITY;

ENTITY parametric_surface_3d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  axis                      : INTEGER;
  angle                     : plane_angle_measure;
WHERE
  WR1:  (axis >= 1) AND (axis <= 2);
END_ENTITY;

ENTITY constant_surface_3d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  axis                      : INTEGER;
  angle                     : plane_angle_measure;
WHERE
  WR1:  (axis >= 1) AND (axis <= 2);
END_ENTITY;

ENTITY aligned_surface_2d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  orientation               : direction;
WHERE
  WR1: SELF\geometric_representation_item.dim=2;
END_ENTITY;

ENTITY parametric_surface_2d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
END_ENTITY;

ENTITY aligned_curve_3d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  coordinate_system         : fea_axis2_placement_3d;
END_ENTITY;

ENTITY parametric_curve_3d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  direction            :  parametric_curve_3d_element_coordinate_direction;
END_ENTITY;

ENTITY parametric_curve_3d_element_coordinate_direction
  SUBTYPE OF (fea_representation_item);
  orientation               : direction;
WHERE
  WR1: SELF\geometric_representation_item.dim=3;
END_ENTITY;

ENTITY curve_2d_element_coordinate_system
  SUBTYPE OF (fea_representation_item);
  orientation               : direction;
WHERE
  WR1: SELF\geometric_representation_item.dim=2;
END_ENTITY;

ENTITY directionally_explicit_element_coordinate_system_arbitrary
  SUBTYPE OF (fea_representation_item);
  arbitrary_system          : fea_axis2_placement_3d;
END_ENTITY;

ENTITY directionally_explicit_element_coordinate_system_aligned
  SUBTYPE OF (fea_representation_item);
  aligned_system            : curve_3d_element_coordinate_system;
END_ENTITY;

ENTITY euler_angles;
  angles                    : ARRAY [1:3] OF plane_angle_measure;
END_ENTITY;

ENTITY volume_3d_element_integrated_matrix;
  descriptor                : volume_3d_element_descriptor;
  property_type             : matrix_property_type;
  integration_description   : text;
END_ENTITY;

ENTITY volume_3d_element_integrated_matrix_with_definition
  SUBTYPE OF (volume_3d_element_integrated_matrix);
  integration_definition    : volume_3d_element_field_integration;
END_ENTITY;

TYPE volume_3d_element_field_integration = SELECT
  (element_integration_algebraic,
   volume_3d_element_field_integration_rule,
   volume_3d_element_field_integration_explicit);
END_TYPE;

TYPE element_integration_algebraic = ENUMERATION OF (algebraic);
END_TYPE;

ENTITY volume_3d_element_field_integration_rule;
  integration_method        : integration_rule;
  integration_order         : ARRAY [1:3] OF INTEGER;
END_ENTITY;

ENTITY volume_3d_element_field_integration_explicit;
  integration_positions_and_weights: SET [1:?] OF volume_position_weight;
END_ENTITY;

ENTITY volume_position_weight;
  integration_position      : volume_element_location;
  integration_weight        : context_dependent_measure;
END_ENTITY;

ENTITY volume_2d_element_integrated_matrix;
  descriptor                : volume_2d_element_descriptor;
  property_type             : matrix_property_type;
  integration_description   : text;
END_ENTITY;

ENTITY volume_2d_element_integrated_matrix_with_definition
  SUBTYPE OF (volume_2d_element_integrated_matrix);
  integration_definition    : volume_2d_element_field_integration;
END_ENTITY;

TYPE volume_2d_element_field_integration = SELECT
  (element_integration_algebraic,
   volume_2d_element_field_integration_rule,
   volume_2d_element_field_integration_explicit);
END_TYPE;

ENTITY volume_2d_element_field_integration_rule;
  integration_method        : integration_rule;
  integration_order         : ARRAY [1:2] OF INTEGER;
END_ENTITY;

ENTITY volume_2d_element_field_integration_explicit;
  integration_positions_and_weights: SET [1:?] OF volume_position_weight;
END_ENTITY;

ENTITY surface_3d_element_integrated_matrix;
  descriptor                : surface_3d_element_descriptor;
  property_type             : surface_matrix_property_type;
  integration_description   : text;
END_ENTITY;

ENTITY surface_3d_element_integrated_matrix_with_definition
  SUBTYPE OF (surface_3d_element_integrated_matrix);
  integration_definition    : surface_3d_element_integration;
END_ENTITY;

ENTITY surface_3d_element_integration;
  field                     : surface_3d_element_field_integration;
  section                   : surface_section_integration;
END_ENTITY;

TYPE surface_3d_element_field_integration = SELECT
  (element_integration_algebraic,
   surface_3d_element_field_integration_rule,
   surface_3d_element_field_integration_explicit);
END_TYPE;

TYPE surface_section_integration = SELECT
  (element_integration_algebraic,
   surface_section_integration_rule,
   surface_section_integration_explicit);
END_TYPE;

ENTITY surface_3d_element_field_integration_rule;
  integration_method        : integration_rule;
  integration_order         : ARRAY [1:2] OF INTEGER;
END_ENTITY;

ENTITY surface_3d_element_field_integration_explicit;
  integration_positions_and_weights: SET [1:?] OF surface_position_weight;
END_ENTITY;

ENTITY surface_position_weight;
  integration_position      : surface_element_location;
  integration_weight        : context_dependent_measure;
END_ENTITY;

ENTITY surface_section_integration_rule;
  integration_method        : integration_rule;
  integration_order         : INTEGER;
END_ENTITY;

ENTITY surface_section_integration_explicit;
  integration_positions_and_weights : SET [1:?] OF 
                                      surface_section_position_weight;
END_ENTITY;

ENTITY surface_section_position_weight;
  integration_position      : surface_section_element_location;
  integration_weight        : context_dependent_measure;
END_ENTITY;

ENTITY surface_2d_element_integrated_matrix;
  descriptor                : surface_2d_element_descriptor;
  property_type             : surface_matrix_property_type;
  integration_description   : text;
END_ENTITY;

ENTITY surface_2d_element_integrated_matrix_with_definition
  SUBTYPE OF (surface_2d_element_integrated_matrix);
  integration_definition    : surface_2d_element_integration;
END_ENTITY;

ENTITY surface_2d_element_integration;
  element_length            : surface_2d_element_length_integration;
  section                   : surface_section_integration;
END_ENTITY;

TYPE surface_2d_element_length_integration = SELECT
  (element_integration_algebraic,
   surface_2d_element_length_integration_rule,
   surface_2d_element_length_integration_explicit);
END_TYPE;

ENTITY surface_2d_element_length_integration_rule;
  integration_method        : integration_rule;
  integration_order         : INTEGER;
END_ENTITY;

ENTITY surface_2d_element_length_integration_explicit;
  integration_positions_and_weights: SET [1:?] OF surface_position_weight;
END_ENTITY;

ENTITY curve_3d_element_integrated_matrix;
  descriptor                : curve_3d_element_descriptor;
  property_type             : curve_matrix_property_type;
  integration_description   : text;
END_ENTITY;

ENTITY curve_3d_element_integrated_matrix_with_definition
  SUBTYPE OF (curve_3d_element_integrated_matrix);
  integration_definition    : curve_3d_element_integration;
END_ENTITY;

ENTITY curve_3d_element_integration;
  element_length            : curve_3d_element_length_integration;
  section                   : curve_section_integration_explicit;
END_ENTITY;

TYPE curve_3d_element_length_integration = SELECT
  (element_integration_algebraic,
   curve_3d_element_length_integration_rule,
   curve_3d_element_length_integration_explicit);
END_TYPE;

ENTITY curve_3d_element_length_integration_rule;
  integration_method        : integration_rule;
  integration_order         : INTEGER;
END_ENTITY;

ENTITY curve_3d_element_length_integration_explicit;
  integration_positions_and_weights: SET [1:?] OF 
                                     curve_3d_element_position_weight;
END_ENTITY;

ENTITY curve_3d_element_position_weight;
  integration_position      : curve_volume_element_location;
  integration_weight        : context_dependent_measure;
END_ENTITY;

ENTITY curve_section_integration_explicit;
  integration_positions     : SET [1:?] OF curve_section_element_location;
END_ENTITY;

ENTITY curve_2d_element_integrated_matrix;
  descriptor                : curve_2d_element_descriptor;
  property_type             : curve_matrix_property_type;
  integration_description   : text;
END_ENTITY;

ENTITY curve_2d_element_integrated_matrix_with_definition
  SUBTYPE OF (curve_2d_element_integrated_matrix);
  integration_definition    : curve_2d_element_integration;
END_ENTITY;

ENTITY curve_2d_element_integration;
  section                   : LIST [1:?] OF curve_section_element_location;
END_ENTITY;

ENTITY fea_parametric_point
  SUBTYPE OF (point);
  coordinates               : LIST [1:3] OF parameter_value;
WHERE
  WR1: valid_parametric_coordinate (coordinates);
  WR2:  SIZEOF (TYPEOF (SELF) *
         ['GEOMETRY_SCHEMA.CARTESIAN_POINT',
          'GEOMETRY_SCHEMA.POINT_ON_CURVE',
          'GEOMETRY_SCHEMA.POINT_ON_SURFACE',
          'GEOMETRY_SCHEMA.DEGENERATE_PCURVE',
          'GEOMETRY_SCHEMA.POINT_REPLICA',
          'GEOMETRY_SCHEMA.SPHERICAL_POINT',
          'GEOMETRY_SCHEMA.CYLINDRICAL_POINT'])
         = 0;
END_ENTITY;

ENTITY volume_element_location;
  coordinates               : fea_parametric_point;
END_ENTITY;

ENTITY surface_volume_element_location;
  field_location            : surface_element_location;
  section_location          : surface_section_element_location;
END_ENTITY;

ENTITY surface_element_location;
  coordinates               : fea_parametric_point;
END_ENTITY;

ENTITY surface_section_element_location
  SUPERTYPE OF (ONEOF (surface_section_element_location_absolute,
                       surface_section_element_location_dimensionless));
  above_material_discontinuity : LOGICAL;
END_ENTITY;

ENTITY surface_section_element_location_absolute
  SUBTYPE OF (surface_section_element_location);
  offset                    : context_dependent_measure;
END_ENTITY;

ENTITY surface_section_element_location_dimensionless
  SUBTYPE OF (surface_section_element_location);
  coordinate                : LIST [1:1] OF parameter_value;
WHERE
  WR1: valid_parametric_coordinate (coordinate);
END_ENTITY;

ENTITY curve_volume_element_location;
  field_location            : curve_element_location;
  section_location          : curve_section_element_location;
END_ENTITY;

ENTITY curve_element_location;
  coordinate                : fea_parametric_point;
END_ENTITY;

ENTITY curve_section_element_location;
  offsets                   : ARRAY [1:2] of context_dependent_measure;
END_ENTITY;

ENTITY element_material;
  material_id               : identifier;
  description               : text;
  properties                : SET [1:?] OF material_property_representation;
END_ENTITY;

ENTITY fea_material_property_geometric_relationship;
  material_ref              : fea_material_property_representation;
  item                      : analysis_item_within_representation;
WHERE
  WR1: 'GEOMETRY_SCHEMA.GEOMETRIC_REPRESENTATION_ITEM' IN TYPEOF(item.item);
END_ENTITY;

ENTITY fea_material_property_representation
  SUBTYPE OF (material_property_representation);
WHERE
  WR1: SIZEOF (QUERY (item <* 
       SELF\property_definition_representation.used_representation.items |
         SIZEOF (['STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_LINEAR_ELASTICITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MASS_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_AREA_DENSITY',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_TANGENTIAL_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SECANT_COEFFICIENT_OF_LINEAR_THERMAL_EXPANSION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_MOISTURE_ABSORPTION',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_BENDING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_MEMBRANE_BENDING_COUPLING_STIFFNESS',
                  'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.' + 
                  'FEA_SHELL_SHEAR_STIFFNESS'] * TYPEOF (item)
                  ) = 1
       )) = 1;
  WR2: 'MATERIAL_PROPERTY_DEFINITION_SCHEMA.MATERIAL_PROPERTY' IN 
       TYPEOF (SELF\property_definition_representation.definition);
END_ENTITY;

ENTITY fea_material_property_representation_item
  SUPERTYPE OF (ONEOF (fea_linear_elasticity,
                   fea_mass_density,
                   fea_area_density,
                   fea_tangential_coefficient_of_linear_thermal_expansion,
                   fea_secant_coefficient_of_linear_thermal_expansion,
                   fea_moisture_absorption,
                   fea_shell_membrane_stiffness,
                   fea_shell_bending_stiffness,
                   fea_shell_membrane_bending_coupling_stiffness,
                   fea_shell_shear_stiffness))
  SUBTYPE OF (representation_item);
END_ENTITY;

ENTITY fea_linear_elasticity
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor4_3d;
END_ENTITY;

ENTITY fea_mass_density
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constant              : scalar;
END_ENTITY;

ENTITY fea_area_density
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constant              : scalar;
END_ENTITY;

ENTITY fea_tangential_coefficient_of_linear_thermal_expansion
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor2_3d;
END_ENTITY;

ENTITY fea_secant_coefficient_of_linear_thermal_expansion
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor2_3d;
  reference_temperature     : thermodynamic_temperature_measure;
END_ENTITY;

ENTITY fea_moisture_absorption
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor2_3d;
END_ENTITY;

ENTITY fea_shell_membrane_stiffness
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor4_2d;
END_ENTITY;

ENTITY fea_shell_bending_stiffness
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor4_2d;
END_ENTITY;

ENTITY fea_shell_membrane_bending_coupling_stiffness
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor4_2d;
END_ENTITY;

ENTITY fea_shell_shear_stiffness
  SUBTYPE OF (fea_material_property_representation_item);
  fea_constants             : symmetric_tensor2_2d;
END_ENTITY;

ENTITY surface_element_property;
  property_id               : identifier;
  description               : text;
  section                   : surface_section_field;
END_ENTITY;

ENTITY surface_section_field
  SUPERTYPE OF (ONEOF (surface_section_field_constant,
                       surface_section_field_varying));
END_ENTITY;

ENTITY surface_section_field_constant
  SUBTYPE OF (surface_section_field);
  definition                : surface_section;
END_ENTITY;

ENTITY surface_section_field_varying
  SUBTYPE OF (surface_section_field);
  definitions               : LIST [1:?] OF surface_section;
  additional_node_values    : BOOLEAN;
END_ENTITY;

ENTITY surface_section
  SUPERTYPE OF (ONEOF (uniform_surface_section,
                       uniform_surface_section_layered));
  offset                     : measure_or_unspecified_value;
  non_structural_mass        : measure_or_unspecified_value;
  non_structural_mass_offset : measure_or_unspecified_value;
END_ENTITY;

ENTITY uniform_surface_section
  SUBTYPE OF (surface_section);
  thickness                 : context_dependent_measure;
  bending_thickness         : measure_or_unspecified_value;
  shear_thickness           : measure_or_unspecified_value;
END_ENTITY;

ENTITY uniform_surface_section_layered
  SUBTYPE OF (surface_section);
END_ENTITY;

ENTITY fea_surface_section_geometric_relationship;
  section_ref               : surface_section;
  item                      : analysis_item_within_representation;
WHERE
  WR1: 'GEOMETRY_SCHEMA.GEOMETRIC_REPRESENTATION_ITEM' IN TYPEOF(item.item);
END_ENTITY;

ENTITY curve_3d_element_property;
  property_id               : identifier;
  description               : text;
  interval_definitions      : LIST [1:?] OF curve_element_interval;
  end_offsets               : ARRAY [1:2] OF curve_element_end_offset;
  end_releases              : ARRAY [1:2] OF curve_element_end_release;
END_ENTITY;

ENTITY curve_element_interval
  SUPERTYPE OF (ONEOF (curve_element_interval_constant,
                       curve_element_interval_linearly_varying));
  finish_position           : curve_element_location;
  eu_angles                 : euler_angles;
END_ENTITY;

ENTITY curve_element_interval_constant
  SUBTYPE OF (curve_element_interval);
  section                : curve_element_section_definition;
END_ENTITY;

ENTITY curve_element_interval_linearly_varying
  SUBTYPE OF (curve_element_interval);
  sections               : ARRAY [1:2] OF curve_element_section_definition;
END_ENTITY;

ENTITY curve_2d_element_property;
  property_id               : identifier;
  description               : text;
  section                   : curve_element_section_definition;
END_ENTITY;

ENTITY curve_element_section_definition
  SUPERTYPE OF (curve_element_section_derived_definitions);
  description               : text;
  section_angle             : plane_angle_measure;
END_ENTITY;

ENTITY curve_element_section_derived_definitions
  SUBTYPE OF (curve_element_section_definition);
  cross_sectional_area      : context_dependent_measure;
  shear_area                : ARRAY [1:2] OF measure_or_unspecified_value;
  second_moment_of_area     : ARRAY [1:3] OF context_dependent_measure;
  torsional_constant        : context_dependent_measure;
  warping_constant          : measure_or_unspecified_value;
  location_of_centroid      : ARRAY [1:2] OF measure_or_unspecified_value;
  location_of_shear_centre  : ARRAY [1:2] OF measure_or_unspecified_value;
  location_of_non_structural_mass
                            : ARRAY [1:2] OF measure_or_unspecified_value;
  non_structural_mass       : measure_or_unspecified_value;
  polar_moment              : measure_or_unspecified_value;
END_ENTITY;

ENTITY fea_curve_section_geometric_relationship;
  section_ref               : curve_element_section_definition;
  item                      : analysis_item_within_representation;
WHERE
  WR1: 'GEOMETRY_SCHEMA.GEOMETRIC_REPRESENTATION_ITEM' IN TYPEOF(item.item);
END_ENTITY;

ENTITY curve_element_end_offset;
  coordinate_system         : curve_element_end_coordinate_system;
  offset_vector             : ARRAY [1:3] OF context_dependent_measure;
END_ENTITY;

ENTITY curve_element_end_release;
  coordinate_system        : curve_element_end_coordinate_system;
  releases                 : LIST [1:?] OF curve_element_end_release_packet;
END_ENTITY;

ENTITY curve_element_end_release_packet;
  release_freedom           : curve_element_freedom;
  release_stiffness         : context_dependent_measure;
END_ENTITY;

ENTITY axisymmetric_2d_element_property;
  angle                     : plane_angle_measure;
END_ENTITY;

ENTITY plane_2d_element_property
  SUPERTYPE OF (simple_plane_2d_element_property);
  depth                     : context_dependent_measure;
END_ENTITY;

ENTITY simple_plane_2d_element_property
  SUBTYPE OF (plane_2d_element_property);
END_ENTITY;

ENTITY fea_group
  SUPERTYPE OF (ONEOF(element_group,
                      node_group))
  SUBTYPE OF (group);
  model_ref                 : fea_model;
END_ENTITY;

ENTITY element_group
  SUBTYPE OF (fea_group);
  elements                  : SET [1:?] OF element_representation;
END_ENTITY;

ENTITY node_group
  SUBTYPE OF (fea_group);
  nodes                     : SET [1:?] OF node_representation;
END_ENTITY;

ENTITY fea_group_relation
  SUBTYPE OF (group_relationship);
WHERE
  WR1: 'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.FEA_GROUP'
        IN TYPEOF (SELF\group_relationship.relating_group);
  WR2: 'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.FEA_GROUP'
        IN TYPEOF (SELF\group_relationship.related_group);
END_ENTITY;

ENTITY volume_3d_element_group
  SUBTYPE OF (element_group);
WHERE
  WR1: SIZEOF(query(item <* elements |
       NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
            'VOLUME_3D_ELEMENT_REPRESENTATION' IN TYPEOF (item))))=0;
END_ENTITY;

ENTITY volume_2d_element_group
  SUBTYPE OF (element_group);
WHERE
  WR1: SIZEOF(QUERY(item <* elements |
       (NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
             'AXISYMMETRIC_VOLUME_2D_ELEMENT_REPRESENTATION'
              IN TYPEOF(item)) AND
        NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
             'PLANE_VOLUME_2D_ELEMENT_REPRESENTATION'
              IN TYPEOF(item)))))=0;
END_ENTITY;

ENTITY surface_3d_element_group
  SUBTYPE OF (element_group);
WHERE
  WR1: SIZEOF(query(item <* elements |
       NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
            'SURFACE_3D_ELEMENT_REPRESENTATION' IN TYPEOF (item))))=0;
END_ENTITY;

ENTITY surface_2d_element_group
  SUBTYPE OF (element_group);
WHERE
  WR1: SIZEOF(QUERY(item <* elements |
       (NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
             'AXISYMMETRIC_SURFACE_2D_ELEMENT_REPRESENTATION'
              IN TYPEOF(item)) AND
        NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
             'PLANE_SURFACE_2D_ELEMENT_REPRESENTATION'
              IN TYPEOF(item)))))=0;
END_ENTITY;

ENTITY curve_3d_element_group
  SUBTYPE OF (element_group);
WHERE
  WR1: SIZEOF(query(item <* elements |
       NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
            'CURVE_3D_ELEMENT_REPRESENTATION' IN TYPEOF (item))))=0;
END_ENTITY;

ENTITY curve_2d_element_group
  SUBTYPE OF (element_group);
WHERE
  WR1: SIZEOF(QUERY(item <* elements |
       (NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
             'AXISYMMETRIC_CURVE_2D_ELEMENT_REPRESENTATION'
              IN TYPEOF(item)) AND
        NOT ('STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.'+
             'PLANE_CURVE_2D_ELEMENT_REPRESENTATION'
              IN TYPEOF(item)))))=0;
END_ENTITY;

FUNCTION required_0d_nodes
  (node_list                : LIST [1:?] OF node_representation): BOOLEAN;

  RETURN (SIZEOF (node_list) = 1);

END_FUNCTION;

FUNCTION required_1d_nodes
  (node_list                : LIST [1:?] OF node_representation;
   order                    : element_order) : BOOLEAN;  

  LOCAL
   end_nodes                : INTEGER;
   additional_nodes         : INTEGER;
  END_LOCAL;

  end_nodes := 2;

  IF (order = linear) THEN
    additional_nodes := 0;
  END_IF;
  IF (order = quadratic) THEN
    additional_nodes := 1;
  END_IF;
  IF (order = cubic) THEN
    additional_nodes := 2;
  END_IF;

  RETURN (SIZEOF (node_list) = end_nodes + additional_nodes);

END_FUNCTION;

FUNCTION required_2d_nodes
  (node_list                : LIST [1:?] OF node_representation;
   element_shape            : element_2d_shape;
   order                    : element_order) : BOOLEAN;
  LOCAL
    vertex_nodes            : INTEGER;
    edge_nodes              : INTEGER;
    edge_face_body_nodes    : INTEGER;
  END_LOCAL;

  IF (element_shape = triangle) THEN
    vertex_nodes := 3;
    IF (order = linear) THEN
      edge_nodes           := 0;
      edge_face_body_nodes := 0;
    END_IF;
    IF (order = quadratic) THEN
      edge_nodes           := 3;
      edge_face_body_nodes := 3;
    END_IF;
    IF (order = cubic) THEN
      edge_nodes           := 6;
      edge_face_body_nodes := 7;
    END_IF;
  END_IF;

  IF (element_shape = quadrilateral) THEN
    vertex_nodes := 4;
    IF (order = linear) THEN
      edge_nodes           := 0;
      edge_face_body_nodes := 0;
    END_IF;
    IF (order = quadratic) THEN
      edge_nodes           := 4;
      edge_face_body_nodes := 5;
    END_IF;
    IF (order = cubic) THEN
      edge_nodes           := 8;
      edge_face_body_nodes := 12;
    END_IF;
  END_IF;

  RETURN ((SIZEOF (node_list) = vertex_nodes + edge_nodes) OR 
          (SIZEOF (node_list) = vertex_nodes + edge_face_body_nodes));

END_FUNCTION;

FUNCTION required_3d_nodes
  (node_list                : LIST [1:?] OF node_representation;
   element_shape            : volume_3d_element_shape;
   order                    : element_order) : BOOLEAN;
  LOCAL
    vertex_nodes            : INTEGER;
    edge_nodes              : INTEGER;
    edge_face_body_nodes    : INTEGER;
  END_LOCAL;

  IF (element_shape = hexahedron) THEN
    vertex_nodes := 8;
    IF (order = linear) THEN
      edge_nodes           := 0;
      edge_face_body_nodes := 0;
    END_IF;
    IF (order = quadratic) THEN
      edge_nodes           := 12;
      edge_face_body_nodes := 19;
    END_IF;
    IF (order = cubic) THEN
      edge_nodes           := 24;
      edge_face_body_nodes := 56;
    END_IF;
  END_IF;

  IF (element_shape = wedge) THEN
    vertex_nodes := 6;
    IF (order = linear) THEN
      edge_nodes           := 0;
      edge_face_body_nodes := 0;
    END_IF;
    IF (order = quadratic) THEN
      edge_nodes           := 9;
      edge_face_body_nodes := 12;
    END_IF;
    IF (order = cubic) THEN
      edge_nodes           := 18;
      edge_face_body_nodes := 34;
    END_IF;
  END_IF;

  IF (element_shape = tetrahedron) THEN
    vertex_nodes := 4;
    IF (order = linear) THEN
      edge_nodes           := 0;
      edge_face_body_nodes := 0;
    END_IF;
    IF (order = quadratic) THEN
      edge_nodes           := 6;
      edge_face_body_nodes := 6;
    END_IF;
    IF (order = cubic) THEN
      edge_nodes           := 12;
      edge_face_body_nodes := 16;
    END_IF;
  END_IF;

  IF (element_shape = pyramid) THEN
    vertex_nodes := 5;
    IF (order = linear) THEN
      edge_nodes           := 0;
      edge_face_body_nodes := 0;
    END_IF;
    IF (order = quadratic) THEN
      edge_nodes           := 8;
      edge_face_body_nodes := 9;
    END_IF;
    IF (order = cubic) THEN
      edge_nodes           := 16;
      edge_face_body_nodes := 25;
    END_IF;
  END_IF;

  RETURN ((SIZEOF (node_list) = vertex_nodes + edge_nodes) OR 
          (SIZEOF (node_list) = vertex_nodes + edge_face_body_nodes));

END_FUNCTION;

FUNCTION number_of_terms
  (node_dof_list           : LIST [1:?] OF LIST [1:?] OF degree_of_freedom;
   matrix_type             : matrix_symmetry) : INTEGER;
  LOCAL
    num_terms              : INTEGER;
    number_of_freedoms     : INTEGER;
  END_LOCAL;

  number_of_freedoms := 0; (* loop for each item in the outer list*)

  REPEAT i := 1 TO SIZEOF (node_dof_list); (* find size of inner list*)
    number_of_freedoms := number_of_freedoms + SIZEOF (node_dof_list[i]);
  END_REPEAT;

  IF (matrix_type = symmetric) THEN
    num_terms := (number_of_freedoms * (number_of_freedoms+1)) DIV 2;
  END_IF;

  IF (matrix_type = diagonal) THEN
    num_terms := number_of_freedoms;
  END_IF;

RETURN (num_terms);

END_FUNCTION;

FUNCTION valid_parametric_coordinate
    (coordinates            :  LIST [1:3] OF parameter_value): BOOLEAN;

    LOCAL
      i                     : INTEGER;
    END_LOCAL; 

    REPEAT i:=1 TO HIINDEX(coordinates);
      IF ((1.0 < coordinates[i]) OR (coordinates[i] < -1.0)) THEN
        RETURN (FALSE);
      END_IF;
    END_REPEAT;

    RETURN (TRUE);

END_FUNCTION;

FUNCTION build_direction_node
    (node_1                 : node_representation;
     node_2                 : node_representation): LIST [2:3] OF REAL;

LOCAL
  nodal_direction_ratios    : LIST [2:3] OF REAL;
  u                         : direction;
  i                         : INTEGER;
  ndim                      : INTEGER;
  rep_items                 : SET [1:?] of representation_item;
  node_1_point              : cartesian_point;
  node_2_point              : cartesian_point;
END_LOCAL;

rep_items := node_1.items;
REPEAT i := 1 TO SIZEOF(rep_items);
  IF ('GEOMETRY_SCHEMA.CARTESIAN_POINT' IN TYPEOF(rep_items[i])) THEN
    node_1_point := rep_items[i];
    ESCAPE;
  END_IF; 
END_REPEAT;

rep_items := node_2.items;
REPEAT i := 1 TO SIZEOF(rep_items);
  IF ('GEOMETRY_SCHEMA.CARTESIAN_POINT' IN TYPEOF(rep_items[i])) THEN
    node_2_point := rep_items[i];
    ESCAPE;
  END_IF; 
END_REPEAT;

ndim := HIINDEX(node_2_point.coordinates);
REPEAT i := 1 TO ndim;
  u.direction_ratios[i] := node_2_point.coordinates[i] - 
                           node_1_point.coordinates[i];
END_REPEAT;

u := normalise (u);
REPEAT i := 1 TO ndim;
  nodal_direction_ratios[i] := u.direction_ratios[i];
END_REPEAT;

RETURN (nodal_direction_ratios);

END_FUNCTION;

FUNCTION consistent_geometric_reference (
  aspect                    : GENERIC;
  item                      : geometric_representation_item) : BOOLEAN;
 
LOCAL
  srrs                      : STRING;
  feacr                     : STRING;
  aspect_type               : SET [1:?] OF STRING;
  item_type                 : SET [1:?] OF STRING;
END_LOCAL;

srrs        := 'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.';
feacr       := 'FINITE_ELEMENT_ANALYSIS_CONTROL_AND_RESULT_SCHEMA.';
aspect_type := TYPEOF (aspect);
item_type   := TYPEOF (item);

IF ('GEOMETRIC_MODEL_SCHEMA.SOLID_MODEL' IN item_type) THEN
  IF ((srrs + 'ELEMENT_VOLUME') IN aspect_type) THEN
    RETURN (TRUE);
  END_IF;
END_IF;

IF (('GEOMETRY_SCHEMA.SURFACE' IN item_type) OR
    ('TOPOLOGY_SCHEMA.FACE_SURFACE' IN item_type)) THEN
  IF SIZEOF ([(feacr + 'VOLUME_3D_FACE'),
              (feacr + 'VOLUME_2D_FACE'),
              (feacr + 'SURFACE_3D_FACE'),
              (feacr + 'SURFACE_2D_FACE')] *
               aspect_type ) = 1 THEN
    RETURN (TRUE);
  END_IF;
END_IF;

IF (('GEOMETRY_SCHEMA.CURVE' IN item_type) OR
    ('TOPOLOGY_SCHEMA.EDGE_CURVE' IN item_type)) THEN
  IF SIZEOF ([(feacr + 'VOLUME_3D_EDGE'),
              (feacr + 'VOLUME_2D_EDGE'),
              (feacr + 'SURFACE_3D_EDGE'), 
              (feacr + 'SURFACE_2D_EDGE'),
              (srrs  + 'CURVE_EDGE')] *
               aspect_type ) = 1 THEN
    RETURN (TRUE);
  END_IF;
END_IF;

RETURN (FALSE);

END_FUNCTION;

FUNCTION consistent_element_or_group_reference (
  aspect                    : GENERIC;
  element                   : GENERIC) : BOOLEAN;
 
LOCAL
  srrs                      : STRING;
  i                         : INTEGER;
END_LOCAL;

srrs := 'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.';

IF ((srrs + 'ELEMENT_REPRESENTATION') IN TYPEOF(element)) THEN
  RETURN (consistent_element_reference (aspect, element));
END_IF;

IF ((srrs + 'ELEMENT_GROUP') IN TYPEOF(element)) THEN
  REPEAT i := 1 TO HIINDEX (element.elements);
    IF NOT (consistent_element_reference (aspect, element.elements[i])) 
     THEN
      RETURN (FALSE);
    END_IF;
  END_REPEAT;
  RETURN (TRUE);
END_IF;

RETURN (FALSE);

END_FUNCTION;

FUNCTION consistent_element_reference (
  aspect                    : GENERIC;
  element                   : element_representation) : BOOLEAN;

LOCAL
  srrs                      : STRING;
  feacr                     : STRING;
  aspect_type               : SET [1:?] OF STRING;
  element_type              : SET [1:?] OF STRING;
END_LOCAL;

srrs         := 'STRUCTURAL_RESPONSE_REPRESENTATION_SCHEMA.';
feacr        := 'FINITE_ELEMENT_ANALYSIS_CONTROL_AND_RESULT_SCHEMA.';
aspect_type  := TYPEOF (aspect);
element_type := TYPEOF (element);

IF ((srrs + 'ELEMENT_REPRESENTATION')
    IN element_type) THEN
  IF ((srrs + 'ELEMENT_VOLUME') IN aspect_type) THEN
    RETURN (TRUE);
  END_IF;
END_IF;

IF ((srrs + 'VOLUME_3D_ELEMENT_REPRESENTATION')
    IN element_type) THEN
  IF (((feacr + 'VOLUME_3D_FACE') IN aspect_type) OR
      ((feacr + 'VOLUME_3D_EDGE') IN aspect_type)) THEN
    RETURN (TRUE);
  END_IF;
END_IF;

IF (((srrs + 'AXISYMMETRIC_VOLUME_2D_ELEMENT_REPRESENTATION')
     IN element_type) OR
    ((srrs + 'PLANE_VOLUME_2D_ELEMENT_REPRESENTATION') 
     IN element_type)) THEN
  IF (((feacr + 'VOLUME_2D_FACE') IN aspect_type) OR
      ((feacr + 'VOLUME_2D_EDGE') IN aspect_type)) THEN
    RETURN (TRUE);
  END_IF;
END_IF;

IF ((srrs + 'SURFACE_3D_ELEMENT_REPRESENTATION')
    IN element_type) THEN
  IF (((feacr + 'SURFACE_3D_FACE') IN aspect_type) OR
      ((feacr + 'SURFACE_3D_EDGE') IN aspect_type)) THEN
    RETURN (TRUE);
  END_IF;
END_IF;

IF (((srrs + 'AXISYMMETRIC_SURFACE_2D_ELEMENT_REPRESENTATION')
    IN element_type) OR
    ((srrs + 'PLANE_SURFACE_2D_ELEMENT_REPRESENTATION')
     IN element_type)) THEN
  IF (((feacr + 'SURFACE_2D_FACE') IN aspect_type) OR
      ((feacr + 'SURFACE_2D_EDGE') IN aspect_type)) THEN
  RETURN (TRUE);
  END_IF;
END_IF;

IF (((srrs + 'CURVE_3D_ELEMENT_REPRESENTATION') 
     IN element_type) OR
    ((srrs + 'AXISYMMETRIC_CURVE_2D_ELEMENT_REPRESENTATION') 
     IN element_type) OR
    ((srrs + 'PLANE_CURVE_2D_ELEMENT_REPRESENTATION') 
     IN element_type)) THEN
  IF ((srrs + 'CURVE_EDGE') IN aspect_type) THEN
    RETURN (TRUE);
  END_IF;
END_IF;

RETURN (FALSE);

END_FUNCTION;

END_SCHEMA; -- structural_response_representation_schema
