Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Daniel Perry
Nektar
Commits
c6280ab0
Commit
c6280ab0
authored
Sep 10, 2013
by
Dave Moxey
Browse files
Merge branch 'feature/geom-factors' of /opt/gitlab/repositories/nektar
parents
da52e435
5b3697d4
Changes
150
Expand all
Hide whitespace changes
Inline
Side-by-side
library/Demos/LocalRegions/LocHexExpDemo.cpp
View file @
c6280ab0
...
...
@@ -139,7 +139,7 @@ int main(int argc, char *argv[])
// ////////////////////////////////////////////////////////////////
// Set up Hexahedron vertex coordinates
//
VertexComponent
(const int coordim, const int vid, double x,
//
PointGeom
(const int coordim, const int vid, double x,
// double y, double z)
const
int
nVerts
=
8
;
...
...
@@ -149,9 +149,9 @@ int main(int argc, char *argv[])
};
// Populate the list of verts
VertexComponent
SharedPtr
verts
[
8
];
PointGeom
SharedPtr
verts
[
8
];
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
)
{
verts
[
i
]
=
MemoryManager
<
VertexComponent
>
verts
[
i
]
=
MemoryManager
<
PointGeom
>
::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]);
}
...
...
@@ -168,7 +168,7 @@ int main(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
)
{
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
)
{
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
library/Demos/LocalRegions/LocPrismExpDemo.cpp
View file @
c6280ab0
...
...
@@ -118,10 +118,10 @@ int main(int argc, char *argv[])
// ////////////////////////////////////////////////////////////////////////////////////
// Populate the list of verts
//
VertexComponent
(const int coordim, const int vid, double x, double y, double z)
VertexComponent
SharedPtr
verts
[
6
];
//
PointGeom
(const int coordim, const int vid, double x, double y, double z)
PointGeom
SharedPtr
verts
[
6
];
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
){
verts
[
i
]
=
MemoryManager
<
VertexComponent
>::
verts
[
i
]
=
MemoryManager
<
PointGeom
>::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]
);
}
...
...
@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
){
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
){
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
library/Demos/LocalRegions/LocProject1D.cpp
View file @
c6280ab0
...
...
@@ -78,8 +78,8 @@ int main(int argc, char *argv[])
const
int
zero
=
0
;
const
int
one
=
1
;
const
double
dZero
=
0.0
;
SpatialDomains
::
VertexComponent
SharedPtr
vert1
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
one
,
zero
,
x
[
0
],
dZero
,
dZero
);
SpatialDomains
::
VertexComponent
SharedPtr
vert2
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
one
,
zero
,
x
[
1
],
dZero
,
dZero
);
SpatialDomains
::
PointGeom
SharedPtr
vert1
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
one
,
zero
,
x
[
0
],
dZero
,
dZero
);
SpatialDomains
::
PointGeom
SharedPtr
vert2
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
one
,
zero
,
x
[
1
],
dZero
,
dZero
);
SpatialDomains
::
SegGeomSharedPtr
geom
=
MemoryManager
<
SpatialDomains
::
SegGeom
>::
AllocateSharedPtr
(
zero
,
vert1
,
vert2
);
geom
->
SetOwnData
();
...
...
library/Demos/LocalRegions/LocProject2D.cpp
View file @
c6280ab0
...
...
@@ -175,14 +175,14 @@ int main(int argc, char *argv[])
coords
[
5
]
=
atof
(
argv
[
13
]);
// Set up coordinates
SpatialDomains
::
VertexComponent
SharedPtr
verts
[
3
];
SpatialDomains
::
PointGeom
SharedPtr
verts
[
3
];
const
int
zero
=
0
;
const
int
one
=
1
;
const
int
two
=
2
;
const
double
dZero
=
0.0
;
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
// Set up Edges
SpatialDomains
::
SegGeomSharedPtr
edges
[
3
];
...
...
@@ -244,11 +244,11 @@ int main(int argc, char *argv[])
const
int
two
=
2
;
const
int
three
=
3
;
const
double
dZero
=
0.0
;
SpatialDomains
::
VertexComponent
SharedPtr
verts
[
4
];
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
verts
[
3
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
three
,
coords
[
6
],
coords
[
7
],
dZero
);
SpatialDomains
::
PointGeom
SharedPtr
verts
[
4
];
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
verts
[
3
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
three
,
coords
[
6
],
coords
[
7
],
dZero
);
// Set up Edges
SpatialDomains
::
SegGeomSharedPtr
edges
[
4
];
...
...
library/Demos/LocalRegions/LocProject3D.cpp
View file @
c6280ab0
...
...
@@ -407,7 +407,7 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
// /////////////////////////////////////////////////////////////////////
// Set up Hexahedron vertex coordinates
//
VertexComponent
(const int coordim, const int vid, double x,
//
PointGeom
(const int coordim, const int vid, double x,
// double y, double z)
const
int
nVerts
=
8
;
const
double
point
[][
3
]
=
{
...
...
@@ -422,11 +422,11 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
};
// Populate the list of verts
VertexComponent
SharedPtr
verts
[
8
];
PointGeom
SharedPtr
verts
[
8
];
const
int
three
=
3
;
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
)
{
verts
[
i
]
=
MemoryManager
<
VertexComponent
>
verts
[
i
]
=
MemoryManager
<
PointGeom
>
::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]
);
}
...
...
@@ -443,7 +443,7 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
)
{
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
)
{
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
@@ -492,7 +492,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
// /////////////////////////////////////////////////////////////////////
// Set up Prism vertex coordinates
//
VertexComponent
(const int coordim, const int vid, double x,
//
PointGeom
(const int coordim, const int vid, double x,
// double y, double z)
const
int
nVerts
=
6
;
const
double
point
[][
3
]
=
{
...
...
@@ -505,11 +505,11 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
};
// Populate the list of verts
VertexComponent
SharedPtr
verts
[
nVerts
];
PointGeom
SharedPtr
verts
[
nVerts
];
const
int
three
=
3
;
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
)
{
verts
[
i
]
=
MemoryManager
<
VertexComponent
>
verts
[
i
]
=
MemoryManager
<
PointGeom
>
::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]
);
}
...
...
@@ -526,7 +526,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
)
{
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
)
{
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
@@ -607,12 +607,12 @@ SpatialDomains::TetGeomSharedPtr CreateTetGeom(int argc, char *argv[])
// ///////////////////////////////////////////////////////////////////////
// Populate the list of verts
//
VertexComponent
(const int coordim, const int vid, double x, double y,
//
PointGeom
(const int coordim, const int vid, double x, double y,
// double z)
VertexComponent
SharedPtr
verts
[
4
];
PointGeom
SharedPtr
verts
[
4
];
const
int
three
=
3
;
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
){
verts
[
i
]
=
MemoryManager
<
VertexComponent
>
verts
[
i
]
=
MemoryManager
<
PointGeom
>
::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]);
}
...
...
@@ -628,7 +628,7 @@ SpatialDomains::TetGeomSharedPtr CreateTetGeom(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
){
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
){
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
library/Demos/LocalRegions/LocProject_Diff1D.cpp
View file @
c6280ab0
...
...
@@ -78,8 +78,8 @@ int main(int argc, char *argv[])
//-----------------------------------------------
// Define a segment expansion based on basis definition
SpatialDomains
::
VertexComponent
SharedPtr
vert1
(
new
SpatialDomains
::
VertexComponent
(
1
,
0
,
x
[
0
],
0
,
0
));
SpatialDomains
::
VertexComponent
SharedPtr
vert2
(
new
SpatialDomains
::
VertexComponent
(
1
,
0
,
x
[
1
],
0
,
0
));
SpatialDomains
::
PointGeom
SharedPtr
vert1
(
new
SpatialDomains
::
PointGeom
(
1
,
0
,
x
[
0
],
0
,
0
));
SpatialDomains
::
PointGeom
SharedPtr
vert2
(
new
SpatialDomains
::
PointGeom
(
1
,
0
,
x
[
1
],
0
,
0
));
SpatialDomains
::
SegGeomSharedPtr
geom
(
new
SpatialDomains
::
SegGeom
(
0
,
vert1
,
vert2
));
geom
->
SetOwnData
();
...
...
library/Demos/LocalRegions/LocProject_Diff2D.cpp
View file @
c6280ab0
...
...
@@ -195,14 +195,14 @@ int main(int argc, char *argv[])
coords
[
5
]
=
atof
(
argv
[
13
]);
// Set up coordinates
SpatialDomains
::
VertexComponent
SharedPtr
verts
[
3
];
SpatialDomains
::
PointGeom
SharedPtr
verts
[
3
];
const
int
zero
=
0
;
const
int
one
=
1
;
const
int
two
=
2
;
const
double
dZero
=
0.0
;
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
// Set up Edges
SpatialDomains
::
SegGeomSharedPtr
edges
[
3
];
...
...
@@ -262,11 +262,11 @@ int main(int argc, char *argv[])
const
int
two
=
2
;
const
int
three
=
3
;
const
double
dZero
=
0.0
;
SpatialDomains
::
VertexComponent
SharedPtr
verts
[
4
];
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
verts
[
3
]
=
MemoryManager
<
SpatialDomains
::
VertexComponent
>::
AllocateSharedPtr
(
two
,
three
,
coords
[
6
],
coords
[
7
],
dZero
);
SpatialDomains
::
PointGeom
SharedPtr
verts
[
4
];
verts
[
0
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
zero
,
coords
[
0
],
coords
[
1
],
dZero
);
verts
[
1
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
one
,
coords
[
2
],
coords
[
3
],
dZero
);
verts
[
2
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
two
,
coords
[
4
],
coords
[
5
],
dZero
);
verts
[
3
]
=
MemoryManager
<
SpatialDomains
::
PointGeom
>::
AllocateSharedPtr
(
two
,
three
,
coords
[
6
],
coords
[
7
],
dZero
);
// Set up Edges
SpatialDomains
::
SegGeomSharedPtr
edges
[
4
];
...
...
library/Demos/LocalRegions/LocProject_Diff3D.cpp
View file @
c6280ab0
...
...
@@ -570,7 +570,7 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
// /////////////////////////////////////////////////////////////////////
// Set up Hexahedron vertex coordinates
//
VertexComponent
(const int coordim, const int vid, double x, double y,
//
PointGeom
(const int coordim, const int vid, double x, double y,
// double z)
const
int
nVerts
=
8
;
...
...
@@ -586,11 +586,11 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
};
// Populate the list of verts
VertexComponent
SharedPtr
verts
[
8
];
PointGeom
SharedPtr
verts
[
8
];
const
int
three
=
3
;
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
)
{
verts
[
i
]
=
MemoryManager
<
VertexComponent
>
verts
[
i
]
=
MemoryManager
<
PointGeom
>
::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]
);
}
...
...
@@ -607,7 +607,7 @@ SpatialDomains::HexGeomSharedPtr CreateHexGeom(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
)
{
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
)
{
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
@@ -657,7 +657,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
// /////////////////////////////////////////////////////////////////////
// Set up Prism vertex coordinates
//
VertexComponent
(const int coordim, const int vid, double x,
//
PointGeom
(const int coordim, const int vid, double x,
// double y, double z)
const
int
nVerts
=
6
;
const
double
point
[][
3
]
=
{
...
...
@@ -670,11 +670,11 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
};
// Populate the list of verts
VertexComponent
SharedPtr
verts
[
nVerts
];
PointGeom
SharedPtr
verts
[
nVerts
];
const
int
three
=
3
;
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
)
{
verts
[
i
]
=
MemoryManager
<
VertexComponent
>
verts
[
i
]
=
MemoryManager
<
PointGeom
>
::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]
);
}
...
...
@@ -691,7 +691,7 @@ SpatialDomains::PrismGeomSharedPtr CreatePrismGeom(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
)
{
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
)
{
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
@@ -773,12 +773,12 @@ SpatialDomains::TetGeomSharedPtr CreateTetGeom(int argc, char *argv[])
// //////////////////////////////////////////////////////////////////////
// Populate the list of verts
//
VertexComponent
(const int coordim, const int vid, double x, double y,
//
PointGeom
(const int coordim, const int vid, double x, double y,
// double z)
VertexComponent
SharedPtr
verts
[
4
];
PointGeom
SharedPtr
verts
[
4
];
const
int
three
=
3
;
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
){
verts
[
i
]
=
MemoryManager
<
VertexComponent
>
verts
[
i
]
=
MemoryManager
<
PointGeom
>
::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]);
}
...
...
@@ -793,7 +793,7 @@ SpatialDomains::TetGeomSharedPtr CreateTetGeom(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
){
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
){
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
library/Demos/LocalRegions/LocPyrExpDemo.cpp
View file @
c6280ab0
...
...
@@ -116,10 +116,10 @@ int main(int argc, char *argv[])
// ////////////////////////////////////////////////////////////////////////////////////
// Populate the list of verts
//
VertexComponent
(const int coordim, const int vid, double x, double y, double z)
VertexComponent
SharedPtr
verts
[
5
];
//
PointGeom
(const int coordim, const int vid, double x, double y, double z)
PointGeom
SharedPtr
verts
[
5
];
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
){
verts
[
i
]
=
MemoryManager
<
VertexComponent
>::
verts
[
i
]
=
MemoryManager
<
PointGeom
>::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]
);
}
...
...
@@ -138,7 +138,7 @@ int main(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
){
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
){
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
library/Demos/LocalRegions/LocTetExpDemo.cpp
View file @
c6280ab0
...
...
@@ -106,11 +106,11 @@ int main(int argc, char *argv[])
// //////////////////////////////////////////////////////////////////////
// Populate the list of verts
//
VertexComponent
(const int coordim, const int vid, double x, double y,
//
PointGeom
(const int coordim, const int vid, double x, double y,
// double z)
VertexComponent
SharedPtr
verts
[
4
];
PointGeom
SharedPtr
verts
[
4
];
for
(
int
i
=
0
;
i
<
nVerts
;
++
i
){
verts
[
i
]
=
MemoryManager
<
VertexComponent
>::
verts
[
i
]
=
MemoryManager
<
PointGeom
>::
AllocateSharedPtr
(
three
,
i
,
point
[
i
][
0
],
point
[
i
][
1
],
point
[
i
][
2
]
);
}
...
...
@@ -125,7 +125,7 @@ int main(int argc, char *argv[])
// Populate the list of edges
SegGeomSharedPtr
edges
[
nEdges
];
for
(
int
i
=
0
;
i
<
nEdges
;
++
i
){
VertexComponent
SharedPtr
vertsArray
[
2
];
PointGeom
SharedPtr
vertsArray
[
2
];
for
(
int
j
=
0
;
j
<
2
;
++
j
){
vertsArray
[
j
]
=
verts
[
vertexConnectivity
[
i
][
j
]];
}
...
...
library/LocalRegions/Expansion.cpp
View file @
c6280ab0
...
...
@@ -36,15 +36,23 @@
#include <LocalRegions/Expansion.h>
#include <LocalRegions/MatrixKey.h>
#include <SpatialDomains/MeshComponents.h>
namespace
Nektar
{
namespace
LocalRegions
{
Expansion
::
Expansion
(
void
)
Expansion
::
Expansion
(
SpatialDomains
::
GeometrySharedPtr
pGeom
)
:
m_geom
(
pGeom
),
m_metricinfo
(
m_geom
->
GetGeomFactors
(
m_base
))
{
}
Expansion
::
Expansion
(
const
Expansion
&
pSrc
)
:
m_geom
(
pSrc
.
m_geom
),
m_metricinfo
(
pSrc
.
m_metricinfo
)
{
}
Expansion
::~
Expansion
()
{
...
...
@@ -77,12 +85,59 @@ namespace Nektar
return
GetLocMatrix
(
mkey
);
}
SpatialDomains
::
GeometrySharedPtr
Expansion
::
GetGeom
()
const
{
return
m_geom
;
}
const
SpatialDomains
::
GeomFactorsSharedPtr
&
Expansion
::
v_GetMetricInfo
()
const
{
return
m_metricinfo
;
}
DNekScalMatSharedPtr
Expansion
::
v_GetLocMatrix
(
const
LocalRegions
::
MatrixKey
&
mkey
)
{
NEKERROR
(
ErrorUtil
::
efatal
,
"This function is only valid for LocalRegions"
);
return
NullDNekScalMatSharedPtr
;
}
void
Expansion
::
v_MultiplyByQuadratureMetric
(
const
Array
<
OneD
,
const
NekDouble
>&
inarray
,
Array
<
OneD
,
NekDouble
>
&
outarray
)
{
const
int
nqtot
=
GetTotPoints
();
if
(
m_metrics
.
count
(
MetricQuadrature
)
==
0
)
{
ComputeQuadratureMetric
();
}
Vmath
::
Vmul
(
nqtot
,
m_metrics
[
MetricQuadrature
],
1
,
inarray
,
1
,
outarray
,
1
);
}
void
Expansion
::
ComputeLaplacianMetric
()
{
v_ComputeLaplacianMetric
();
}
void
Expansion
::
ComputeQuadratureMetric
()
{
unsigned
int
nqtot
=
GetTotPoints
();
SpatialDomains
::
GeomType
type
=
m_metricinfo
->
GetGtype
();
if
(
type
==
SpatialDomains
::
eRegular
||
type
==
SpatialDomains
::
eMovingRegular
)
{
m_metrics
[
MetricQuadrature
]
=
Array
<
OneD
,
NekDouble
>
(
nqtot
,
m_metricinfo
->
GetJac
()[
0
]);
}
else
{
m_metrics
[
MetricQuadrature
]
=
m_metricinfo
->
GetJac
();
}
MultiplyByStdQuadratureMetric
(
m_metrics
[
MetricQuadrature
],
m_metrics
[
MetricQuadrature
]);
}
DNekMatSharedPtr
Expansion
::
v_BuildTransformationMatrix
(
const
DNekScalMatSharedPtr
&
r_bnd
,
const
StdRegions
::
MatrixType
matrixType
)
...
...
library/LocalRegions/Expansion.h
View file @
c6280ab0
...
...
@@ -37,10 +37,13 @@
#define EXPANSION_H
#include <StdRegions/StdExpansion.h>
#include <SpatialDomains/Geometry.h>
#include <SpatialDomains/GeomFactors.h>
#include <LocalRegions/LocalRegionsDeclspec.h>
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <vector>
#include <map>
namespace
Nektar
{
...
...
@@ -50,16 +53,29 @@ namespace Nektar
class
Expansion
;
class
MatrixKey
;
enum
MetricType
{
MetricLaplacian00
,
MetricLaplacian01
,
MetricLaplacian02
,
MetricLaplacian11
,
MetricLaplacian12
,
MetricLaplacian22
,
MetricQuadrature
};
// type defines for use of PrismExp in a boost vector
typedef
boost
::
shared_ptr
<
Expansion
>
ExpansionSharedPtr
;
typedef
boost
::
weak_ptr
<
Expansion
>
ExpansionWeakPtr
;
typedef
std
::
vector
<
ExpansionSharedPtr
>
ExpansionVector
;
typedef
std
::
vector
<
ExpansionSharedPtr
>::
iterator
ExpansionVectorIter
;
typedef
std
::
map
<
MetricType
,
Array
<
OneD
,
NekDouble
>
>
MetricMap
;
class
Expansion
:
virtual
public
StdRegions
::
StdExpansion
{
public:
LOCAL_REGIONS_EXPORT
Expansion
();
// default constructor.
LOCAL_REGIONS_EXPORT
Expansion
(
SpatialDomains
::
GeometrySharedPtr
pGeom
);
// default constructor.
LOCAL_REGIONS_EXPORT
Expansion
(
const
Expansion
&
pSrc
);
// copy constructor.
LOCAL_REGIONS_EXPORT
virtual
~
Expansion
();
LOCAL_REGIONS_EXPORT
DNekScalMatSharedPtr
GetLocMatrix
(
const
LocalRegions
::
MatrixKey
&
mkey
);
...
...
@@ -68,6 +84,16 @@ namespace Nektar
const
StdRegions
::
ConstFactorMap
&
factors
=
StdRegions
::
NullConstFactorMap
,
const
StdRegions
::
VarCoeffMap
&
varcoeffs
=
StdRegions
::
NullVarCoeffMap
);
LOCAL_REGIONS_EXPORT
SpatialDomains
::
GeometrySharedPtr
GetGeom
()
const
;
LOCAL_REGIONS_EXPORT
virtual
const
SpatialDomains
::
GeomFactorsSharedPtr
&
v_GetMetricInfo
()
const
;
static
ExpansionSharedPtr
FromStdExp
(
const
StdRegions
::
StdExpansionSharedPtr
&
pSrc
)
{
return
boost
::
dynamic_pointer_cast
<
Expansion
>
(
pSrc
);
}
LOCAL_REGIONS_EXPORT
DNekMatSharedPtr
BuildTransformationMatrix
(
const
DNekScalMatSharedPtr
&
r_bnd
,
const
StdRegions
::
MatrixType
matrixType
);
...
...
@@ -76,6 +102,19 @@ namespace Nektar
const
DNekScalMatSharedPtr
&
r_bnd
);
protected:
SpatialDomains
::
GeometrySharedPtr
m_geom
;
SpatialDomains
::
GeomFactorsSharedPtr
m_metricinfo
;
MetricMap
m_metrics
;
void
ComputeLaplacianMetric
();
void
ComputeQuadratureMetric
();
virtual
void
v_MultiplyByQuadratureMetric
(
const
Array
<
OneD
,
const
NekDouble
>
&
inarray
,
Array
<
OneD
,
NekDouble
>
&
outarray
);
virtual
void
v_ComputeLaplacianMetric
()
{};
virtual
DNekScalMatSharedPtr
v_GetLocMatrix
(
const
LocalRegions
::
MatrixKey
&
mkey
);
virtual
DNekMatSharedPtr
v_BuildTransformationMatrix
(
...
...
library/LocalRegions/Expansion0D.cpp
View file @
c6280ab0
...
...
@@ -39,7 +39,7 @@ namespace Nektar
{
namespace
LocalRegions
{
Expansion0D
::
Expansion0D
()
:
StdExpansion
(),
Expansion
(),
Expansion0D
::
Expansion0D
(
SpatialDomains
::
Geometry0DSharedPtr
pGeom
)
:
StdExpansion
(),
Expansion
(
pGeom
),
StdExpansion0D
()
{
m_elementVertexLeft
=
-
1
;
...
...
library/LocalRegions/Expansion0D.h
View file @
c6280ab0
...
...
@@ -40,15 +40,21 @@
#include <StdRegions/StdExpansion0D.h>
#include <LocalRegions/LocalRegionsDeclspec.h>
#include <LocalRegions/Expansion1D.h>
#include <SpatialDomains/Geometry0D.h>
namespace
Nektar
{
namespace
LocalRegions
{
class
Expansion0D
;
typedef
boost
::
shared_ptr
<
Expansion0D
>
Expansion0DSharedPtr
;
typedef
std
::
vector
<
Expansion0DSharedPtr
>
Expansion0DVector
;
typedef
std
::
vector
<
Expansion0DSharedPtr
>::
iterator
Expansion0DVectorIter
;
class
Expansion0D
:
virtual
public
Expansion
,
virtual
public
StdRegions
::
StdExpansion0D
{
public:
LOCAL_REGIONS_EXPORT
Expansion0D
();
LOCAL_REGIONS_EXPORT
Expansion0D
(
SpatialDomains
::
Geometry0DSharedPtr
pGeom
);
LOCAL_REGIONS_EXPORT
virtual
~
Expansion0D
()
{}
...
...
@@ -64,6 +70,13 @@ namespace Nektar
int
vertex
,
Expansion1DSharedPtr
&
v
);
inline
SpatialDomains
::
Geometry0DSharedPtr
GetGeom0D
()
const
;
static
Expansion0DSharedPtr
FromStdExp
(
const
StdRegions
::
StdExpansionSharedPtr
&
pSrc
)
{
return
boost
::
dynamic_pointer_cast
<
Expansion0D
>
(
pSrc
);
}
protected:
private:
...
...
@@ -73,11 +86,6 @@ namespace Nektar
int
m_elementVertexRight
;