//- Common item definitions for "ElasticOrder", "ThermalOrder"
mixin basis-order(...categories)
  Int(Name="BasisOrder" Label="Basis Order" Version="0")
    BriefDescirption The order of finite elements
    Categories
      each cat in categories
        Cat= cat
    DefaultValue 1
    RangeInfo #[Min(Inclusive="true") 0]
  Void(Name="CurvedSurfaces" Label="Curved Surfaces"
    Optional="true" IsEnabledByDefault="true" Version="0")
    BriefDescription Use curved surfaces to better approximate the geometry
    Categories
      each cat in categories
        Cat= cat

//- Common item definitions for "ElasticLinearSolver", "ThermalLinearSolver"
mixin linear-solver
  String(Name="Type" Label="Linear Solver Type" Version="0")
    Categproes #[Cat TEM3P-Elastic]
    BriefDescription Type of solver
    DiscreteInfo
      Value CG
      Value GMRES
      Value MUMPS
  //- Void(Name="Verify" Label="Verify" Version="0" Optional="true" IsEnabledByDefault="false")
  //-   BriefDescription Calculate the solution residual or not
  //- Void(Name="SaveDOFs" Label="Save DOFs" Version="0" Optional="true" IsEnabledByDefault="false")
  //-   BriefDescription Save degrees of freedom for further post-processing
  String(Name="Preconditioner" Label="Preconditioner" Version="0")
    BriefDescription Type of preconditioner
    DiscreteInfo
      Value DIAGONAL
      Value CHOLESKY
      Value SSOR
      Value ILU
  Double(Name="AbsoluteTolerance" Label="Absolute Tolerance" Version="0")
    BriefDescription Absolute convergence tolerance
    DefaultValue 1.0e-18
    RangeInfo #[Min(Inclusive="true") 0.0]
  Double(Name="Tolerance" Label="Tolerance" Version="0")
    BriefDescription Relative convergence tolerance
    DefaultValue 1.0e-10
    RangeInfo #[Min(Inclusive="true") 0.0]
  Int(Name="MaxIterations" Label="Max Iterations" Version="0")
    BriefDescription Maximum number of iterations when the solver process terminates even if the tolerance has not been reached
    DefaultValue 100000
    RangeInfo #[Min(Inclusive="true") 1]


doctype xml
SMTK_AttributeResource(Version="3")
  Categories
    Cat TEM3P-Eigen
    Cat TEM3P-Harmonic
    Cat TEM3P-Elastic
    Cat TEM3P-Thermal
    Cat TEM3P-Linear-Thermal
    Cat TEM3P-Nonlinear-Thermal

  Definitions
    AttDef(Type="ElasticOrder" Label="Order" Version="0")
      ItemDefinitions
        // Enable ReferenceT for both elastic and thermal analysis
        Double(Name="ReferenceT" Label="Reference Temperature" CategoryCheckMode="All" Version="0")
          Categories #[Cat TEM3P-Elastic] #[Cat TEM3P-Thermal]
        +basis-order('TEM3P-Elastic', 'TEM3P-Eigen')
        +linear-solver

    AttDef(Type="ElasticLinearSolver" Label="Linear Solver" Version="0")
      Categories #[Cat TEM3P-Elastic]
      ItemDefinitions
        +linear-solver

    AttDef(Type="ThermalOrder" Label="Order" Version="0")
      ItemDefinitions
        +basis-order('TEM3P-Thermal')

    AttDef(Type="ThermalLinearSolver" Label="Linear Solver" Version="0")
      Categories #[Cat TEM3P-Thermal]
      ItemDefinitions
        +linear-solver

    AttDef(Type="PicardSolver" Label="Picard Solver" Version="0")
      Categories #[Cat TEM3P-Nonlinear-Thermal]
      ItemDefinitions
        String(Name="Solver" Label="Picard Solver Type" Version="0")
          BriefDescription Type of solver
          DiscreteInfo(DefaultIndex="0")
            Value CG
        //- Void(Name="Verify" Label="Verify" Version="0" Optional="true" IsEnabledByDefault="false")
        //-   BriefDescription Calculate the solution residual or not
        //- Void(Name="SaveDOFs" Label="Save DOFs" Version="0" Optional="true" IsEnabledByDefault="false")
        //-   BriefDescription Save degrees of freedom for further post-processing
        String(Name="Preconditioner" Label="Preconditioner" Version="0")
          BriefDescription Type of preconditioner
          DiscreteInfo
            Value DIAGONAL
            Value CHOLESKY
            Value SSOR
            Value ILU
        Double(Name="AbsoluteTolerance" Label="Absolute Tolerance" Version="0")
          BriefDescription Absolute convergence tolerance
          DefaultValue 1.0e-18
          RangeInfo #[Min(Inclusive="true") 0.0]
        Double(Name="Tolerance" Label="Tolerance" Version="0")
          BriefDescription Relative convergence tolerance
          DefaultValue 1.0e-10
          RangeInfo #[Min(Inclusive="true") 0.0]
        Int(Name="MaxIterations" Label="Max Iterations" Version="0")
          BriefDescription Maximum number of iterations when the solver process terminates even if the tolerance has not been reached
          DefaultValue 100000
          RangeInfo #[Min(Inclusive="true") 1]

    AttDef(Type="NonlinearSolver" Label="Nonlinear Solver" Version="0")
      Categories #[Cat TEM3P-Nonlinear-Thermal]
      ItemDefinitions
        String(Name="Type" Label="Nonlinear Solver Type" Version="0")
          BriefDescription Type of solver
          DiscreteInfo(DefaultIndex="0")
            Value Newton
        Int(Name="PicardIteration" Label="Picard Iterations" Version="0")
          BriefDescription Number of iterations before switching from Picard to Newton update
          DefaultValue 10
          RangeInfo #[Min(Inclusive="true") 1]
        Int(Name="MaxIterations" Label="Max Iterations" Version="0")
          BriefDescription Maximum number of iterations when the solver process terminates even if the tolerance has not been reached
          DefaultValue 40
          RangeInfo #[Min(Inclusive="true") 1]
        Double(Name="AbsTolerance" Label="Absolute Tolerance" Version="0")
          BriefDescription Absolute convergence tolerance
          DefaultValue 1.0e-10
          RangeInfo #[Min(Inclusive="true") 0.0]
        Double(Name="RelTolerance" Label="Relative Tolerance" Version="0")
          BriefDescription Relative convergence tolerance
          DefaultValue 1.0e-8
          RangeInfo #[Min(Inclusive="true") 0.0]

    AttDef(Type="EigenSolver" Label="EigenSolver" Version="0")
      Categories #[Cat TEM3P-Eigen]
      ItemDefinitions
        Int(Name="NumEigenvalues" Label="Number of eigenvalues" Version="0")
          BriefDescription The number of eigenmodes searched
          DefaultValue 1
          RangeInfo #[Min(Inclusive="true") 1]
        Double(Name="FrequencyShift" Label="Frequency Shift" Version="0" Units="Hz")
          BriefDescription The frequency above which the eigenmodes are calculated
          RangeInfo #[Min(Inclusive="true") 0.0]

    AttDef(Type="HarmonicAnalysis" Label="Harmonic Analysis" Version="0")
      Categories #[Cat TEM3P-Harmonic]
      ItemDefinitions
        String(Name="Frequency" Label="Harmonic Frequencies" Version="0")
          ChildrenDefinitions
            Double(Name="SingleFrequency" Label="Single" Version="0" Units="Hz")
              BriefDescription The frequency at which the harmonic response is calculated
              RangeInfo #[Min(Inclusive="true") 0.0]
            Double(Name="Start" Label="Starting Frequency" Version="0" Units="Hz")
              BriefDescription Start frequency
              RangeInfo #[Min(Inclusive="true") 0.0]
            Double(Name="End" Label="Ending Frequency" Version="0" Units="Hz")
              BriefDescription End frequency
              RangeInfo #[Min(Inclusive="true") 0.0]
            Double(Name="Interval" Label="Interval" Version="0" Units="Hz")
              BriefDescription Frequency sweep interval
              RangeInfo #[Min(Inclusive="true") 0.0]
          DiscreteInfo(DefaultIndex="0")
            Structure
              Value(Enum="Single Frequency") single
              Items
                Item SingleFrequency
            Structure
              Value(Enum="Scan Frequencies") scan
              Items
                Item Start
                Item End
                Item Interval

        Group(Name="Damping" Label="Damping" Optional="true" IsEnabledByDefault="false" Version="0")
          ItemDefinitions
            Double(Name="StiffnessDamping" Label="Stiffness Damping" Version="0")
              BriefDescription Stiffness-proportional damping coefficient
              DefaultValue 0.0
            Double(Name="MassDamping" Label="Mass Damping" Version="0")
              BriefDescription Mass-proportional damping coefficient
              DefaultValue 0.0

= '\n'
