Ignore:
Timestamp:
Nov 28, 2013 9:16:02 PM (8 years ago)
Author:
toby
Message:

finish ISODISPLACE fixes; improve show var window; improve help window; add refine checkbox for newvars in constraints display

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImapvars.py

    r1143 r1160  
    551551    for varlist,mapvars,multarr,invmultarr in zip(
    552552        dependentParmList,indParmList,arrayList,invarrayList):
    553         if multarr is None:
     553        if multarr is None: # do only if an equivalence
    554554            zeromult = False
    555555            for mv in mapvars:
     
    638638               
    639639    # now process each group and create the relations that are needed to form
    640     # non-singular square matrix
     640    # a non-singular square matrix
    641641    # If all are varied and this is a constraint equation, then set VaryFree flag
    642642    # so that the newly created relationships will be varied
     
    671671        group = group[:]
    672672        # scan through all generated and input relationships, we need to add to the varied list
    673         # all the new parameters where VaryFree has been set or where all the
    674         # dependent parameters are varied. Check again for inconsistent variable use
    675         # for new variables -- where varied and unvaried parameters get grouped
    676         # together. I don't think this can happen when not flagged before, but
    677         # it does not hurt to check again.
     673        # all the new parameters where VaryFree has been set or where a New Var is varied.
     674        #
     675        # If a group does not contain any fixed values (constraint equations)
     676        # and nothing in the group is varied, drop this group, so that the
     677        # dependent parameters can be refined individually.
     678        unused = True
    678679        for i in range(len(varlist)):
    679680            if len(group) > 0: # get the original equation reference
     
    682683                varyflag = constrDict[rel].get('_vary',False)
    683684                varname = constrDict[rel].get('_name','')
    684             else: # relationship has been generated
     685            else: # this relationship has been generated
    685686                varyflag = False
    686687                varname = ''
     
    692693                mapvar.append(varname)
    693694                # vary the new relationship if it is a degree of freedom in
    694                 # a set of contraint equations or if a new variable is flagged to be varied.
     695                # a set of contraint equations or if a New Var is flagged to be varied.
    695696                if VaryFree or varyflag:
     697                    unused = False
    696698                    varyList.append(varname)
    697699                    # fix (prevent varying) of all the variables inside the constraint group
     700                    # (dependent vars)
    698701                    for var in varsList:
    699702                        if var in varyList: varyList.remove(var)
    700703            else:
     704                unused = False
    701705                mapvar.append(fixedval)
     706        if unused: continue # skip over constraints that do not have a fixed value or a refined variable
    702707        dependentParmList.append(varlist)
    703708        arrayList.append(constrArr)
Note: See TracChangeset for help on using the changeset viewer.