diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.H b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.H
index 889076a1ee2453815ff188822829bd182ff801fa..36e34728356902bd958b4958660cf1e68973f34f 100644
--- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.H
+++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.H
@@ -131,6 +131,15 @@ public:
             scalarField& weights
         ) const = 0;
 
+        //- Helper: weighted sum
+        template<class ListType1, class ListType2>
+        static typename outerProduct
+        <
+            typename ListType1::value_type,
+            typename ListType2::value_type
+        >::type
+        weightedSum(const ListType1& f1, const ListType2& f2);
+
 };
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -139,6 +148,12 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
+#ifdef NoRepository
+#   include "interpolationWeightsTemplates.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
 #endif
 
 // ************************************************************************* //
diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeightsTemplates.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeightsTemplates.C
index aac670138d9a033a745161ddc34537008b340f58..9050921b9e59214a2d8cce18205faa645e2f0368 100644
--- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeightsTemplates.C
+++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeightsTemplates.C
@@ -36,135 +36,38 @@ namespace Foam
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-//template<class GeoField>
-//void interpolationWeights::readFields
-//(
-//    const word& fieldName,
-//    const typename GeoField::Mesh& mesh,
-//    const wordList& timeNames,
-//    objectRegistry& fieldsCache
-//)
-//{
-//    // Collect all times that are no longer used
-//    {
-//        HashSet<word> usedTimes(timeNames);
-//
-//        DynamicList<word> unusedTimes(fieldsCache.size());
-//
-//        forAllIter(objectRegistry, fieldsCache, timeIter)
-//        {
-//            const word& tm = timeIter.key();
-//            if (!usedTimes.found(tm))
-//            {
-//                unusedTimes.append(tm);
-//            }
-//        }
-//
-//        //Info<< "Unloading times " << unusedTimes << endl;
-//
-//        forAll(unusedTimes, i)
-//        {
-//            objectRegistry& timeCache = const_cast<objectRegistry&>
-//            (
-//                fieldsCache.lookupObject<objectRegistry>(unusedTimes[i])
-//            );
-//            fieldsCache.checkOut(timeCache);
-//        }
-//    }
-//
-//
-//    // Load any new fields
-//    forAll(timeNames, i)
-//    {
-//        const word& tm = timeNames[i];
-//
-//        // Create if not found
-//        if (!fieldsCache.found(tm))
-//        {
-//            //Info<< "Creating registry for time " << tm << endl;
-//
-//            // Create objectRegistry if not found
-//            objectRegistry* timeCachePtr = new objectRegistry
-//            (
-//                IOobject
-//                (
-//                    tm,
-//                    tm,
-//                    fieldsCache,
-//                    IOobject::NO_READ,
-//                    IOobject::NO_WRITE
-//                )
-//            );
-//            timeCachePtr->store();
-//        }
-//
-//        // Obtain cache for current time
-//        const objectRegistry& timeCache =
-//            fieldsCache.lookupObject<objectRegistry>
-//            (
-//                tm
-//            );
-//
-//        // Store field if not found
-//        if (!timeCache.found(fieldName))
-//        {
-//            //Info<< "Loading field " << fieldName
-//            //    << " for time " << tm << endl;
-//
-//            GeoField loadedFld
-//            (
-//                IOobject
-//                (
-//                    fieldName,
-//                    tm,
-//                    mesh.thisDb(),
-//                    IOobject::MUST_READ,
-//                    IOobject::NO_WRITE,
-//                    false
-//                ),
-//                mesh
-//            );
-//
-//            // Transfer to timeCache (new objectRegistry and store flag)
-//            GeoField* fldPtr = new GeoField
-//            (
-//                IOobject
-//                (
-//                    fieldName,
-//                    tm,
-//                    timeCache,
-//                    IOobject::NO_READ,
-//                    IOobject::NO_WRITE
-//                ),
-//                loadedFld
-//            );
-//            fldPtr->store();
-//        }
-//    }
-//}
-//
-//
-//template<class GeoField>
-//void interpolationWeights::readFields
-//(
-//    const word& fieldName,
-//    const typename GeoField::Mesh& mesh,
-//    const wordList& timeNames,
-//    const word& registryName
-//)
-//{
-//    readFields<GeoField>
-//    (
-//        fieldName,
-//        mesh,
-//        timeNames,
-//        //registry(mesh.thisDb(), registryName)
-//        const_cast<objectRegistry&>
-//        (
-//            mesh.thisDb().subRegistry(registryName, true)
-//        )
-//    );
-//}
+template<class ListType1, class ListType2>
+typename Foam::outerProduct
+<
+    typename ListType1::value_type,
+    typename ListType2::value_type
+>::type
+Foam::interpolationWeights::weightedSum
+(
+    const ListType1& f1,
+    const ListType2& f2
+)
+{
+    typedef typename outerProduct
+    <
+        typename ListType1::value_type,
+        typename ListType2::value_type
+    >::type returnType;
+
+    if (f1.size())
+    {
+        returnType SumProd = f1[0]*f2[0];
+        for (label i = 1; i < f1.size(); ++i)
+        {
+            SumProd += f1[i]*f2[i];
+        }
+        return SumProd;
+    }
+    else
+    {
+        return pTraits<returnType>::zero;
+    }
+}
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //