Crystallographic Information Framework

[CIF logo]
⋯ > [FUNCTION]

Index

Modulated structures dictionary (msCIF) version 3.2.1

_function.Crenel

Name:
_function.Crenel

Definition:

   

      The function:

            o = Crenel(c, w, x4)

      returns, 1 if x4 belongs to the interval [c-w/2,c+w/2], 0 otherwise. 
      x4 is a particular value of the internal coordinate, c is the centre of a
      crenel function in internal space and w is its width. The use of this
      function is restricted to one-dimensional modulated structures.     

Type: Real

Evaluation method:

      Function Crenel( c  :[Single, Real],
                       w  :[Single, Real],
                       x4 :[Single,Real] )
      {
      
        Crenel = 0.0 

        If ( c-w/2.0 <= x4 and x4 <= c+w/2.0 ) Crenel = 1.0

      }

# Heavier alternative: only atom label and x4

      Function Crenel( atlab :[Single, Code],
                       x4    :[Single,Real] )
      {
      
        Crenel = -1.0  # Atom not in list of crenel modulation or null crenel width

        Loop o as atom_site_occ_special_func {

          If (atlab == o.atom_site_label and o.crenel_w != 0.0){

            Crenel = 0.0

            If ( o.crenel_c-o.crenel_w/2.0 <= x4 and 
                                      x4 <= o.crenel_c+o.crenel_w/2.0 ) Crenel = 1.0

            Break

          } # End of If

        }   # End of Loop

      }

Category:
function