Inspect Bundled Results

This tutorial accesses the ordered results from a two-project bundle.

Run it from demos/documentation_tutorials:

python result_access/04_bundled_solves/run.py
import jcmsuite

bundle = jcmsuite.solve(
    ["1D/project.jcmp", "project.jcmp"],
    keys={"radius": 0.5},
)

mode_result = bundle[0]
scatter_result = bundle[1]

print(bundle)

print(mode_result)

print(scatter_result)

Project Files

layout.jcmt
Layout {
  UnitOfLength = 1e-6
  MeshOptions {
    MaximumSidelength = 0.2
  }
  Parallelogram {
    DomainId = 1
    Width = 2
    Height = 2
    BoundarySegment {
      BoundaryClass = Transparent
    }
  }
  Circle {
    DomainId = 2
    Radius = %(radius)e
    RefineAll = 2
  }
}
materials.jcm
Material {
  DomainId = 1
  RelPermittivity = 1.0
  RelPermeability = 1.0
}

Material {
  DomainId = 2
  RelPermittivity = 2.3104
  RelPermeability = 1.0
}
project.jcmp
Project {
  InfoLevel = 3
  Electromagnetics {
    TimeHarmonic {
      Scattering {
        Accuracy {
          FiniteElementDegree = 2
          Refinement {
            MaxNumberSteps = 0
            PreRefinements = 0
          }
        }
      }
    }
  }
}

PostProcess {
  ModeOverlap {
    FieldBagPath = "project_results/fieldbag.jcm"
    OutputFileName = "project_results/modeOverlap.jcm"
    ModeFileName = "1D/project_results/fieldbag.jcm"
    Format = JCM-ASCII
    Port = DetectPorts
  }
}
sources.jcm
SourceBag {
  Source {
    ElectricFieldStrength {
      PlaneWave {
        K = [1.14239732857811e7 0.0 0.0]
        Amplitude = [0 0 1]
      }
    }
  }
}

1D Project Files

1D/layout.jcmt
Layout {
  UnitOfLength = 1e-6
  MeshOptions {
    MaximumSidelength = 0.2
  }
  Parallelogram {
    DomainId = 1
    Width = 2
    Height = 2
    BoundarySegment {
      BoundaryClass = Transparent
    }
  }
  Circle {
    DomainId = 2
    Radius = %(radius)e
    RefineAll = 2
  }
}
1D/materials.jcm
Material {
  DomainId = 1
  RelPermittivity = 1.0
  RelPermeability = 1.0
}

Material {
  DomainId = 2
  RelPermittivity = 2.3104
  RelPermeability = 1.0
}
1D/project.jcmp
Project {
  InfoLevel = 3
  Electromagnetics {
    TimeHarmonic {
      PropagatingMode {
        Lambda0 = 1.5e-6
        Accuracy {
          Precision = 1e-4
          Refinement {
            MaxNumberSteps = 0
            PreRefinements = 0
          }
        }
        SelectionCriterion {
          NearGuess {
            Guess = 1.5
            NumberEigenvalues = 1
          }
        }
      }
    }
  }
}
1D/sources.jcm
SourceBag {
  Source {
    ElectricFieldStrength {
      PlaneWave {
        K = [1.14239732857811e7 0.0 0.0]
        Amplitude = [0 0 1]
      }
    }
  }
}