Index: realSpaceModeling/analmodelpy/Make.mm
===================================================================
--- realSpaceModeling/analmodelpy/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,47 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+PROJECT = analmodelpy
+
+# directory structure
+
+BUILD_DIRS = \
+    libanalmodelpy \
+    analmodelpymodule \
+    analmodelpy \
+
+OTHER_DIRS = \
+    tests \
+    examples
+
+RECURSE_DIRS = $(BUILD_DIRS) $(OTHER_DIRS)
+
+#--------------------------------------------------------------------------
+#
+
+all:
+	BLD_ACTION="all" $(MM) recurse
+
+distclean::
+	BLD_ACTION="distclean" $(MM) recurse
+
+clean::
+	BLD_ACTION="clean" $(MM) recurse
+
+tidy::
+	BLD_ACTION="tidy" $(MM) recurse
+
+# version
+# $Id$
+
+# End of file
Index: realSpaceModeling/analmodelpy/analmodelpy/Make.mm
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpy/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpy/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,35 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PROJECT = analmodelpy
+PACKAGE = analmodelpy
+
+#--------------------------------------------------------------------------
+#
+
+all: export
+
+
+#--------------------------------------------------------------------------
+#
+# export
+
+EXPORT_PYTHON_MODULES = \
+    __init__.py
+
+
+export:: export-python-modules
+
+# version
+# $Id$
+
+# End of file
Index: realSpaceModeling/analmodelpy/analmodelpy/__init__.py
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpy/__init__.py	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpy/__init__.py	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+# 
+#  <LicenseText>
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+
+def copyright():
+    return "analmodelpy pyre module: Copyright (c) 1998-2005 Michael A.G. Aivazis";
+
+
+# version
+__id__ = "$Id$"
+
+#  End of file 
Index: realSpaceModeling/analmodelpy/analmodelpymodule/Make.mm
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,32 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+PROJECT = SANSsimulation
+PACKAGE = analmodelpymodule
+MODULE = analmodelpy
+
+include std-pythonmodule.def
+include local.def
+
+PROJ_CXX_SRCLIB = -lanalmodelpy
+
+PROJ_SRCS = \
+    bindings.cc \
+    exceptions.cc \
+    misc.cc
+
+
+# version
+# $Id$
+
+# End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/analmodelpymodule.cc
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/analmodelpymodule.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/analmodelpymodule.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+
+#include <Python.h>
+
+#include "exceptions.h"
+#include "bindings.h"
+
+
+char pyanalmodelpy_module__doc__[] = "";
+
+// Initialization function for the module (*must* be called initanalmodelpy)
+extern "C"
+void
+initanalmodelpy()
+{
+    // create the module and add the functions
+    PyObject * m = Py_InitModule4(
+        "analmodelpy", pyanalmodelpy_methods,
+        pyanalmodelpy_module__doc__, 0, PYTHON_API_VERSION);
+
+    // get its dictionary
+    PyObject * d = PyModule_GetDict(m);
+
+    // check for errors
+    if (PyErr_Occurred()) {
+        Py_FatalError("can't initialize module analmodelpy");
+    }
+
+    // install the module exceptions
+    pyanalmodelpy_runtimeError = PyErr_NewException("analmodelpy.runtime", 0, 0);
+    PyDict_SetItemString(d, "RuntimeException", pyanalmodelpy_runtimeError);
+
+    return;
+}
+
+// version
+// $Id$
+
+// End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/bindings.cc
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/bindings.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/bindings.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+#include <Python.h>
+
+#include "bindings.h"
+
+#include "misc.h"          // miscellaneous methods
+
+// the method table
+
+struct PyMethodDef pyanalmodelpy_methods[] = {
+
+    // new analmodel
+    {pyanalmodelpy_new_analmodel__name__, pyanalmodelpy_new_analmodel,
+     METH_VARARGS, pyanalmodelpy_new_analmodel__doc__},
+
+    //analmodel method: CalculateIQ
+    {pyanalmodelpy_CalculateIQ__name__, pyanalmodelpy_CalculateIQ,
+     METH_VARARGS, pyanalmodelpy_CalculateIQ__doc__},
+
+    {pyanalmodelpy_copyright__name__, pyanalmodelpy_copyright,
+     METH_VARARGS, pyanalmodelpy_copyright__doc__},
+
+
+// Sentinel
+    {0, 0}
+};
+
+// version
+// $Id$
+
+// End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/bindings.h
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/bindings.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/bindings.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyanalmodelpy_bindings_h)
+#define pyanalmodelpy_bindings_h
+
+// the method table
+
+extern struct PyMethodDef pyanalmodelpy_methods[];
+
+#endif
+
+// version
+// $Id$
+
+// End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/exceptions.cc
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/exceptions.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/exceptions.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,22 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+#include <Python.h>
+
+PyObject *pyanalmodelpy_runtimeError = 0;
+    
+// version
+// $Id$
+
+// End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/exceptions.h
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/exceptions.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/exceptions.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyanalmodelpy_exceptions_h)
+#define pyanalmodelpy_exceptions_h
+
+// exceptions
+
+extern PyObject *pyanalmodelpy_runtimeError;
+
+#endif
+
+// version
+// $Id$
+
+// End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/local.def
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/local.def	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/local.def	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,25 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+# C++
+
+    PROJ_CXX_INCLUDES = ../libanalmodelpy   \
+			../../iqPy/libiqPy  \
+			../../iqPy/libiqPy/tnt  \
+			../../geoshapespy/libgeoshapespy  \
+			../../pointsmodelpy/libpointsmodelpy
+
+# version
+# $Id$
+
+# End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/misc.cc
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/misc.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/misc.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+//#include <portinfo>
+#include <Python.h>
+
+#include "misc.h"
+#include "analytical_model.h"
+#include "geo_shape.h"
+#include "iq.h"
+
+// copyright
+
+char pyanalmodelpy_copyright__doc__[] = "";
+char pyanalmodelpy_copyright__name__[] = "copyright";
+
+static char pyanalmodelpy_copyright_note[] = 
+    "analmodelpy python module: Copyright (c) 1998-2005 Michael A.G. Aivazis";
+
+
+PyObject * pyanalmodelpy_copyright(PyObject *, PyObject *)
+{
+    return Py_BuildValue("s", pyanalmodelpy_copyright_note);
+}
+
+//extern char pyanalmodelpy_GetRadius__name__[] = "";
+//extern char pyanalmodelpy_GetRadius__doc__[] = "GetRadius";
+//PyObject * pyanalmodelpy_GetRadius(PyObject *, PyObject *args){
+//  double r = Sphere::GetRadius();
+//  
+//  return PyBuildValue("d", r);
+//}
+
+
+    
+// analytical_model class constructor  AnalyticalModel(Sphere &)
+
+char pyanalmodelpy_new_analmodel__doc__[] = "";
+char pyanalmodelpy_new_analmodel__name__[] = "new_analmodel";
+
+PyObject * pyanalmodelpy_new_analmodel(PyObject *, PyObject *args)
+{
+  PyObject *pyshape = 0;
+  int ok = PyArg_ParseTuple(args, "O", &pyshape);
+  if(!ok) return NULL;
+
+  void *temp = PyCObject_AsVoidPtr(pyshape);
+
+  GeoShape *shape = static_cast<GeoShape *>(temp);
+
+  AnalyticalModel *newanal = new AnalyticalModel(*shape);
+
+  return PyCObject_FromVoidPtr(newanal, NULL);
+}
+
+//AnalyticalModel method: CalculateIQ(IQ *)
+char pyanalmodelpy_CalculateIQ__doc__[] = "";
+char pyanalmodelpy_CalculateIQ__name__[] = "CalculateIQ";
+
+PyObject * pyanalmodelpy_CalculateIQ(PyObject *, PyObject *args)
+{
+  PyObject *pyanal = 0, *pyiq = 0;
+  int ok = PyArg_ParseTuple(args, "OO", &pyanal, &pyiq);
+  if(!ok) return NULL;
+                                                                 
+  void *temp = PyCObject_AsVoidPtr(pyanal);
+  void *temp2 = PyCObject_AsVoidPtr(pyiq);
+                                         
+  AnalyticalModel * thisanal = static_cast<AnalyticalModel *>(temp);
+  IQ * thisiq = static_cast<IQ *>(temp2);
+
+  thisanal->CalculateIQ(thisiq);
+                        
+  return Py_BuildValue("i",0);
+
+}
+    
+// version
+// $Id$
+
+// End of file
Index: realSpaceModeling/analmodelpy/analmodelpymodule/misc.h
===================================================================
--- realSpaceModeling/analmodelpy/analmodelpymodule/misc.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/analmodelpymodule/misc.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//                               Michael A.G. Aivazis
+//                        California Institute of Technology
+//                        (C) 1998-2005  All Rights Reserved
+// 
+//  <LicenseText>
+// 
+//  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#if !defined(pyanalmodelpy_misc_h)
+#define pyanalmodelpy_misc_h
+
+// copyright
+extern char pyanalmodelpy_copyright__name__[];
+extern char pyanalmodelpy_copyright__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_copyright(PyObject *, PyObject *);
+
+extern char pyanalmodelpy_GetRadius__name__[];
+extern char pyanalmodelpy_GetRadius__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_GetRadius(PyObject *, PyObject *);
+
+
+// Analytical Model constructor
+extern char pyanalmodelpy_new_analmodel__name__[];
+extern char pyanalmodelpy_new_analmodel__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_new_analmodel(PyObject *, PyObject *);
+
+// AnalyticalModel method: CalculateIQ(IQ *)
+extern char pyanalmodelpy_CalculateIQ__name__[];
+extern char pyanalmodelpy_CalculateIQ__doc__[];
+extern "C"
+PyObject * pyanalmodelpy_CalculateIQ(PyObject *, PyObject *);
+
+
+#endif
+
+// version
+// $Id$
+
+// End of file
Index: realSpaceModeling/analmodelpy/examples/Make.mm
===================================================================
--- realSpaceModeling/analmodelpy/examples/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/examples/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,32 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+PROJECT = analmodelpy
+PACKAGE = examples
+
+#--------------------------------------------------------------------------
+#
+
+all: clean
+
+release: clean
+	cvs release .
+
+update: clean
+	cvs update .
+
+
+# version
+# $Id$
+
+# End of file
Index: realSpaceModeling/analmodelpy/libanalmodelpy/Make.mm
===================================================================
--- realSpaceModeling/analmodelpy/libanalmodelpy/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/libanalmodelpy/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,66 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+include local.def
+
+PROJECT = analmodelpy
+PACKAGE = libanalmodelpy
+
+PROJ_SAR = $(BLD_LIBDIR)/$(PACKAGE).$(EXT_SAR)
+PROJ_DLL = $(BLD_BINDIR)/$(PACKAGE).$(EXT_SO)
+PROJ_TMPDIR = $(BLD_TMPDIR)/$(PROJECT)/$(PACKAGE)
+PROJ_CLEAN += $(PROJ_SAR) $(PROJ_DLL)
+PROJ_LIBRARIES = -lgeoshpespy -liqPy
+#PROJ_LIBRARIES = -L/home/jingz1/dv/tools/pythia-0.8/lib -lgeoshpespy -liqPy
+
+PROJ_SRCS = \
+    analytical_model.cc
+    
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# build the library
+
+all: $(PROJ_SAR) export
+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ifeq (Win32, ${findstring Win32, $(PLATFORM_ID)})
+
+# build the shared object
+$(PROJ_SAR): product_dirs $(PROJ_OBJS)
+	$(CXX) $(LCXXFLAGS) -o $(PROJ_DLL) \
+	-Wl,--out-implib=$(PROJ_SAR) $(PROJ_OBJS)
+
+# export
+export:: export-headers export-libraries export-binaries
+
+else
+
+# build the shared object
+$(PROJ_SAR): product_dirs $(PROJ_OBJS)
+	$(CXX) $(LCXXFLAGS) -o $(PROJ_SAR) $(PROJ_OBJS) $(PROJ_LIBRARIES)
+
+# export
+export:: export-headers export-libraries
+
+endif
+
+EXPORT_HEADERS = \
+    analytical_model.h  \
+    sans_model.h
+
+EXPORT_LIBS = $(PROJ_SAR)
+EXPORT_BINS = $(PROJ_DLL)
+
+# version
+# $Id$
+
+#
+# End of file
Index: realSpaceModeling/analmodelpy/libanalmodelpy/analytical_model.cc
===================================================================
--- realSpaceModeling/analmodelpy/libanalmodelpy/analytical_model.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/libanalmodelpy/analytical_model.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,29 @@
+/** \file analytical_model.cc  */
+
+#include "sphere.h"
+#include "hollow_sphere.h"
+#include "analytical_model.h"
+
+AnalyticalModel::AnalyticalModel(const GeoShape &geo_shape)
+{
+  switch (geo_shape.GetShapeType()){
+    case SPHERE:
+      shape_ = new Sphere(static_cast<const Sphere&>(geo_shape));
+      break;
+    case HOLLOWSPHERE:
+      shape_ = new HollowSphere(static_cast<const HollowSphere&>(geo_shape));
+      break;
+    case CYLINDER:
+      break;
+  }
+}
+
+AnalyticalModel::~AnalyticalModel() 
+{
+  if (shape_ != NULL) delete shape_;
+}
+
+void AnalyticalModel::CalculateIQ(IQ * iq)
+{
+  shape_->GetFormFactor(iq);
+}
Index: realSpaceModeling/analmodelpy/libanalmodelpy/analytical_model.h
===================================================================
--- realSpaceModeling/analmodelpy/libanalmodelpy/analytical_model.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/libanalmodelpy/analytical_model.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,23 @@
+/** \file analytical_model.h class AnalyticalModel:SANSModel */
+
+#ifndef ANALYTICALMODEL_H
+#define ANALYTICALMODEL_H
+
+#include "sans_model.h"
+#include "geo_shape.h"
+#include "iq.h"
+
+class AnalyticalModel : public SANSModel{
+
+ public:
+  AnalyticalModel(const GeoShape &);
+  ~AnalyticalModel();
+
+  void CalculateIQ(IQ *);
+
+ private:
+  AnalyticalModel();
+  GeoShape *shape_;
+};
+
+#endif
Index: realSpaceModeling/analmodelpy/libanalmodelpy/local.def
===================================================================
--- realSpaceModeling/analmodelpy/libanalmodelpy/local.def	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/libanalmodelpy/local.def	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,31 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+#
+# Local (project) definitions
+#
+
+# C++
+
+PROJ_CXX_INCLUDES += ../../iqPy/libiqPy/tnt   \
+		     ../../iqPy/libiqPy     \
+		     ../../geoshapespy/libgeoshapespy  \
+		     ../../pointsmodelpy/libpointsmodelpy 
+
+    PROJ_CXX_FLAGS += $(CXX_SOFLAGS)
+    PROJ_LCXX_FLAGS += $(LCXX_SARFLAGS)
+
+# version
+# $Id$
+
+# End of file
Index: realSpaceModeling/analmodelpy/libanalmodelpy/sans_model.h
===================================================================
--- realSpaceModeling/analmodelpy/libanalmodelpy/sans_model.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/libanalmodelpy/sans_model.h	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,15 @@
+/** \file sans_model.h    class SANSModel virtual base class */
+
+#ifndef SANSMODEL_H
+#define SANSMODEL_H
+
+#include "iq.h"
+
+class SANSModel{
+ public:
+
+  virtual void CalculateIQ(IQ *iq) = 0;
+
+};
+
+#endif
Index: realSpaceModeling/analmodelpy/tests/Make.mm
===================================================================
--- realSpaceModeling/analmodelpy/tests/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/tests/Make.mm	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,52 @@
+# -*- Makefile -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+#
+# <LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PROJ_CXX_INCLUDES += ../../iqPy/libiqPy    \
+		     ../../iqPy/libiqPy/tnt  \
+		     ../libanalmodelpy    \
+		     ../../geoshapespy/libgeoshapespy
+
+PROJECT = SANSsimulation
+PACKAGE = tests
+
+PROJ_CLEAN += $(PROJ_CPPTESTS)
+
+PROJ_PYTESTS = testanal_model.py
+PROJ_CPPTESTS = testanalytical_model
+PROJ_TESTS = $(PROJ_PYTESTS) $(PROJ_CPPTESTS)
+PROJ_LIBRARIES = -L$(BLD_LIBDIR) -lanalmodelpy -liqPy -lgeoshapespy
+
+
+#--------------------------------------------------------------------------
+#
+
+all: $(PROJ_TESTS)
+
+test:
+	for test in $(PROJ_TESTS) ; do $${test}; done
+
+release: tidy
+	cvs release .
+
+update: clean
+	cvs update .
+
+#--------------------------------------------------------------------------
+#
+
+testanalytical_model: testanalytical_model.cc $(BLD_LIBDIR)/libanalmodelpy.$(EXT_SAR)
+	$(CXX) $(CXXFLAGS) $(LCXXFLAGS) -o $@ testanalytical_model.cc $(PROJ_LIBRARIES) 
+
+# version
+# $Id$
+
+# End of file
Index: realSpaceModeling/analmodelpy/tests/signon.py
===================================================================
--- realSpaceModeling/analmodelpy/tests/signon.py	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/tests/signon.py	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+# 
+#  <LicenseText>
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+
+if __name__ == "__main__":
+
+    import analmodelpy
+    from analmodelpy import analmodelpy as analmodelpymodule
+
+    print "copyright information:"
+    print "   ", analmodelpy.copyright()
+    print "   ", analmodelpymodule.copyright()
+
+    print
+    print "module information:"
+    print "    file:", analmodelpymodule.__file__
+    print "    doc:", analmodelpymodule.__doc__
+    print "    contents:", dir(analmodelpymodule)
+
+    print
+    print analmodelpymodule.hello()
+
+# version
+__id__ = "$Id$"
+
+#  End of file 
Index: realSpaceModeling/analmodelpy/tests/testanal_model.py
===================================================================
--- realSpaceModeling/analmodelpy/tests/testanal_model.py	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/tests/testanal_model.py	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+#                               Michael A.G. Aivazis
+#                        California Institute of Technology
+#                        (C) 1998-2005  All Rights Reserved
+# 
+#  <LicenseText>
+# 
+#  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# 
+
+if __name__ == "__main__":
+
+    from SANSsimulation import analmodelpy as analmodelpymodule
+    from SANSsimulation import iqPy
+    from SANSsimulation import geoshapespy
+
+    print "copyright information:"
+    print "   ", analmodelpymodule.copyright()
+
+    print
+    print "module information:"
+    print "    file:", analmodelpymodule.__file__
+    print "    doc:", analmodelpymodule.__doc__
+    print "    contents:", dir(analmodelpymodule)
+
+    a = geoshapespy.new_sphere(1.0)
+    iq = iqPy.new_iq(10,0.001, 0.3)
+    anal = analmodelpymodule.new_analmodel(a)
+    analmodelpymodule.CalculateIQ(anal,iq)
+    iqPy.OutputIQ(iq,"out.iq")
+
+
+
+
+# version
+__id__ = "$Id$"
+
+#  End of file 
Index: realSpaceModeling/analmodelpy/tests/testanalytical_model.cc
===================================================================
--- realSpaceModeling/analmodelpy/tests/testanalytical_model.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
+++ realSpaceModeling/analmodelpy/tests/testanalytical_model.cc	(revision f2d6445700c382c6d6dc62bc2017ea43391f7e0d)
@@ -0,0 +1,22 @@
+#include <cassert>
+#include <iostream>
+#include "analytical_model.h"
+#include "sphere.h"
+
+using namespace std;
+
+void TestAnalyticalModel() {
+  Sphere sphere(1.0);
+  AnalyticalModel am(sphere);
+
+  IQ iq1(10,0.001, 0.3);
+  am.CalculateIQ(&iq1);
+
+  for (int i = 0; i < iq1.iq_data.dim1(); ++i)
+    cout << iq1.iq_data[i][0]<< " " << iq1.iq_data[i][1] <<endl;  
+}
+
+int main(){
+  TestAnalyticalModel();
+  printf("PASS.\n");
+}
