00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef SUNDANCE_STDFWKEVALMEDIATOR_H
00032 #define SUNDANCE_STDFWKEVALMEDIATOR_H
00033
00034 #include "SundanceDefs.hpp"
00035 #include "SundanceMesh.hpp"
00036 #include "SundanceAbstractEvalMediator.hpp"
00037 #include "SundanceCellJacobianBatch.hpp"
00038 #include "SundanceIntegralGroup.hpp"
00039 #include "SundanceObjectWithVerbosity.hpp"
00040 #include "SundanceDiscreteFunction.hpp"
00041
00042
00043 namespace Sundance
00044 {
00045 using namespace Teuchos;
00046
00047
00048
00049
00050
00051
00052
00053 class StdFwkEvalMediator : public AbstractEvalMediator,
00054 public Playa::Printable
00055 {
00056 public:
00057
00058 StdFwkEvalMediator(const Mesh& mesh, int cellDim);
00059
00060
00061 virtual ~StdFwkEvalMediator(){;}
00062
00063
00064 void setCellBatch(const RCP<const Array<int> >& cellLID);
00065
00066
00067 void setIntegrationSpec(IntegrationCellSpecifier intCellSpec);
00068
00069
00070
00071 virtual void setCellType(const CellType& cellType,
00072 const CellType& maxCellType,
00073 bool isInternalBdry) ;
00074
00075
00076
00077
00078
00079
00080 const CellJacobianBatch& JVol() const {return *JVol_;}
00081
00082
00083 const CellJacobianBatch& JTrans() const ;
00084
00085
00086
00087
00088
00089 const Array<int>& facetIndices() const {return *facetIndices_;}
00090
00091
00092 const Array<int>& maxCellLIDs() const {return *maxCellLIDs_;}
00093
00094
00095 int cellDim() const {return cellDim_;}
00096
00097
00098 int maxCellDim() const {return mesh_.spatialDim();}
00099
00100
00101 const CellType& cellType() const {return cellType_;}
00102
00103
00104 const CellType& maxCellType() const {return maxCellType_;}
00105
00106
00107 const RCP<const Array<int> >& cellLID() const {return cellLID_;}
00108
00109
00110 const RCP<Array<int> >& cofacetCellLID() const {return maxCellLIDs_;}
00111
00112
00113 IntegrationCellSpecifier integrationCellSpec() const {return intCellSpec_;}
00114
00115
00116 bool cofacetCellsAreReady() const {return cofacetCellsAreReady_;}
00117
00118
00119 bool isInternalBdry() const {return isInternalBdry_;}
00120
00121
00122 bool forbidCofacetIntegrations() const
00123 {return forbidCofacetIntegrations_;}
00124
00125
00126 protected:
00127 const Mesh& mesh() const {return mesh_;}
00128
00129 Mesh& mesh() {return mesh_;}
00130
00131 bool& cacheIsValid() const {return cacheIsValid_;}
00132
00133
00134 void setupFacetTransformations() const ;
00135
00136
00137 Map<const DiscreteFunctionData*, RCP<Array<Array<double> > > >& fCache() const {return fCache_;}
00138
00139 Map<const DiscreteFunctionData*, RCP<Array<Array<double> > > >& dfCache() const {return dfCache_;}
00140
00141 Map<const DiscreteFunctionData*, RCP<Array<Array<double> > > >& localValueCache() const {return localValueCache_;}
00142
00143
00144 Map<const DiscreteFunctionData*, RCP<const MapStructure> >& mapStructCache() const
00145 {return mapStructCache_;}
00146
00147
00148 Map<const DiscreteFunctionData*, bool>& fCacheIsValid() const {return fCacheIsValid_;}
00149
00150 Map<const DiscreteFunctionData*, bool>& dfCacheIsValid() const {return dfCacheIsValid_;}
00151
00152 Map<const DiscreteFunctionData*, bool>& localValueCacheIsValid() const {return localValueCacheIsValid_;}
00153
00154 private:
00155 Mesh mesh_;
00156
00157 int cellDim_;
00158
00159 CellType cellType_;
00160
00161 CellType maxCellType_;
00162
00163 bool isInternalBdry_;
00164
00165 bool forbidCofacetIntegrations_;
00166
00167 RCP<const Array<int> > cellLID_;
00168
00169 mutable IntegrationCellSpecifier intCellSpec_;
00170
00171 mutable RCP<CellJacobianBatch> JVol_;
00172
00173 mutable RCP<CellJacobianBatch> JTrans_;
00174
00175 mutable RCP<Array<int> > facetIndices_;
00176
00177 mutable RCP<Array<int> > maxCellLIDs_;
00178
00179 mutable bool cofacetCellsAreReady_;
00180
00181 mutable bool cacheIsValid_;
00182
00183 mutable bool jCacheIsValid_;
00184
00185
00186
00187
00188 mutable Map<const DiscreteFunctionData*, RCP<Array<Array<double> > > > fCache_;
00189
00190 mutable Map<const DiscreteFunctionData*, RCP<Array<Array<double> > > > dfCache_;
00191
00192 mutable Map<const DiscreteFunctionData*, RCP<Array<Array<double> > > > localValueCache_;
00193
00194 mutable Map<const DiscreteFunctionData*, RCP<const MapStructure> > mapStructCache_;
00195
00196
00197 mutable Map<const DiscreteFunctionData*, bool> fCacheIsValid_;
00198
00199 mutable Map<const DiscreteFunctionData*, bool> dfCacheIsValid_;
00200
00201 mutable Map<const DiscreteFunctionData*, bool> localValueCacheIsValid_;
00202
00203 };
00204 }
00205
00206
00207 #endif