Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
e5fa5e00
Commit
e5fa5e00
authored
Apr 12, 2017
by
Spencer Sherwin
Browse files
Removed a few remaining eid's
parent
7fb9f05d
Changes
2
Hide whitespace changes
Inline
Side-by-side
library/MultiRegions/DisContField3D.cpp
View file @
e5fa5e00
...
...
@@ -2273,8 +2273,8 @@ using namespace boost::assign;
Array
<
OneD
,
NekDouble
>
force
,
out_tmp
,
qrhs
,
qrhs1
;
Array
<
OneD
,
Array
<
OneD
,
LocalRegions
::
ExpansionSharedPtr
>
>
&
elmtToTrace
=
m_traceMap
->
GetElmtToTrace
();
int
eid
,
nq_elmt
,
nm_elmt
;
int
nq_elmt
,
nm_elmt
;
int
LocBndCoeffs
=
m_traceMap
->
GetNumLocalBndCoeffs
();
Array
<
OneD
,
NekDouble
>
loc_lambda
(
LocBndCoeffs
),
face_lambda
;
Array
<
OneD
,
NekDouble
>
tmp_coeffs
;
...
...
@@ -2288,30 +2288,29 @@ using namespace boost::assign;
LocalRegions
::
Expansion3DSharedPtr
exp
=
(
*
m_exp
)[
i
]
->
as
<
LocalRegions
::
Expansion3D
>
();
eid
=
i
;
nq_elmt
=
(
*
m_exp
)[
eid
]
->
GetTotPoints
();
nm_elmt
=
(
*
m_exp
)[
eid
]
->
GetNcoeffs
();
nq_elmt
=
(
*
m_exp
)[
i
]
->
GetTotPoints
();
nm_elmt
=
(
*
m_exp
)[
i
]
->
GetNcoeffs
();
qrhs
=
Array
<
OneD
,
NekDouble
>
(
nq_elmt
);
qrhs1
=
Array
<
OneD
,
NekDouble
>
(
nq_elmt
);
force
=
Array
<
OneD
,
NekDouble
>
(
2
*
nm_elmt
);
out_tmp
=
force
+
nm_elmt
;
LocalRegions
::
ExpansionSharedPtr
ppExp
;
int
num_points0
=
(
*
m_exp
)[
eid
]
->
GetBasis
(
0
)
->
GetNumPoints
();
int
num_points1
=
(
*
m_exp
)[
eid
]
->
GetBasis
(
1
)
->
GetNumPoints
();
int
num_points2
=
(
*
m_exp
)[
eid
]
->
GetBasis
(
2
)
->
GetNumPoints
();
int
num_modes0
=
(
*
m_exp
)[
eid
]
->
GetBasis
(
0
)
->
GetNumModes
();
int
num_modes1
=
(
*
m_exp
)[
eid
]
->
GetBasis
(
1
)
->
GetNumModes
();
int
num_modes2
=
(
*
m_exp
)[
eid
]
->
GetBasis
(
2
)
->
GetNumModes
();
int
num_points0
=
(
*
m_exp
)[
i
]
->
GetBasis
(
0
)
->
GetNumPoints
();
int
num_points1
=
(
*
m_exp
)[
i
]
->
GetBasis
(
1
)
->
GetNumPoints
();
int
num_points2
=
(
*
m_exp
)[
i
]
->
GetBasis
(
2
)
->
GetNumPoints
();
int
num_modes0
=
(
*
m_exp
)[
i
]
->
GetBasis
(
0
)
->
GetNumModes
();
int
num_modes1
=
(
*
m_exp
)[
i
]
->
GetBasis
(
1
)
->
GetNumModes
();
int
num_modes2
=
(
*
m_exp
)[
i
]
->
GetBasis
(
2
)
->
GetNumModes
();
// Probably a better way of setting up lambda than this. Note
// cannot use PutCoeffsInToElmts since lambda space is mapped
// during the solve.
int
nFaces
=
(
*
m_exp
)[
eid
]
->
GetNfaces
();
int
nFaces
=
(
*
m_exp
)[
i
]
->
GetNfaces
();
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
faceCoeffs
(
nFaces
);
for
(
f
=
0
;
f
<
nFaces
;
++
f
)
{
ncoeff_face
=
elmtToTrace
[
eid
][
f
]
->
GetNcoeffs
();
ncoeff_face
=
elmtToTrace
[
i
][
f
]
->
GetNcoeffs
();
faceCoeffs
[
f
]
=
Array
<
OneD
,
NekDouble
>
(
ncoeff_face
);
Vmath
::
Vcopy
(
ncoeff_face
,
face_lambda
,
1
,
faceCoeffs
[
f
],
1
);
exp
->
SetFaceToGeomOrientation
(
f
,
faceCoeffs
[
f
]);
...
...
@@ -2319,7 +2318,7 @@ using namespace boost::assign;
}
//creating orthogonal expansion (checking if we have quads or triangles)
LibUtilities
::
ShapeType
shape
=
(
*
m_exp
)[
eid
]
->
DetShapeType
();
LibUtilities
::
ShapeType
shape
=
(
*
m_exp
)[
i
]
->
DetShapeType
();
switch
(
shape
)
{
case
LibUtilities
::
eHexahedron
:
...
...
@@ -2330,7 +2329,7 @@ using namespace boost::assign;
LibUtilities
::
BasisKey
BkeyH1
(
LibUtilities
::
eOrtho_A
,
num_modes0
,
PkeyH1
);
LibUtilities
::
BasisKey
BkeyH2
(
LibUtilities
::
eOrtho_A
,
num_modes1
,
PkeyH2
);
LibUtilities
::
BasisKey
BkeyH3
(
LibUtilities
::
eOrtho_A
,
num_modes2
,
PkeyH3
);
SpatialDomains
::
HexGeomSharedPtr
hGeom
=
boost
::
dynamic_pointer_cast
<
SpatialDomains
::
HexGeom
>
((
*
m_exp
)[
eid
]
->
GetGeom
());
SpatialDomains
::
HexGeomSharedPtr
hGeom
=
boost
::
dynamic_pointer_cast
<
SpatialDomains
::
HexGeom
>
((
*
m_exp
)[
i
]
->
GetGeom
());
ppExp
=
MemoryManager
<
LocalRegions
::
HexExp
>::
AllocateSharedPtr
(
BkeyH1
,
BkeyH2
,
BkeyH3
,
hGeom
);
}
break
;
...
...
@@ -2342,7 +2341,7 @@ using namespace boost::assign;
LibUtilities
::
BasisKey
BkeyT1
(
LibUtilities
::
eOrtho_A
,
num_modes0
,
PkeyT1
);
LibUtilities
::
BasisKey
BkeyT2
(
LibUtilities
::
eOrtho_B
,
num_modes1
,
PkeyT2
);
LibUtilities
::
BasisKey
BkeyT3
(
LibUtilities
::
eOrtho_C
,
num_modes2
,
PkeyT3
);
SpatialDomains
::
TetGeomSharedPtr
tGeom
=
boost
::
dynamic_pointer_cast
<
SpatialDomains
::
TetGeom
>
((
*
m_exp
)[
eid
]
->
GetGeom
());
SpatialDomains
::
TetGeomSharedPtr
tGeom
=
boost
::
dynamic_pointer_cast
<
SpatialDomains
::
TetGeom
>
((
*
m_exp
)[
i
]
->
GetGeom
());
ppExp
=
MemoryManager
<
LocalRegions
::
TetExp
>::
AllocateSharedPtr
(
BkeyT1
,
BkeyT2
,
BkeyT3
,
tGeom
);
}
break
;
...
...
@@ -2354,7 +2353,7 @@ using namespace boost::assign;
LibUtilities
::
BasisKey
BkeyP1
(
LibUtilities
::
eOrtho_A
,
num_modes0
,
PkeyP1
);
LibUtilities
::
BasisKey
BkeyP2
(
LibUtilities
::
eOrtho_A
,
num_modes1
,
PkeyP2
);
LibUtilities
::
BasisKey
BkeyP3
(
LibUtilities
::
eOrtho_B
,
num_modes2
,
PkeyP3
);
SpatialDomains
::
PrismGeomSharedPtr
pGeom
=
boost
::
dynamic_pointer_cast
<
SpatialDomains
::
PrismGeom
>
((
*
m_exp
)[
eid
]
->
GetGeom
());
SpatialDomains
::
PrismGeomSharedPtr
pGeom
=
boost
::
dynamic_pointer_cast
<
SpatialDomains
::
PrismGeom
>
((
*
m_exp
)[
i
]
->
GetGeom
());
ppExp
=
MemoryManager
<
LocalRegions
::
PrismExp
>::
AllocateSharedPtr
(
BkeyP1
,
BkeyP2
,
BkeyP3
,
pGeom
);
}
break
;
...
...
@@ -2365,34 +2364,34 @@ using namespace boost::assign;
//DGDeriv
// (d/dx w, q_0)
(
*
m_exp
)[
eid
]
->
DGDeriv
(
0
,
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
eid
],
elmtToTrace
[
eid
],
faceCoeffs
,
out_tmp
);
(
*
m_exp
)[
eid
]
->
BwdTrans
(
out_tmp
,
qrhs
);
(
*
m_exp
)[
i
]
->
DGDeriv
(
0
,
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
i
],
elmtToTrace
[
i
],
faceCoeffs
,
out_tmp
);
(
*
m_exp
)[
i
]
->
BwdTrans
(
out_tmp
,
qrhs
);
ppExp
->
IProductWRTDerivBase
(
0
,
qrhs
,
force
);
// + (d/dy w, q_1)
(
*
m_exp
)[
eid
]
->
DGDeriv
(
1
,
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
eid
],
elmtToTrace
[
eid
],
faceCoeffs
,
out_tmp
);
(
*
m_exp
)[
eid
]
->
BwdTrans
(
out_tmp
,
qrhs
);
(
*
m_exp
)[
i
]
->
DGDeriv
(
1
,
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
i
],
elmtToTrace
[
i
],
faceCoeffs
,
out_tmp
);
(
*
m_exp
)[
i
]
->
BwdTrans
(
out_tmp
,
qrhs
);
ppExp
->
IProductWRTDerivBase
(
1
,
qrhs
,
out_tmp
);
Vmath
::
Vadd
(
nm_elmt
,
force
,
1
,
out_tmp
,
1
,
force
,
1
);
// + (d/dz w, q_2)
(
*
m_exp
)[
eid
]
->
DGDeriv
(
2
,
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
eid
],
elmtToTrace
[
eid
],
faceCoeffs
,
out_tmp
);
(
*
m_exp
)[
eid
]
->
BwdTrans
(
out_tmp
,
qrhs
);
(
*
m_exp
)[
i
]
->
DGDeriv
(
2
,
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
i
],
elmtToTrace
[
i
],
faceCoeffs
,
out_tmp
);
(
*
m_exp
)[
i
]
->
BwdTrans
(
out_tmp
,
qrhs
);
ppExp
->
IProductWRTDerivBase
(
2
,
qrhs
,
out_tmp
);
Vmath
::
Vadd
(
nm_elmt
,
force
,
1
,
out_tmp
,
1
,
force
,
1
);
// determine force[0] = (1,u)
(
*
m_exp
)[
eid
]
->
BwdTrans
(
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
eid
],
qrhs
);
force
[
0
]
=
(
*
m_exp
)[
eid
]
->
Integral
(
qrhs
);
(
*
m_exp
)[
i
]
->
BwdTrans
(
tmp_coeffs
=
m_coeffs
+
m_coeff_offset
[
i
],
qrhs
);
force
[
0
]
=
(
*
m_exp
)[
i
]
->
Integral
(
qrhs
);
// multiply by inverse Laplacian matrix
// get matrix inverse
...
...
@@ -2407,8 +2406,8 @@ using namespace boost::assign;
// Transforming back to modified basis
Array
<
OneD
,
NekDouble
>
work
(
nq_elmt
);
ppExp
->
BwdTrans
(
out
.
GetPtr
(),
work
);
(
*
m_exp
)[
eid
]
->
FwdTrans
(
work
,
tmp_coeffs
=
outarray
+
m_coeff_offset
[
eid
]);
(
*
m_exp
)[
i
]
->
FwdTrans
(
work
,
tmp_coeffs
=
outarray
+
m_coeff_offset
[
i
]);
}
}
...
...
solvers/IncNavierStokesSolver/EquationSystems/CoupledLocalToGlobalC0ContMap.cpp
View file @
e5fa5e00
...
...
@@ -82,7 +82,7 @@ namespace Nektar
MultiRegions
::
PeriodicMap
::
const_iterator
pIt
;
const
LocalRegions
::
ExpansionVector
&
locExpVector
=
*
(
fields
[
0
]
->
GetExp
());
int
eid
,
id
,
diff
;
int
id
,
diff
;
int
nel
=
fields
[
0
]
->
GetNumElmts
();
MultiRegions
::
PeriodicMap
periodicVerts
;
...
...
@@ -247,10 +247,9 @@ namespace Nektar
for
(
i
=
0
;
i
<
nel
;
++
i
)
{
eid
=
i
;
for
(
j
=
0
;
j
<
locExpVector
[
eid
]
->
GetNverts
();
++
j
)
for
(
j
=
0
;
j
<
locExpVector
[
i
]
->
GetNverts
();
++
j
)
{
vertId
=
(
locExpVector
[
eid
]
->
as
<
LocalRegions
::
Expansion2D
>
()
vertId
=
(
locExpVector
[
i
]
->
as
<
LocalRegions
::
Expansion2D
>
()
->
GetGeom2D
())
->
GetVid
(
j
);
if
(
Dofs
[
0
].
count
(
vertId
)
==
0
)
{
...
...
@@ -263,17 +262,17 @@ namespace Nektar
}
}
edgeId
=
(
locExpVector
[
eid
]
->
as
<
LocalRegions
::
Expansion2D
>
()
edgeId
=
(
locExpVector
[
i
]
->
as
<
LocalRegions
::
Expansion2D
>
()
->
GetGeom2D
())
->
GetEid
(
j
);
if
(
Dofs
[
1
].
count
(
edgeId
)
==
0
)
{
Dofs
[
1
][
edgeId
]
=
nvel
*
(
locExpVector
[
eid
]
->
GetEdgeNcoeffs
(
j
)
-
2
)
*
nz_loc
;
Dofs
[
1
][
edgeId
]
=
nvel
*
(
locExpVector
[
i
]
->
GetEdgeNcoeffs
(
j
)
-
2
)
*
nz_loc
;
}
// Adjust for Dirichlet boundary conditions to give number to be solved
if
(
IsDirEdgeDof
.
count
(
edgeId
)
!=
0
)
{
Dofs
[
1
][
edgeId
]
-=
IsDirEdgeDof
[
edgeId
]
*
nz_loc
*
(
locExpVector
[
eid
]
->
GetEdgeNcoeffs
(
j
)
-
2
);
Dofs
[
1
][
edgeId
]
-=
IsDirEdgeDof
[
edgeId
]
*
nz_loc
*
(
locExpVector
[
i
]
->
GetEdgeNcoeffs
(
j
)
-
2
);
}
}
}
...
...
@@ -318,26 +317,25 @@ namespace Nektar
// pressure dof to a dirichlet edge
for
(
i
=
0
;
i
<
nel
;
++
i
)
{
eid
=
i
;
for
(
j
=
0
;
j
<
locExpVector
[
eid
]
->
GetNverts
();
++
j
)
for
(
j
=
0
;
j
<
locExpVector
[
i
]
->
GetNverts
();
++
j
)
{
edgeId
=
(
locExpVector
[
eid
]
->
as
<
LocalRegions
::
Expansion2D
>
()
edgeId
=
(
locExpVector
[
i
]
->
as
<
LocalRegions
::
Expansion2D
>
()
->
GetGeom2D
())
->
GetEid
(
j
);
if
(
IsDirEdgeDof
.
count
(
edgeId
)
==
0
)
// interior edge
{
// setup AddMeanPressureToEdgeId to decide where to
// put pressure
if
(
AddMeanPressureToEdgeId
[
eid
]
==
-
1
)
if
(
AddMeanPressureToEdgeId
[
i
]
==
-
1
)
{
AddMeanPressureToEdgeId
[
eid
]
=
edgeId
;
AddMeanPressureToEdgeId
[
i
]
=
edgeId
;
}
}
}
ASSERTL0
((
AddMeanPressureToEdgeId
[
eid
]
!=
-
1
),
"Did not determine "
ASSERTL0
((
AddMeanPressureToEdgeId
[
i
]
!=
-
1
),
"Did not determine "
"an edge to attach mean pressure dof"
);
// Add the mean pressure degree of freedom to this edge
Dofs
[
1
][
AddMeanPressureToEdgeId
[
eid
]]
+=
nz_loc
;
Dofs
[
1
][
AddMeanPressureToEdgeId
[
i
]]
+=
nz_loc
;
}
map
<
int
,
int
>
pressureEdgeOffset
;
...
...
@@ -389,8 +387,7 @@ namespace Nektar
for
(
i
=
0
;
i
<
nel
;
++
i
)
{
eid
=
i
;
locExpansion
=
locExpVector
[
eid
]
->
as
<
StdRegions
::
StdExpansion2D
>
();
locExpansion
=
locExpVector
[
i
]
->
as
<
StdRegions
::
StdExpansion2D
>
();
for
(
j
=
0
;
j
<
locExpansion
->
GetNedges
();
++
j
)
{
...
...
@@ -595,8 +592,7 @@ namespace Nektar
// ordering (element type consistency)
for
(
i
=
0
;
i
<
nel
;
++
i
)
{
eid
=
i
;
locExpansion
=
locExpVector
[
eid
]
->
as
<
StdRegions
::
StdExpansion2D
>
();
locExpansion
=
locExpVector
[
i
]
->
as
<
StdRegions
::
StdExpansion2D
>
();
velnbndry
=
locExpansion
->
NumBndryCoeffs
();
...
...
@@ -662,14 +658,14 @@ namespace Nektar
}
// use difference between two edges of the AddMeanPressureEdgeId to det nEdgeInteriorCoeffs.
nEdgeInteriorCoeffs
=
graphVertOffset
[(
ReorderedGraphVertId
[
1
][
AddMeanPressureToEdgeId
[
eid
]])
*
nvel
*
nz_loc
+
1
]
-
graphVertOffset
[(
ReorderedGraphVertId
[
1
][
AddMeanPressureToEdgeId
[
eid
]])
*
nvel
*
nz_loc
];
nEdgeInteriorCoeffs
=
graphVertOffset
[(
ReorderedGraphVertId
[
1
][
AddMeanPressureToEdgeId
[
i
]])
*
nvel
*
nz_loc
+
1
]
-
graphVertOffset
[(
ReorderedGraphVertId
[
1
][
AddMeanPressureToEdgeId
[
i
]])
*
nvel
*
nz_loc
];
int
psize
=
pressure
->
GetExp
(
eid
)
->
GetNcoeffs
();
int
psize
=
pressure
->
GetExp
(
i
)
->
GetNcoeffs
();
for
(
n
=
0
;
n
<
nz_loc
;
++
n
)
{
m_localToGlobalMap
[
cnt
+
nz_loc
*
nvel
*
velnbndry
+
n
*
psize
]
=
graphVertOffset
[(
ReorderedGraphVertId
[
1
][
AddMeanPressureToEdgeId
[
eid
]]
+
1
)
*
nvel
*
nz_loc
-
1
]
+
nEdgeInteriorCoeffs
+
pressureEdgeOffset
[
AddMeanPressureToEdgeId
[
eid
]];
m_localToGlobalMap
[
cnt
+
nz_loc
*
nvel
*
velnbndry
+
n
*
psize
]
=
graphVertOffset
[(
ReorderedGraphVertId
[
1
][
AddMeanPressureToEdgeId
[
i
]]
+
1
)
*
nvel
*
nz_loc
-
1
]
+
nEdgeInteriorCoeffs
+
pressureEdgeOffset
[
AddMeanPressureToEdgeId
[
i
]];
pressureEdgeOffset
[
AddMeanPressureToEdgeId
[
eid
]]
+=
1
;
pressureEdgeOffset
[
AddMeanPressureToEdgeId
[
i
]]
+=
1
;
}
cnt
+=
(
velnbndry
*
nvel
+
psize
)
*
nz_loc
;
...
...
@@ -753,8 +749,7 @@ namespace Nektar
Dofs
[
0
].
size
()
+
Dofs
[
1
].
size
()
-
firstNonDirGraphVertId
);
for
(
i
=
0
;
i
<
locExpVector
.
size
();
++
i
)
{
eid
=
i
;
locExpansion
=
locExpVector
[
eid
]
locExpansion
=
locExpVector
[
i
]
->
as
<
StdRegions
::
StdExpansion2D
>
();
for
(
j
=
0
;
j
<
locExpansion
->
GetNverts
();
++
j
)
{
...
...
Spencer Sherwin
@ssherw
mentioned in commit
8a1068b4
·
Apr 13, 2017
mentioned in commit
8a1068b4
mentioned in commit 8a1068b457ae8436a8a44e3860bcb06e013f0931
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment