Changeset 6a0d6aa in sasmodels


Ignore:
Timestamp:
Jul 21, 2016 3:42:33 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
9eb3632
Parents:
b966a96
Message:

magnetic models working in sasview

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_template.c

    r5efe850 r6a0d6aa  
    3232         #define NEED_EXPM1 
    3333         #define NEED_TGAMMA 
     34         #define NEED_ERF 
    3435     #else 
    3536         #define kernel extern "C" 
     
    5051         #define NEED_EXPM1 
    5152         #define NEED_TGAMMA 
     53         #define NEED_ERF 
    5254     #else 
    5355         #include <tgmath.h> // C99 type-generic math, so sin(float) => sinf 
  • sasmodels/sasview_model.py

    r32e3c9b r6a0d6aa  
    503503        to the card for each evaluation. 
    504504        """ 
     505        #core.HAVE_OPENCL = False 
    505506        if self._model is None: 
    506507            self._model = core.build_model(self._model_info) 
     
    510511            q_vectors = [np.asarray(qx)] 
    511512        calculator = self._model.make_kernel(q_vectors) 
    512         pairs = [self._get_weights(p) 
    513                  for p in self._model_info.parameters.call_parameters] 
    514         call_details, value = kernel.build_details(calculator, pairs) 
    515         result = calculator(call_details, value, cutoff=self.cutoff, magnetic=False) 
     513        parameters = self._model_info.parameters 
     514        pairs = [self._get_weights(p) for p in parameters.call_parameters] 
     515        call_details, values = kernel.build_details(calculator, pairs) 
     516        # TODO: should test for 2d? 
     517        magnetic = any(values[k]!=0 for k in parameters.magnetism_index) 
     518        result = calculator(call_details, values, cutoff=self.cutoff, 
     519                            magnetic=magnetic) 
    516520        calculator.release() 
    517521        return result 
Note: See TracChangeset for help on using the changeset viewer.