You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ion_pos=2, # Position of ion to change (if (D,Z1,Z2), pos 1 -> change Z1)
1689
+
keep_fmain=False, # If True, it will keep fmain and change Z of ion in position ion_pos. If False, it will change the content of ion in position ion_pos and the content of quasineutral ions to achieve Zeff
1690
+
fmain_force=None, # If keep_fmain is True, it will force fmain to this value. If None, it will use the current fmain
1691
+
enforceSameGradients=False# If True, it will scale all thermal densities to have the same gradients after changing Zeff
1692
+
):
1689
1693
1690
-
ifquasineutral_ionsisNone:
1691
-
ifself.DTplasmaBool:
1692
-
quasineutral_ions= [self.Dion, self.Tion]
1693
-
else:
1694
-
quasineutral_ions= [self.Mion]
1694
+
ifnotkeep_fmainandfmain_forceisnotNone:
1695
+
raiseValueError("[MITIM] fmain_force can only be used if keep_fmain is True")
1696
+
1697
+
iffmain_forceisnotNone:
1698
+
fmain_factor=fmain_force/self.derived["fmain"]
1699
+
else:
1700
+
fmain_factor=1.0
1701
+
1702
+
ifself.DTplasmaBool:
1703
+
quasineutral_ions= [self.Dion, self.Tion]
1704
+
else:
1705
+
quasineutral_ions= [self.Mion]
1695
1706
1696
1707
ifnotkeep_fmain:
1697
1708
print(f'\t\t- Changing Zeff (from {self.derived["Zeff_vol"]:.3f} to {Zeff=:.3f}) by changing content of ion in position {ion_pos}{self.Species[ion_pos]["N"],self.Species[ion_pos]["Z"]}, quasineutralized by ions {quasineutral_ions}',typeMsg="i")
1698
1709
else:
1699
-
print(f'\t\t- Changing Zeff (from {self.derived["Zeff_vol"]:.3f} to {Zeff=:.3f}) by changing content and Z of ion in position {ion_pos}{self.Species[ion_pos]["N"],self.Species[ion_pos]["Z"]}, quasineutralized by ions {quasineutral_ions} and keeping fmain={self.derived["fmain"]:.3f}',typeMsg="i")
1710
+
print(f'\t\t- Changing Zeff (from {self.derived["Zeff_vol"]:.3f} to {Zeff=:.3f}) by changing content and Z of ion in position {ion_pos}{self.Species[ion_pos]["N"],self.Species[ion_pos]["Z"]}, quasineutralized by ions {quasineutral_ions} and keeping fmain={self.derived["fmain"]*fmain_factor:.3f}',typeMsg="i")
1700
1711
1701
1712
# Plasma needs to be in quasineutrality to start with
0 commit comments