<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : physicalModel.xsd
    Created on : 19 February 2002, 11:35
    Author     : Emmanuel Promayon
    Description:
        Schema for validating physical model documents.
    Revision   : $Id: physicalModel.xsd 2220 2004-03-16 19:59:43Z promayon $
        Version 0.3 => Nico has changed ##any in attributes
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            
            <xsd:include schemaLocation="ExclusiveComponent.xsd"/>
            <xsd:include schemaLocation="InformativeComponent.xsd"/>
            <xsd:include schemaLocation="Atoms.xsd"/>
            
            <xsd:element name="physicalModel" type="PhysicalModel">
                <xsd:annotation>
                    <xsd:documentation>
                        The root element for the document describing a physical model.
                        
                        It is here specified that atom index must be unique and that atomRef
                        must be reference to existante atom index.
                    </xsd:documentation>
                </xsd:annotation>
                       
                <xsd:key name="UniqueAtomIndex"> 
                    <xsd:annotation>
                        <xsd:documentation>
                            Define a unique key for atom index
                        </xsd:documentation>
                    </xsd:annotation>
                    <xsd:selector xpath=".//atoms/atomProperties"/> 
                    <xsd:field xpath="@index"/>
                </xsd:key>
                
                <xsd:keyref name="NoUnknownAtomIndex" refer="UniqueAtomIndex">
                    <xsd:annotation>
                        <xsd:documentation>
                            Cells have to use existing atom index
                        </xsd:documentation>
                    </xsd:annotation>
                    <xsd:selector xpath=".//cells/atomRef"/>
                    <xsd:field xpath="@index"/>
                </xsd:keyref>

            </xsd:element>
            
            <xsd:complexType name="PhysicalModel">
                <xsd:annotation>
                    <xsd:documentation>
                        physical model is a generic representation for 3D physical model 
                        (FEM, spring mass network, phymul...).
                        Attributes are optional. If present they are used to optimize the
                        reading of the document.
                    </xsd:documentation>
                </xsd:annotation>
                
                <xsd:all>
                    <xsd:element name="atoms" type="Atoms"/>
                    <xsd:element name="exclusiveComponents" type="ExclusiveComponent"/>
                    <xsd:element name="informativeComponents" type="InformativeComponent" minOccurs="0"/>
                </xsd:all>
                
                <xsd:attribute name="name" type="xsd:string"/>
                <xsd:attribute name="nrOfAtoms" type="xsd:int"/>
                <xsd:attribute name="nrOfExclusiveComponents" type="xsd:int"/>
                <xsd:attribute name="nrOfInformativeComponents" type="xsd:int"/>
                <xsd:attribute name="nrOfCells" type="xsd:int"/>
                <xsd:anyAttribute namespace="##any" processContents="lax" />
            </xsd:complexType>
            
    
</xsd:schema>
