---
# build_attributes.py input for RfGunBody.tem3p

# Configure analysis attribute
- action: edit
  type: analysis
  items:
    - name: 'Analysis'
      value: TEM3P
      items:
        - name: TEM3P
          value: Thermal/Elastic
          items:
            - name: Thermal/Elastic
              items:
              - name: 'Elastic'
                enable: true
              - name: 'Thermal'
                enable: true
                value: Linear

# NERSC Directory (user must set the value)
- action: edit
  type: InputData
  items:
    - name: Source
      enable: true
      # items:
      #   - 'NERSCDirectory': /global/cscratch1/sd/johnt/test1/JOBID/omega3p_results

# Thermal Analysis
- action: edit
  type: ThermalOrder
  items:
    - 'BasisOrder': 2

- action: edit
  type: ThermalLinearSolver
  items:
    - 'Type': CG
    - 'Preconditioner': DIAGONAL
    - 'MaxIterations': 5000

- type: TEM3PThermalMaterial
  associate:
    - volume: 1
  items:
    - 'ConstantThermalConductivity': 391.0

- type: TEM3PThermalNeumann
  associate:
    - face: [1, 2, 3, 4]

- type: TEM3PThermalRobin
  associate:
    - face: 5
  items:
    - 'RobinConstantFactor': 20000.0
    - 'RobinConstantValue': 440000.0

- type: TEM3PThermalRFHeating
  associate:
    - face: 6
  items:
    - name: Method
      value: Gradient
      items:
        - 'Sigma': 5.8e+7
        - 'TargetGradient': 60.0e+6
        - 'DutyFactor': 0.00036
        - 'StartPoint': [0.0001, 0.0001, -0.017018]
        - 'EndPoint': [0.0001, 0.0001, 0.017018]

# Elastic Analysis
- action: edit
  type: ElasticOrder
  items:
    - 'BasisOrder': 2
    - 'ReferenceT': 25.0

- action: edit
  type: MeshDump
  items:
    - name: DeformedMeshFiles
      items:
        - name: WriteDeformedEMMesh
          enable: true
    - name: WriteStressStrain
      enable: true

- action: edit
  type: ElasticLinearSolver
  items:
    - 'Type': CG
    - 'Preconditioner': DIAGONAL
    - 'MaxIterations': 50000

- type: TEM3PElasticMaterial
  associate:
    - volume: 1
  items:
    - name: Material
      value: Copper-293K

- type: TEM3PStructuralMixed
  associate:
    - face: 1
  items:
    - 'MixedType': [NEUMANN, NEUMANN, DIRICHLET]

- type: TEM3PStructuralMixed
  associate:
    - face: 2
  items:
    - 'MixedType': [DIRICHLET, NEUMANN, NEUMANN]

- type: TEM3PStructuralMixed
  associate:
    - face: 3
  items:
    - 'MixedType': [NEUMANN, DIRICHLET, NEUMANN]

- type: TEM3PStructuralNeumann
  associate:
    - face: [4, 5]

- type: TEM3PLFDetuning
  associate:
    - face: 6
  items:
    - 'Omega3PId': 6
    - name: LFDetuningMethod
      value: Gradient
      items:
        - 'TargetGradient': 60.0e+6
        - 'StartPoint': [0.0001, 0.0001, -0.017018]
        - 'EndPoint': [0.0001, 0.0001, 0.017018]
