Strain-compatible shear modulus [kN//m²].
508537
def shear_mod(self):
        """"""
        try:
            value = self._shear_mod.value
        except AttributeError:
            value = self._shear_mod
        return value
1072450
def rpole_to_pot_aligned(rpole, sma, q, F, d, component=1):
    
    q = q_for_component(q, component=component)
    rpole_ = np.array([0, 0, rpole/sma])
    logger.debug("libphoebe.roche_Omega(q={}, F={}, d={}, rpole={})".format(q, F, d, rpole_))
    pot = libphoebe.roche_Omega(q, F, d, rpole_)
    return pot_for_component(pot, component, reverse=True)
643322
def _calc_strain_ref(x_3, x_3_mean):
        """"""
        b_9 = -1.41
        b_10 = -0.950
        return np.exp(b_9 + b_10 * (x_3 - x_3_mean)) / 100
267803
def _calc_strain_max(self, loc_input, loc_layer, motion, *args):
        """"""
        return motion.calc_peak(
            self.calc_strain_tf(loc_input, loc_layer))
107152
def CBO_X(self, **kwargs):
        '''
        
        '''
        return (self.unstrained.CBO_X(**kwargs) +
                self.CBO_strain_shift(**kwargs))
41375
def computeRatModuleParametersFromReadoutResolution(inverseReadoutResolution,
                                                    enlargeModuleFactor=1.):
  
  # Give the module enough precision in its learning so that the bump is the
  # specified diameter when properly accounting for uncertainty.
  cellsPerAxis = int(math.ceil(2*inverseReadoutResolution*enlargeModuleFactor))

  bumpSigma = RAT_BUMP_SIGMA / enlargeModuleFactor

  readoutResolution = 1. / (enlargeModuleFactor*inverseReadoutResolution)
  activeFiringRate = ThresholdedGaussian2DLocationModule.chooseReliableActiveFiringRate(
    cellsPerAxis, bumpSigma, readoutResolution)

  return {
    "cellsPerAxis": cellsPerAxis,
    "bumpSigma": bumpSigma,
    "activeFiringRate": activeFiringRate
  }
866630
def strain_in_plane(self, **kwargs):
        '''
        
        '''
        if self._strain_out_of_plane is not None:
            return ((self._strain_out_of_plane / -2.) *
                    (self.unstrained.c11(**kwargs) /
                     self.unstrained.c12(**kwargs)  )  )
        else:
            return 1 - self.unstrained.a(**kwargs) / self.substrate.a(**kwargs)
547316
def _estimate_strains(self):
        
        eql = EquivalentLinearCalculator()
        eql(self._motion, self._profile, self._loc_input)
630670
def from_cli(cls, opt, strain):
        
        return cls(strain, segment_length=opt.segment_length,
                   segment_start_pad=opt.segment_start_pad,
                   segment_end_pad=opt.segment_end_pad,
                   trigger_start=opt.trig_start_time,
                   trigger_end=opt.trig_end_time,
                   filter_inj_only=opt.filter_inj_only,
                   injection_window=opt.injection_window,
                   allow_zero_padding=opt.allow_zero_padding)
1264361
def strain_out_of_plane(self, **kwargs):
        '''
        
        '''
        if self._strain_out_of_plane is not None:
            return self._strain_out_of_plane
        else:
            return (-2 * self.unstrained.c12(**kwargs) /
                    self.unstrained.c11(**kwargs) *
                    self.strain_in_plane(**kwargs)      )
4858
function getShapeTwo(x,y,options,modules,mod_matrix){

  var EOL = '\r\n';
  var width = options.width;
  var height = options.height;
  var length = modules.length;
  var style = options.style;
  var xsize = width / (length + 2 * options.padding);
  var ysize = height / (length + 2 * options.padding);
  var px = (x * xsize + options.padding * xsize);
  var py = (y * ysize + options.padding * ysize);

  //If in the middle of a straight line, return a 1b3b
  if( (mod_matrix.top && mod_matrix.bottom) || (mod_matrix.left && mod_matrix.right) ){
    var orientation = (mod_matrix.top && mod_matrix.bottom) ? 0 : 90;
    switch(options.style){
      case 'square':
        return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')"  x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
      case 'circle':
        return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')" rx="'+xsize+'" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
      case 'sharp-edge':
        return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
    }
  }

  //If a diagonal is in between the two surrounding (module is on a corner), return a 2a1b1a
  if(mod_matrix.topLeft || mod_matrix.topRight || mod_matrix.bottomLeft || mod_matrix.bottomRight){

    var orientation = 0;
    if(mod_matrix.top && mod_matrix.topRight && mod_matrix.right){orientation=90;}
    else if(mod_matrix.right && mod_matrix.bottomRight && mod_matrix.bottom){orientation=180;}
    else if(mod_matrix.left && mod_matrix.bottomLeft && mod_matrix.bottom){orientation=270;}

    switch(options.style){
      case 'square':
        return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')"  x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
      case 'circle':
        return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')" rx="'+xsize+'" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
      case 'sharp-edge':
        return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
    }
  }

  //Else in the center of a right angle
  var orientation = 0;
  if(mod_matrix.top && mod_matrix.right){orientation=90;}
  else if(mod_matrix.right && mod_matrix.bottom){orientation=180;}
  else if(mod_matrix.bottom && mod_matrix.left){orientation=270;}

  switch(options.style){
    case 'square':
      return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')"  x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
    case 'circle':
      return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')"  rx="'+xsize+'" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
    case 'sharp-edge':
      return '<rect transform="rotate('+orientation+' '+(px+xsize/2)+' '+(py+ysize/2)+')" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
  }
}
373964
def gen(ctx, num, lo, hi, size, struct):
    ''''''

    frmt = ctx.parent.params['frmt']
    action = ctx.parent.params['action']
    cryst = ase.io.read(struct, format=frmt)
    fn_tmpl = action
    if frmt == 'vasp':
        fn_tmpl += '_%03d.POSCAR'
        kwargs = {'vasp5': True, 'direct': True}
    elif frmt == 'abinit':
        fn_tmpl += '_%03d.abinit'
        kwargs = {}

    if verbose:
        from elastic.elastic import get_lattice_type
        nr, brav, sg, sgn = get_lattice_type(cryst)
        echo('%s lattice (%s): %s' % (brav, sg, cryst.get_chemical_formula()))
        if action == 'cij':
            echo('Generating {:d} deformations of {:.1f}(%/degs.) per axis'.format(
                    num, size))
        elif action == 'eos':
            echo('Generating {:d} deformations from {:.3f} to {:.3f} of V0'.format(
                    num, lo, hi))

    if action == 'cij':
        systems = elastic.get_elementary_deformations(cryst, n=num, d=size)
    elif action == 'eos':
        systems = elastic.scan_volumes(cryst, n=num, lo=lo, hi=hi)

    systems.insert(0, cryst)
    if verbose:
        echo('Writing %d deformation files.' % len(systems))
    for n, s in enumerate(systems):
        ase.io.write(fn_tmpl % n, s, format=frmt, **kwargs)
455785
def cas2mach(Vcas, H):
    """"""
    Vtas = cas2tas(Vcas, H)
    Mach = tas2mach(Vtas, H)
    return Mach
211051
def _compute_stress_drop_adjustment(self, SC, mag, scale_fac):
        
        return scale_fac * np.minimum(
            SC['delta'] + 0.05,
            0.05 + SC['delta'] * (
                np.maximum(mag - SC['M1'], 0) / (SC['Mh'] - SC['M1'])
            )
        )
1302402
function () {
		var bones = this.bones;
		for (var i = 0, n = bones.length; i < n; i++)
			bones[i].setToSetupPose();

		var ikConstraints = this.ikConstraints;
		for (var i = 0, n = ikConstraints.length; i < n; i++) {
			var constraint = ikConstraints[i];
			constraint.bendDirection = constraint.data.bendDirection;
			constraint.mix = constraint.data.mix;
		}

		var transformConstraints = this.transformConstraints;
		for (var i = 0, n = transformConstraints.length; i < n; i++) {
			var constraint = transformConstraints[i];
			constraint.translateMix = constraint.data.translateMix;
			constraint.x = constraint.data.x;
			constraint.y = constraint.data.y;
		}
	}
210066
function modifiedGramSchmidt (m) {
  const n = m.dimension;

  const v0 = m.getColumn(0);
  const u0 = v0;
  const v1 = m.getColumn(1);
  const u1 = v1.clone().sub(proj(u0, v1));
  if (n === 2) {
    m.setColumns(v0, v1);
    return;
  }
  const v2 = m.getColumn(2);
  const u2t = v2.clone().sub(proj(u0, v2));
  const u2 = u2t.sub(proj(u1, u2t));
  if (n === 3) {
    m.setColumns(u0, u1, u2);
    // return;
  }
}
526909
def _JRAxiIntegrand(r,E,L,pot):
    """"""
    return nu.sqrt(2.*(E-potentialAxi(r,pot))-L**2./r**2.)