33 #ifndef __H__UG__LIB_DISC__FUNCTION_SPACE__ADAPTION_SURFACE_GRID_FUNCTION_IMPL__
34 #define __H__UG__LIB_DISC__FUNCTION_SPACE__ADAPTION_SURFACE_GRID_FUNCTION_IMPL__
40 #define GFUNCADAPT_PROFILE_FUNC() PROFILE_FUNC_GROUP("gfunc-adapt")
45 template <
typename TDomain>
46 template <
typename TElem,
typename TAlgebra>
50 std::vector<DoFIndex> vInd;
51 const size_t numFct = m_spDDInfo->num_fct();
53 std::vector<std::vector<number> >& vvVal = m_aaValue[elem];
56 for(
size_t fct = 0; fct < numFct; ++fct){
58 std::vector<number>& vVal = vvVal[fct];
61 vVal.resize(vInd.size());
62 for(
size_t i = 0; i < vInd.size(); ++i)
63 vVal[i] =
DoFRef(rSurfaceFct, vInd[i]);
67 template <
typename TDomain>
68 template <
typename TElem,
typename TAlgebra>
78 for( ; iter != iterEnd; ++iter){
84 copy_from_surface(rSurfaceFct, elem);
88 template <
typename TDomain>
89 template <
typename TAlgebra>
96 if(rSurfaceFct.
max_dofs(
VERTEX))copy_from_surface<Vertex,TAlgebra>(rSurfaceFct);
97 if(rSurfaceFct.
max_dofs(
EDGE)) copy_from_surface<Edge,TAlgebra>(rSurfaceFct);
98 if(rSurfaceFct.
max_dofs(
FACE)) copy_from_surface<Face,TAlgebra>(rSurfaceFct);
99 if(rSurfaceFct.
max_dofs(
VOLUME))copy_from_surface<Volume,TAlgebra>(rSurfaceFct);
102 m_ParallelStorageType = rSurfaceFct.get_storage_mask();
110 template <
typename TDomain>
111 template <
typename TElem,
typename TAlgebra>
115 std::vector<DoFIndex> vInd;
116 const std::vector<std::vector<number> >& vvVal = m_aaValue[elem];
118 UG_ASSERT(vvVal.size() == m_spDDInfo->num_fct(),
"Array says numFct: "<<
119 vvVal.size()<<
", but should be "<<m_spDDInfo->num_fct()<<
" on "
122 for(
size_t fct = 0; fct < vvVal.size(); ++fct){
124 const std::vector<number>& vVal = vvVal[fct];
127 UG_ASSERT(vVal.size() == vInd.size(),
"Stored dofs are "<<vVal.size()<<
128 ", but fct "<<fct<<
" has "<<vInd.size()<<
" dofs on "<<
129 elem->reference_object_id())
131 for(
size_t i = 0; i < vInd.size(); ++i){
133 "Bad dof-index encountered on: "
135 DoFRef(rSurfaceFct, vInd[i]) = vVal[i];
140 template <
typename TDomain>
141 template <
typename TElem,
typename TAlgebra>
152 for( ; iter != iterEnd; ++iter)
156 copy_to_surface(rSurfaceFct, elem);
160 template <
typename TDomain>
161 template <
typename TAlgebra>
166 if(rSurfaceFct.
max_dofs(
VERTEX))copy_to_surface<Vertex,TAlgebra>(rSurfaceFct);
167 if(rSurfaceFct.
max_dofs(
EDGE)) copy_to_surface<Edge,TAlgebra>(rSurfaceFct);
168 if(rSurfaceFct.
max_dofs(
FACE)) copy_to_surface<Face,TAlgebra>(rSurfaceFct);
169 if(rSurfaceFct.
max_dofs(
VOLUME))copy_to_surface<Volume,TAlgebra>(rSurfaceFct);
172 rSurfaceFct.set_storage_type(m_ParallelStorageType);
179 template <
typename TDomain>
180 template <
typename TBaseElem>
184 std::vector<std::vector<number> >& vvVal = m_aaValue[elem];
187 vvVal.resize(m_spDDInfo->num_fct());
191 const int si = m_spDomain->subset_handler()->get_subset_index(elem);
194 for(
size_t fct = 0; fct < vvVal.size(); ++fct){
195 vvVal[fct].resize(m_spDDInfo->num_fct_dofs(fct, roid, si));
#define GFUNCADAPT_PROFILE_FUNC()
Definition: adaption_surface_grid_function_impl.h:40
Definition: smart_pointer.h:296
void copy_to_surface(GridFunction< TDomain, TAlgebra > &rSurfaceFct)
Definition: adaption_surface_grid_function_impl.h:163
void obj_created(TBaseElem *elem)
creates storage when object created
Definition: adaption_surface_grid_function_impl.h:181
void copy_from_surface(const GridFunction< TDomain, TAlgebra > &rSurfaceFct)
Definition: adaption_surface_grid_function_impl.h:91
size_t max_dofs(const int dim) const
returns the maximum number of dofs on grid objects in a dimension
Definition: dof_distribution_info.h:231
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
SmartPtr< TDomain > domain()
returns domain
Definition: grid_function.h:342
size_t inner_dof_indices(TElem *elem, size_t fct, std::vector< DoFIndex > &ind, bool bClear=true) const
get multi indices on an geometric object in canonical order
Definition: grid_function.h:327
SmartPtr< DoFDistribution > dof_distribution()
Definition: grid_function.h:236
SmartPtr< ApproximationSpace< TDomain > > approx_space()
returns approx space
Definition: grid_function.h:348
@ ALL
Definition: surface_view.h:102
std::string ElementDebugInfo(const Grid &grid, GridObject *e)
Returns a string containing information on the given element.
Definition: debug_util.cpp:991
base_type::TBaseElem TBaseElem
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition: multi_index.h:276
@ VOLUME
Definition: grid_base_objects.h:63
@ VERTEX
Definition: grid_base_objects.h:60
@ EDGE
Definition: grid_base_objects.h:61
@ FACE
Definition: grid_base_objects.h:62