33 #ifndef __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FVCR__CGRAD_CONSTRAINT_H_
34 #define __H__UG__PLUGINS__NAVIER_STOKES__INCOMPRESSIBLE__FVCR__CGRAD_CONSTRAINT_H_
41 template <
int dim>
struct face_type_traits
47 template <>
struct face_type_traits<1>
53 template <>
struct face_type_traits<2>
59 template <>
struct face_type_traits<3>
70 template<
typename s
ide_type,
typename secure_container,
typename TGr
idFunction>
72 size_t nOfSides = sides.size();
79 typedef typename TGridFunction::domain_type domain_type;
83 std::vector<MultiIndex<2> > seMultInd;
84 for (
size_t i=0;i<nOfSides;i++){
87 if (cEdge==NULL)
continue;
93 if (cFace==NULL)
continue;
96 for (
size_t k=0;k<nc;k++){
99 u.inner_dof_indices(edge,fct,seMultInd);
102 u.inner_dof_indices(face,fct,seMultInd);
104 for(
size_t j=nOfSides;j<multInd.size();j++){
105 if (multInd[j][0]==seMultInd[0][0]){
106 if (
dim==2) sides.push_back(
dynamic_cast<side_type*
>(edge));
107 else sides.push_back(
dynamic_cast<side_type*
>(face));
115 template <
typename TGr
idFunction,
typename s
ide_type,
typename constraining_s
ide_type,
typename VType>
118 typedef typename TGridFunction::domain_type domain_type;
122 typedef typename TGridFunction::template traits<constraining_side_type>::const_iterator cSideIterator;
124 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object elem_type;
125 domain_type& domain = *m_uInfo->domain().
get();
130 for( ;cSideIter !=cSideIterEnd; ++cSideIter){
131 constraining_side_type* cSide = *cSideIter;
132 typename grid_type::template traits<elem_type>::secure_container assoElements;
133 typedef typename grid_type::template traits<side_type>::secure_container side_secure_container;
134 side_secure_container sides;
136 domain.grid()->associated_elements(assoElements, cSide);
137 elem_type* elem = assoElements[0];
138 domain.grid()->associated_elements_sorted(sides, elem);
139 std::vector<DoFIndex> ind;
140 m_uInfo->dof_indices(elem,0,ind,
true,
true);
141 get_constrained_sides_cr<side_type,side_secure_container,TGridFunction>(sides,*m_uInfo,ind);
142 elem = assoElements[0];
143 std::vector<MathVector<dim> > vCorner;
145 geo.
update_hanging(elem, &(vCorner[0]), domain.subset_handler().get());
148 const size_t index = cd.index();
149 if (
dynamic_cast<side_type*
>(sides[index])!=
dynamic_cast<side_type*
>(*cSideIter))
continue;
150 aaData[sides[index]]*=0;
151 for (
size_t j=0;j<cd.num_constraining_dofs();j++){
153 size_t cdIndex = cd.constraining_dofs_index(j);
154 localValue = aaData[sides[cdIndex]];
155 localValue *= cd.constraining_dofs_weight(j);
156 aaData[sides[index]] += localValue;
163 template <
typename TGr
idFunction>
167 typedef typename TGridFunction::domain_type
TDomain;
168 typedef typename TGridFunction::algebra_type
TAlgebra;
192 typedef typename TGridFunction::template dim_traits<dim>::grid_base_object
elem_type;
198 typedef typename TGridFunction::template dim_traits<dim>::const_iterator
ElemIterator;
201 typedef typename TGridFunction::template traits<side_type>::const_iterator
SideIterator;
214 typedef std::vector<std::vector<std::pair<DoFIndex, MathVector<dim> > > >
vvIndexPosPair;
254 void init(
SmartPtr<TGridFunction> u,
bool bLinUpConvDefect,
bool bLinUpConvJacobian,
bool bLinPressureDefect,
bool bLinPressureJacobian,
bool bAdaptive,
bool bLimiter){
268 grid.template attach_to<side_type>(
aGrad);
269 grid.template attach_to<side_type>(
aVol);
296 init(u,
true,
false,
true,
false,
false,
false);
300 init(u,bLinUpConvDefect,bLinUpConvJacobian,bLinPressureDefect,bLinPressureJacobian,bAdaptive,
false);
304 init(u,bLinUpConvDefect,bLinUpConvJacobian,bLinPressureDefect,bLinPressureJacobian,bAdaptive,bLimiter);
308 init(u,bLinUpConvDefect,bLinUpConvJacobian,bLinPressureDefect,bLinPressureJacobian,bAdaptive,
false);
313 bool bAdaptive,
bool bLimiter,
const char* subsets){
314 init(u,bLinUpConvDefect,bLinUpConvJacobian,bLinPressureDefect,bLinPressureJacobian,bAdaptive,bLimiter);
321 bool zeroGradBndElem(
typename grid_type::template traits<side_type>::secure_container sides){
322 for (
size_t i=0;i<sides.size();i++){
334 std::vector<DoFIndex> multInd;
338 typename grid_type::template traits<side_type>::secure_container sides;
339 std::vector<MathVector<dim> > vCorner;
340 std::vector<DoFIndex> ind;
348 for(
int si = 0; si < domain.subset_handler()->
num_subsets(); ++si)
352 for( ;iter !=iterEnd; ++iter)
360 for(
int si = 0; si < domain.subset_handler()->
num_subsets(); ++si)
366 for( ;iter !=iterEnd; ++iter)
372 m_grid->associated_elements_sorted(sides, elem );
381 geo.
update(elem, &(vCorner[0]), domain.subset_handler().get());
387 typename grid_type::template traits<side_type>::secure_container sides;
389 UG_ASSERT(
dynamic_cast<elem_type*
>(elem) != NULL,
"Only elements of type elem_type are currently supported");
391 domain.grid()->associated_elements_sorted(sides,
static_cast<elem_type*
>(elem) );
393 size_t nofsides = geo.
num_scv();
395 m_u->dof_indices(elem,0,ind);
398 for (
size_t s=0;
s < nofsides;
s++)
405 size_t currentInd =
acGradSh[localside].size();
408 acGradSh[localside].resize(nofsides);
414 acGradSh[localside].resize(currentInd+nofsides-1);
415 acGradShInd[localside].resize(currentInd+nofsides-1);
421 for (
size_t sh=0;sh < nofsides;sh++)
424 for (
int d0=0;d0<
dim;d0++){
429 for (
int d0=0;d0<
dim;d0++){
445 for(
int si = 0; si < domain.subset_handler()->num_subsets(); ++si)
449 for( ;sideIter !=sideIterEnd; sideIter++)
456 for (
size_t i=0;i<
acGradSh[side].size();i++){
475 std::vector<DoFIndex> multInd;
479 typename grid_type::template traits<side_type>::secure_container sides;
480 std::vector<MathVector<dim> > vCorner;
481 std::vector<DoFIndex> ind;
491 for(
int si = 0; si < domain.subset_handler()->
num_subsets(); ++si)
498 for( ;iter !=iterEnd; ++iter)
504 m_grid->associated_elements_sorted(sides, elem );
515 geo.
update(elem, &(vCorner[0]), domain.subset_handler().get());
523 m_u->dof_indices(elem,0,ind);
525 for(
size_t ip = 0; ip < geo.
num_scvf(); ++ip)
529 for(
int d1 = 0; d1 <
dim; ++d1){
530 dd->dof_indices(elem,0,ind);
531 for(
size_t sh = 0; sh < sides.size(); ++sh){
532 localInd[0]=ind[sh][0]+d1;
533 StdVel[ip][d1] +=
DoFRef(u,localInd) * scvf.
shape(sh);
537 for(
size_t ip = 0; ip < geo.
num_scvf(); ++ip){
550 for (
int d0=0;d0<
dim;d0++){
552 for (
size_t sh=0;sh<shapeSize;sh++){
553 for (
int d1=0;d1<
dim;d1++){
555 localInd[0]=ind[scvf.
from()][0]+d0;
557 DoFRef(J,localInd,shapeInd)+= flux;
558 localInd[0]=ind[scvf.
to()][0]+d0;
559 DoFRef(J,localInd,shapeInd)-= flux;
570 m_grid->associated_elements_sorted(sides, elem );
576 const number elemSize = ElementSize<dim>(roid, &vCorner[0]);
578 typename grid_type::template traits<elem_type>::secure_container assoElements;
580 std::vector<DoFIndex> elemInd(sides.size()+1);
582 dd->inner_dof_indices(elem,
_P_,ind);
587 size_t gradShapesSize = 1;
592 for (
int sh=0;sh<2*
dim+1;sh++)
for (
int d0=0;d0<
dim;d0++) gradShapes[sh][d0]=0;
594 for (
size_t s=0;
s<sides.size();
s++){
595 m_grid->associated_elements(assoElements,sides[
s]);
597 size_t numOfAsso = assoElements.size();
600 for (
int d=0;d<
dim;d++) gradShapes[0][d]+=scv.
normal()[d];
603 for (
size_t i=0;i<numOfAsso;i++){
604 dd->inner_dof_indices(assoElements[i],
_P_,ind);
606 if (assoElements[i]!=elem)
break;
608 elemInd[gradShapesSize] = ind[0];
610 for (
int d=0;d<
dim;d++){
611 gradShapes[0][d]+=0.5*scv.
normal()[d];
612 gradShapes[gradShapesSize][d]+=0.5*scv.
normal()[d];
616 gradShapes/=(
number)elemSize;
624 for (
int d1=0;d1<
dim;d1++){
625 dd->dof_indices(elem, d1 , multInd);
626 for(
size_t ip = 0; ip < geo.
num_scvf(); ++ip)
633 for (
size_t sh=0;sh<gradShapesSize;sh++){
634 for (
int d2=0;d2<
dim;d2++){
635 number flux = s_a0 * distVec[d2]*gradShapes[sh][d2];
639 DoFRef(J,multInd[scvf.
to()],elemInd[sh])-= flux * scvf.
normal()[d1];
655 std::vector<DoFIndex> multInd;
659 typedef typename grid_type::template traits<side_type>::secure_container secure_container;
661 secure_container sides;
662 std::vector<MathVector<dim> > vCorner;
663 std::vector<DoFIndex> ind;
668 for(
int si = 0; si < domain.subset_handler()->
num_subsets(); ++si)
674 for( ;iter !=iterEnd; ++iter)
680 m_grid->associated_elements_sorted(sides, elem );
682 size_t sidesNaturalSize = sides.size();
685 geo.
update(elem, &(vCorner[0]), domain.subset_handler().get());
687 geo.
update_hanging(elem, &(vCorner[0]), domain.subset_handler().get());
689 dd->dof_indices(elem,0,ind,
true,
true);
690 get_constrained_sides_cr<side_type,secure_container,TGridFunction>(sides,*
m_u,ind);
706 geo.
update(elem, &(vCorner[0]), domain.subset_handler().get());
709 const number elemSize = ElementSize<dim>(roid, &vCorner[0]);
711 typename grid_type::template traits<elem_type>::secure_container assoElements;
713 dd->inner_dof_indices(elem,
_P_,ind);
720 for (
size_t i=0;i<geo.
num_scv();i++){
723 m_grid->associated_elements(assoElements,sides[
s]);
724 size_t numOfAsso = assoElements.size();
728 if (
s>=sidesNaturalSize){
729 dd->inner_dof_indices(assoElements[0],
_P_,ind);
732 for (
int d=0;d<
dim;d++) grad[d]+=scv.
normal()[d]*elemValue;
736 for (
size_t i=0;i<numOfAsso;i++){
737 dd->inner_dof_indices(assoElements[i],
_P_,ind);
739 if (assoElements[i]!=elem)
break;
742 for (
int d=0;d<
dim;d++) grad[d]+=0.5*(elemValue+
DoFRef(u,ind[0]))*scv.
normal()[d];
745 for(
size_t ip = 0; ip < geo.
num_scvf(); ++ip)
751 number pressureAddition = 0;
752 for (
int j=0;j<
dim;j++)
753 pressureAddition+=grad[j]*distVec[j];
754 pressureAddition*=s_a;
756 for (
int d1=0;d1<
dim;d1++){
757 dd->dof_indices(elem, d1 , multInd);
761 DoFRef(d,multInd[scvf.
to()]) -= pressureAddition * scvf.
normal()[d1];
774 std::vector<DoFIndex> multInd;
778 typedef typename grid_type::template traits<side_type>::secure_container secure_container;
780 secure_container sides;
781 std::vector<MathVector<dim> > vCorner;
782 std::vector<DoFIndex> ind;
792 for(
int si = 0; si < domain.subset_handler()->
num_subsets(); ++si)
798 for( ;iter !=iterEnd; ++iter)
808 geo.
update(elem, &(vCorner[0]), domain.subset_handler().get());
810 geo.
update_hanging(elem, &(vCorner[0]), domain.subset_handler().get());
816 UG_ASSERT(
dynamic_cast<elem_type*
>(elem) != NULL,
"Only elements of type elem_type are currently supported");
818 domain.grid()->associated_elements_sorted(sides,
static_cast<elem_type*
>(elem) );
820 size_t nNaturalSides = sides.size();
823 dd->dof_indices(elem,0,ind,
true,
true);
824 get_constrained_sides_cr<side_type,secure_container>(sides,*
m_u,multInd,0);
827 for (
int d0=0;d0<
dim;d0++){
828 for (
size_t s=0;
s<nNaturalSides;
s++){
829 dd->inner_dof_indices(sides[
s], d0, multInd);
830 uValue[
s][d0]=
DoFRef(u,multInd[0]);
837 for (
int d=0;d<
dim;d++)
for (
int d1=0;d1<
dim;d1++) globalGrad[d][d1]=0;
839 size_t nofsides = geo.
num_scv();
842 for (
size_t i=0;i < nofsides;i++)
850 for (
int d0=0;d0<
dim;d0++)
851 for (
int d1=0;d1<
dim;d1++)
852 globalGrad[d0][d1] = 0.0;
854 for (
int d0=0;d0<
dim;d0++)
856 for(
size_t sh = 0 ; sh < nofsides; ++sh)
858 for (
int d1=0;d1<
dim;d1++) globalGrad[d0][d1]+=uValue[sh][d0] * scv.
global_grad(sh)[d1];
871 acGrad[sides[
s]] += globalGrad;
879 for(
int si = 0; si < domain.subset_handler()->num_subsets(); ++si)
883 for( ;sideIter !=sideIterEnd; sideIter++)
892 if (
dim==2) constrainingSideAveraging<TGridFunction,side_type,ConstrainingEdge,dimMat>(
acGrad,
m_u);
894 constrainingSideAveraging<TGridFunction,side_type,ConstrainingTriangle,dimMat>(
acGrad,
m_u);
895 constrainingSideAveraging<TGridFunction,side_type,ConstrainingQuadrilateral,dimMat>(
acGrad,
m_u);
900 for(
int si = 0; si < domain.subset_handler()->
num_subsets(); ++si){
903 for( ;sideIter !=sideIterEnd; ++sideIter)
907 typename grid_type::template traits<elem_type>::secure_container assoElements;
908 m_grid->associated_elements(assoElements,side);
913 const size_t numVertices = side->num_vertices();
915 std::vector<MathVector<dim> > coCoord(numVertices);
916 for(
size_t i = 0; i < numVertices; ++i){
917 coCoord[i] = posAcc[side->vertex(i)];
918 sideBary += coCoord[i];
920 sideBary /= numVertices;
922 for (
int d0=0;d0<
dim;d0++){
923 dd->inner_dof_indices(side,d0,multInd);
924 sideValue[d0]=
DoFRef(u,multInd[0]);
928 for (
int d=0;d<
dim;d++) nbhoodMin[d] = sideValue[d];
929 for (
int d=0;d<
dim;d++) nbhoodMax[d] = sideValue[d];
930 secure_container assoElementSides;
932 for (
size_t el=0;el<assoElements.size();el++){
934 m_grid->associated_elements(assoElementSides, assoElements[el]);
936 const size_t numVertices = assoElements[el]->num_vertices();
938 for(
size_t i = 0; i < numVertices; ++i){
939 bary[el] += posAcc[assoElements[el]->vertex(i)];
941 bary[el] /= numVertices;
943 for (
int d0=0;d0<
dim;d0++){
944 for (
size_t s=0;
s<assoElementSides.size();
s++){
945 dd->inner_dof_indices(assoElementSides[
s], d0, multInd);
947 if (uValue<nbhoodMin[d0]) nbhoodMin[d0]=uValue;
948 if (uValue>nbhoodMax[d0]) nbhoodMax[d0]=uValue;
952 for (
size_t i=0;i<side->num_vertices();i++){
953 secure_container neighbourSides;
954 m_grid->associated_elements(neighbourSides,side);
955 for (
size_t j=0;j<neighbourSides.size();j++){
956 if (neighbourSides[j]==side)
continue;
957 for (
int d0=0;d0<
dim;d0++){
958 dd->inner_dof_indices(neighbourSides[j], d0, multInd);
960 if (uValue<nbhoodMin[d0]) nbhoodMin[d0]=uValue;
961 if (uValue>nbhoodMax[d0]) nbhoodMax[d0]=uValue;
967 coCoord.resize(numVertices+assoElements.size());
968 for (
size_t i=0;i<assoElements.size();i++){
969 coCoord[numVertices+i] = bary[i];
971 for (
size_t i=0;i<coCoord.size();i++){
974 for (
int d0=0;d0<
dim;d0++){
975 number uValue = sideValue[d0];
977 for (
int d1=0;d1<
dim;d1++){
978 addValue += distVec[d1]*
acGrad[side][d0][d1];
980 if (addValue<1e-12)
continue;
982 if (uValue+addValue<nbhoodMin[d0]){
983 number alpha = (nbhoodMin[d0]-uValue)/addValue;
985 for (
int d1=0;d1<
dim;d1++)
acGrad[side][d0][d1] *= alpha;
988 if (uValue+addValue>nbhoodMax[d0]){
989 number alpha = (nbhoodMax[d0]-uValue)/addValue;
991 for (
int d1=0;d1<
dim;d1++)
acGrad[side][d0][d1] *= alpha;
1000 for(
int si = 0; si < domain.subset_handler()->num_subsets(); ++si)
1006 for( ;iter !=iterEnd; ++iter)
1011 typename grid_type::template traits<side_type>::secure_container sides;
1014 m_grid->associated_elements_sorted(sides, elem);
1016 size_t sidesNaturalSize = sides.size();
1028 geo.
update(elem, &(vCorner[0]), domain.subset_handler().get());
1030 geo.
update_hanging(elem, &(vCorner[0]), domain.subset_handler().get(),
true);
1032 dd->dof_indices(elem,0,ind,
true,
true);
1033 get_constrained_sides_cr<side_type,secure_container>(sides,*
m_u,ind);
1040 for(
size_t ip = 0; ip < geo.
num_scvf(); ++ip)
1045 for(
size_t sh = 0; sh < sides.size(); ++sh){
1046 for(
int d1 = 0; d1 <
dim; ++d1){
1047 dd->inner_dof_indices(sides[sh], d1, multInd);
1048 StdVel[ip][d1] +=
DoFRef(u,multInd[0]) * scvf.
shape(sh);
1053 number elemPressureValue=0, pressure=0;
1063 const number elemSize = ElementSize<dim>(roid, &vCorner[0]);
1065 typename grid_type::template traits<elem_type>::secure_container assoElements;
1067 dd->inner_dof_indices(elem,
dim,multInd);
1068 elemPressureValue =
DoFRef(u,multInd[0]);
1070 for (
size_t i=0;i<geo.
num_scv();i++){
1073 m_grid->associated_elements(assoElements,sides[
s]);
1074 size_t numOfAsso = assoElements.size();
1078 if (
s>=sidesNaturalSize){
1079 dd->inner_dof_indices(assoElements[0],
_P_,ind);
1082 for (
int d=0;d<
dim;d++) pGrad[d]+=scv.
normal()[d]*elemPressureValue;
1086 for (
size_t i=0;i<numOfAsso;i++){
1087 dd->inner_dof_indices(assoElements[i],
_P_,ind);
1089 if (assoElements[i]!=elem)
break;
1092 for (
int d=0;d<
dim;d++) pGrad[d]+=0.5*(elemPressureValue+
DoFRef(u,ind[0]))*scv.
normal()[d];
1099 for(
size_t ip = 0; ip < geo.
num_scvf(); ++ip){
1114 for (
int j=0;j<
dim;j++)
1115 pressureFlux+=pGrad[j]*distVecBary[j];
1116 pressure = s_a * pressureFlux;
1119 for(
int d1 = 0; d1 <
dim; ++d1)
1127 for (
int d2=0;d2<
dim;d2++){
1128 upwindVel+=(
acGrad[sides[base]])[d1][d2]*distVec[d2];
1131 dd->dof_indices(elem,d1,multInd);
1132 DoFRef(d,multInd[scvf.
from()]) += upwindVel * flux;
1133 DoFRef(d,multInd[scvf.
to()]) -= upwindVel * flux;
1152 const std::vector<number>* vScaleMass = NULL,
1153 const std::vector<number>* vScaleStiff = NULL)
1162 for(
size_t t = 0; t < vScaleStiff->size(); ++t){
1163 if ((*vScaleStiff)[t]==0)
continue;
1167 add_defect(d,*(vSol->solution(t)),
dd,time,(*vScaleStiff)[t]);
Edge * constrained_edge(size_t ind) const
size_t num_constrained_edges() const
Face * constrained_face(size_t ind) const
size_t num_constrained_faces() const
const MathVector< worldDim > & global_ip() const
const MathVector< worldDim > & normal() const
number shape(size_t sh) const
const MathVector< worldDim > & global_grad(size_t sh) const
const MathVector< worldDim > & normal() const
const MathVector< worldDim > & global_ip() const
const SCV & scv(size_t i) const
const SCVF & scvf(size_t i) const
void update(GridObject *elem, const MathVector< worldDim > *vCornerCoords, const ISubsetHandler *ish=NULL)
const MathVector< worldDim > global_bary() const
const CONSTRAINED_DOF & constrained_dof(size_t i) const
size_t num_constrained_dofs() const
void update_hanging(GridObject *elem, const MathVector< worldDim > *vCornerCoords, const ISubsetHandler *ish=NULL, bool keepSCV=false, bool keepSCVF=false)
Definition: disc_constraint_fvcr.h:165
std::pair< MathVector< dim >, MathVector< dim > > MathVector_Pair
Definition: disc_constraint_fvcr.h:215
ANumber aVol
Definition: disc_constraint_fvcr.h:233
algebra_type::vector_type vector_type
Type of algebra vector.
Definition: disc_constraint_fvcr.h:180
bool m_limiter
Definition: disc_constraint_fvcr.h:248
virtual void adjust_jacobian(matrix_type &J, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=NULL, const number s_a0=1.0)
Definition: disc_constraint_fvcr.h:465
Attachment< std::vector< DoFIndex > > ASizetArray
Definition: disc_constraint_fvcr.h:223
virtual int type() const
returns the type of the constraints
Definition: disc_constraint_fvcr.h:1191
TGridFunction::template dim_traits< dim >::grid_base_object elem_type
element type
Definition: disc_constraint_fvcr.h:192
domain_type::position_accessor_type position_accessor_type
position accessor
Definition: disc_constraint_fvcr.h:209
aSideNumber acVol
Definition: disc_constraint_fvcr.h:228
virtual void adjust_linear(matrix_type &mat, vector_type &rhs, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
Definition: disc_constraint_fvcr.h:1175
ASizetArray aGradShInd
Definition: disc_constraint_fvcr.h:235
static const size_t _P_
Definition: disc_constraint_fvcr.h:203
virtual void add_defect(vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, const number time=0.0, const number s_a=1.0)
Definition: disc_constraint_fvcr.h:769
PeriodicAttachmentAccessor< side_type, ANumber > aSideNumber
Definition: disc_constraint_fvcr.h:220
TGridFunction::domain_type TDomain
Definition: disc_constraint_fvcr.h:167
ISubsetHandler * m_ish
Definition: disc_constraint_fvcr.h:249
bool m_bAdaptive
Definition: disc_constraint_fvcr.h:243
std::vector< std::vector< std::pair< DoFIndex, MathVector< dim > > > > vvIndexPosPair
Definition: disc_constraint_fvcr.h:214
void compute_grad_shapes()
compute gradient shapes for velocity on rotated elements
Definition: disc_constraint_fvcr.h:330
static const int dim
world Dimension
Definition: disc_constraint_fvcr.h:171
elem_type::side side_type
side type
Definition: disc_constraint_fvcr.h:195
virtual void adjust_solution(vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
Definition: disc_constraint_fvcr.h:1187
bool m_bLinUpConvDefect
Definition: disc_constraint_fvcr.h:246
domain_type::grid_type grid_type
grid type
Definition: disc_constraint_fvcr.h:189
domain_traits< TDomain::dim >::grid_base_object grid_base_object
Type of geometric base object.
Definition: disc_constraint_fvcr.h:206
TGridFunction::algebra_type TAlgebra
Definition: disc_constraint_fvcr.h:168
aSideDimMat acGrad
Definition: disc_constraint_fvcr.h:227
~DiscConstraintFVCR()
destructor
Definition: disc_constraint_fvcr.h:319
Attachment< dimMat > AMathDimMat
Definition: disc_constraint_fvcr.h:218
DiscConstraintFVCR(SmartPtr< TGridFunction > u)
constructor
Definition: disc_constraint_fvcr.h:295
algebra_type::matrix_type matrix_type
Type of algebra matrix.
Definition: disc_constraint_fvcr.h:177
bool zeroGradBndElem(typename grid_type::template traits< side_type >::secure_container sides)
Definition: disc_constraint_fvcr.h:321
virtual void adjust_defect(vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0, ConstSmartPtr< VectorTimeSeries< vector_type > > vSol=SPNULL, const std::vector< number > *vScaleMass=NULL, const std::vector< number > *vScaleStiff=NULL)
Definition: disc_constraint_fvcr.h:1149
TGridFunction::template dim_traits< dim >::const_iterator ElemIterator
element iterator
Definition: disc_constraint_fvcr.h:198
AMathDimMat aGrad
Definition: disc_constraint_fvcr.h:232
void set_zero_grad_bnd(const char *subsets)
set boundaries, in associated elements there is no linear pressure and no linear velocity upwind
Definition: disc_constraint_fvcr.h:284
aSideSizetArray acGradShInd
Definition: disc_constraint_fvcr.h:230
std::vector< std::pair< DoFIndex, MathVector< dim > > > vIndexPosPair
Definition: disc_constraint_fvcr.h:213
ANumberArray aGradSh
Definition: disc_constraint_fvcr.h:234
virtual void add_pressure_defect(vector_type &d, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, const number time=0.0, const number s_a=1.0)
Definition: disc_constraint_fvcr.h:650
SubsetGroup m_zeroGradSg
Definition: disc_constraint_fvcr.h:251
DiscConstraintFVCR(SmartPtr< TGridFunction > u, bool bLinUpConvDefect, bool bLinUpConvJacobian, bool bLinPressureDefect, bool bLinPressureJacobian, bool bAdaptive)
Definition: disc_constraint_fvcr.h:299
TAlgebra algebra_type
Algebra type.
Definition: disc_constraint_fvcr.h:174
virtual void adjust_rhs(vector_type &rhs, const vector_type &u, ConstSmartPtr< DoFDistribution > dd, int type, number time=0.0)
Definition: disc_constraint_fvcr.h:1181
TDomain domain_type
Type of Domain.
Definition: disc_constraint_fvcr.h:183
PeriodicAttachmentAccessor< side_type, ASizetArray > aSideSizetArray
Definition: disc_constraint_fvcr.h:225
TGridFunction::template traits< side_type >::const_iterator SideIterator
side iterator
Definition: disc_constraint_fvcr.h:201
DiscConstraintFVCR(SmartPtr< TGridFunction > u, bool bLinUpConvDefect, bool bLinUpConvJacobian, bool bLinPressureDefect, bool bLinPressureJacobian, bool bAdaptive, bool bLimiter)
Definition: disc_constraint_fvcr.h:303
DiscConstraintFVCR(SmartPtr< TGridFunction > u, bool bLinUpConvDefect, bool bLinUpConvJacobian, bool bLinPressureDefect, bool bLinPressureJacobian, bool bAdaptive, const char *subsets)
Definition: disc_constraint_fvcr.h:307
face_type_traits< dim >::face_type0 face_type0
Definition: disc_constraint_fvcr.h:237
grid_type * m_grid
Definition: disc_constraint_fvcr.h:242
PeriodicAttachmentAccessor< side_type, AMathDimMat > aSideDimMat
Definition: disc_constraint_fvcr.h:219
static const size_t maxShapeSize
Definition: disc_constraint_fvcr.h:211
aSideNumberArray acGradSh
Definition: disc_constraint_fvcr.h:229
SmartPtr< TGridFunction > m_u
Definition: disc_constraint_fvcr.h:241
static const int blockSize
blockSize of used algebra
Definition: disc_constraint_fvcr.h:186
DiscConstraintFVCR(SmartPtr< TGridFunction > u, bool bLinUpConvDefect, bool bLinUpConvJacobian, bool bLinPressureDefect, bool bLinPressureJacobian, bool bAdaptive, bool bLimiter, const char *subsets)
Definition: disc_constraint_fvcr.h:312
void init(SmartPtr< TGridFunction > u, bool bLinUpConvDefect, bool bLinUpConvJacobian, bool bLinPressureDefect, bool bLinPressureJacobian, bool bAdaptive, bool bLimiter)
Definition: disc_constraint_fvcr.h:254
bool m_bLinUpConvJacobian
Definition: disc_constraint_fvcr.h:247
bool m_bLinPressureJacobian
Definition: disc_constraint_fvcr.h:245
Attachment< std::vector< MathVector< dim > > > ANumberArray
Definition: disc_constraint_fvcr.h:222
MathMatrix< dim, dim > dimMat
Definition: disc_constraint_fvcr.h:217
face_type_traits< dim >::face_type1 face_type1
Definition: disc_constraint_fvcr.h:238
bool m_bLinPressureDefect
Definition: disc_constraint_fvcr.h:244
void set_limiter(bool bLimiter)
Definition: disc_constraint_fvcr.h:290
PeriodicAttachmentAccessor< side_type, ANumberArray > aSideNumberArray
Definition: disc_constraint_fvcr.h:224
algebra_type::vector_type vector_type
algebra_type::matrix_type matrix_type
ConstSmartPtr< DoFDistribution > dd(const GridLevel &gl) const
int get_subset_index(const char *name) const
bool access(Grid &g, TAttachment &a)
bool is_slave(TElem *) const
bool contains(const char *name) const
static const int blockSize
ParallelMatrix< SparseMatrix< double > > matrix_type
ParallelVector< Vector< double > > vector_type
Grid::VertexAttachmentAccessor< position_attachment_type > position_accessor_type
void CollectCornerCoordinates(int base_object_id, std::vector< typename TDomain::position_type > &vCornerCoordsOut, GridObject &elem, const TDomain &domain, bool clearContainer)
size_t num_subsets() const
void SetAttachmentValues(TAttachmentAccessor &aaVal, TIter elemsBegin, TIter elemsEnd, const TVal &val)
const NullSmartPtr SPNULL
#define UG_ASSERT(expr, msg)
#define UG_CATCH_THROW(msg)
void VecSubtract(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
const number & DoFRef(const TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
double VecProd(const double &a, const double &b)
void VecSet(vector_t &dest, number alpha, const std::vector< size_t > vIndex)
void get_constrained_sides_cr(secure_container &sides, const TGridFunction &u, std::vector< MultiIndex< 2 > > multInd, size_t fct=0)
Definition: disc_constraint_fvcr.h:71
void constrainingSideAveraging(PeriodicAttachmentAccessor< side_type, Attachment< VType > > &aaData, SmartPtr< TGridFunction > m_uInfo)
Definition: disc_constraint_fvcr.h:116