diff --git a/pyEPR/ansys.py b/pyEPR/ansys.py index 8a84c99..29530f8 100644 --- a/pyEPR/ansys.py +++ b/pyEPR/ansys.py @@ -41,21 +41,22 @@ try: import pythoncom except (ImportError, ModuleNotFoundError): - pass + pass #raise NameError ("pythoncom module not installed. Please install.") try: # TODO: Replace `win32com` with Linux compatible package. # See Ansys python files in IronPython internal. from win32com.client import Dispatch, CDispatch except (ImportError, ModuleNotFoundError): - pass + pass #raise NameError ("win32com module not installed. Please install.") try: from pint import UnitRegistry ureg = UnitRegistry() Q = ureg.Quantity except (ImportError, ModuleNotFoundError): - ureg = "Pint module not installed. Please install." + pass # raise NameError ("Pint module not installed. Please install.") + ############################################################################## ### @@ -2936,6 +2937,30 @@ def getQty(self, name): def integrate_line(self, name): return self._integrate(name, "EnterLine") + def normal2surface(self, name): + ''' return the part normal to surface. + Complex Vector. ''' + stack = self.stack + [("EnterSurf", name), + ("CalcOp", "Normal")] + stack.append(("CalcOp", "Dot")) + stack.append(("EnterSurf", name)) + stack.append(("CalcOp", "Normal")) + stack.append(("CalcOp", "*")) + return CalcObject(stack, self.setup) + + def tangent2surface(self, name): + ''' return the part tangent to surface. + Complex Vector. ''' + stack = self.stack + [("EnterSurf", name), + ("CalcOp", "Normal")] + stack.append(("CalcOp", "Dot")) + stack.append(("EnterSurf", name)) + stack.append(("CalcOp", "Normal")) + stack.append(("CalcOp", "*")) + stack = self.stack + stack + stack.append(("CalcOp", "-")) + return CalcObject(stack, self.setup) + def integrate_line_tangent(self, name): ''' integrate line tangent to vector expression \n name = of line to integrate over ''' diff --git a/pyEPR/core_distributed_analysis.py b/pyEPR/core_distributed_analysis.py index eb53d34..ed09215 100644 --- a/pyEPR/core_distributed_analysis.py +++ b/pyEPR/core_distributed_analysis.py @@ -151,14 +151,14 @@ def __init__(self, *args, **kwargs): # Modes and variations - the following get updated in update_variation_information self.n_modes = int(1) # : Number of eigenmodes self.modes = None - #: List of variation indecies, which are strings of ints, such as ['0', '1'] + #: List of variation indices, which are strings of ints, such as ['0', '1'] self.variations = [] - self.variations_analyzed = [] # : List of analyzed variations. List of indecies + self.variations_analyzed = [] # : List of analyzed variations. List of indices # String identifier of variables, such as "Cj='2fF' Lj='12.5nH'" self._nominal_variation = '' self._list_variations = ("",) # tuple set of variables - # container for eBBQ list of varibles; basically the same as _list_variations + # container for eBBQ list of variables; basically the same as _list_variations self._hfss_variables = Dict() self._previously_analyzed = set() # previously analyzed variations @@ -356,7 +356,6 @@ def _get_lv(self, variation=None): ['Lj1:=','13nH', 'QubitGap:=','100um'] ''' - if variation is None: lv = self._nominal_variation # "Cj='2fF' Lj='12.5nH'" lv = self._parse_listvariations(lv) @@ -369,7 +368,7 @@ def _get_lv(self, variation=None): @property def n_variations(self): - """ Number of **solved** variaitons, corresponding to the + """ Number of **solved** variations, corresponding to the selected Setup. """ return len(self._list_variations) @@ -477,7 +476,6 @@ def update_ansys_info(self): n_modes, _list_variations, nominal_variation, n_variations ''' - # from oDesign self._nominal_variation = self.design.get_nominal_variation() @@ -888,7 +886,7 @@ def get_Qdielectric(self, dielectric, mode, variation, U_E=None): def get_Qsurface_all(self, mode, variation, U_E=None): ''' - caculate the contribution to Q of a dieletric layer of dirt on all surfaces + calculate the contribution to Q of a dielectric layer of dirt on all surfaces set the dirt thickness and loss tangent in the config file ref: http://arxiv.org/pdf/1509.01854.pdf ''' @@ -1027,10 +1025,10 @@ def calc_p_junction(self, variation, U_H, U_E, Ljs, Cjs): #print('\tV_peak=', V_peak) # ------------------------------------------------------------ - # Calcualte participations from the peak voltage and currents + # Calculate participation from the peak voltage and currents # - # All junction capactive and inductive lumped energies - all peak + # All junction capacitive and inductive lumped energies - all peak U_J_inds = {j_name: 0.5*Ljs[j_name] * I_peak_[j_name] ** 2 for j_name in self.pinfo.junctions} U_J_caps = {j_name: 0.5*Cjs[j_name] * V_peak_[j_name] @@ -1423,7 +1421,7 @@ def save(self, project_info: dict = None): pickle.dump(to_save, handle) # , protocol=pickle.HIGHEST_PROTOCOL) def load(self, filepath=None): - """Utility function to load reuslts file + """Utility function to load results file Keyword Arguments: filepath {[type]} -- [description] (default: {None}) diff --git a/pyEPR/core_quantum_analysis.py b/pyEPR/core_quantum_analysis.py index 4d8e6fd..541d7d4 100644 --- a/pyEPR/core_quantum_analysis.py +++ b/pyEPR/core_quantum_analysis.py @@ -445,7 +445,7 @@ def analyze_all_variations(self, Specific params: -------------------- - variations : None returns all_variations otherwis this is a list with number + variations : None returns all_variations otherwise this is a list with number as strings ['0', '1'] nalyze_previous :set to true if you wish to overwrite previous analysis '''