Nektar++
Loading...
Searching...
No Matches
library
LocalRegions
PointExp.cpp
Go to the documentation of this file.
1
///////////////////////////////////////////////////////////////////////////////
2
//
3
// File: PointExp.cpp
4
//
5
// For more information, please see: http://www.nektar.info
6
//
7
// The MIT License
8
//
9
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10
// Department of Aeronautics, Imperial College London (UK), and Scientific
11
// Computing and Imaging Institute, University of Utah (USA).
12
//
13
// Permission is hereby granted, free of charge, to any person obtaining a
14
// copy of this software and associated documentation files (the "Software"),
15
// to deal in the Software without restriction, including without limitation
16
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17
// and/or sell copies of the Software, and to permit persons to whom the
18
// Software is furnished to do so, subject to the following conditions:
19
//
20
// The above copyright notice and this permission notice shall be included
21
// in all copies or substantial portions of the Software.
22
//
23
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29
// DEALINGS IN THE SOFTWARE.
30
//
31
// Description: Definition of a Point expansion
32
//
33
///////////////////////////////////////////////////////////////////////////////
34
35
#include <
LocalRegions/PointExp.h
>
36
37
namespace
Nektar::LocalRegions
38
{
39
40
PointExp::PointExp
(
SpatialDomains::Geometry0D
*geom)
41
: StdExpansion(1, 0), StdExpansion0D(), StdRegions::StdPointExp(),
42
Expansion
(geom),
Expansion0D
(geom)
43
{
44
m_ncoeffs
= 1;
45
}
46
47
void
PointExp::v_GetCoords
(
Array<OneD, NekDouble>
&coords_0,
48
Array<OneD, NekDouble>
&coords_1,
49
Array<OneD, NekDouble>
&coords_2)
50
{
51
ASSERTL1
(coords_0.size() > 0,
"Coords_0 is of insufficient size."
);
52
ASSERTL1
(
GetCoordim
() < 2 || coords_1.size() > 0,
53
"Coords_1 is of insufficient size."
);
54
ASSERTL1
(
GetCoordim
() < 3 || coords_2.size() > 0,
55
"Coords_2 is of insufficient size."
);
56
57
auto
v =
static_cast<
SpatialDomains::PointGeom
*
>
(
m_geom
);
58
NekDouble
tmp;
59
switch
(
GetCoordim
())
60
{
61
case
1:
62
v->
GetCoords
(coords_0[0], tmp, tmp);
63
break
;
64
case
2:
65
v->GetCoords(coords_0[0], coords_1[0], tmp);
66
break
;
67
case
3:
68
v->GetCoords(coords_0[0], coords_1[0], coords_2[0]);
69
break
;
70
}
71
}
72
73
void
PointExp::v_NormVectorIProductWRTBase
(
74
const
Array<OneD, const NekDouble>
&Fx,
Array<OneD, NekDouble>
&outarray)
75
{
76
const
Array<OneD, const Array<OneD, NekDouble>
> &normals =
77
GetLeftAdjacentElementExp
()->GetTraceNormal(
78
GetLeftAdjacentElementTrace
());
79
outarray[0] = Fx[0] * normals[0][0];
80
}
81
82
}
// namespace Nektar::LocalRegions
ASSERTL1
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition
ErrorUtil.hpp:250
PointExp.h
Nektar::Array
Definition
BasicUtils/SharedArray.hpp:57
Nektar::LocalRegions::Expansion0D
Definition
Expansion0D.h:52
Nektar::LocalRegions::Expansion
Definition
Expansion.h:72
Nektar::LocalRegions::Expansion::GetLeftAdjacentElementExp
ExpansionSharedPtr GetLeftAdjacentElementExp() const
Definition
Expansion.h:447
Nektar::LocalRegions::Expansion::m_geom
SpatialDomains::Geometry * m_geom
Definition
Expansion.h:279
Nektar::LocalRegions::Expansion::GetLeftAdjacentElementTrace
int GetLeftAdjacentElementTrace() const
Definition
Expansion.h:460
Nektar::LocalRegions::PointExp::PointExp
PointExp(SpatialDomains::Geometry0D *m_geom)
Definition
PointExp.cpp:40
Nektar::LocalRegions::PointExp::v_GetCoords
void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2) override
Definition
PointExp.cpp:47
Nektar::LocalRegions::PointExp::v_NormVectorIProductWRTBase
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray) override
Definition
PointExp.cpp:73
Nektar::SpatialDomains::Geometry0D
1D geometry information
Definition
Geometry0D.h:47
Nektar::SpatialDomains::PointGeom
Definition
PointGeom.h:51
Nektar::SpatialDomains::PointGeom::GetCoords
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition
PointGeom.cpp:69
Nektar::StdRegions::StdExpansion::m_ncoeffs
int m_ncoeffs
Definition
StdExpansion.h:1188
Nektar::StdRegions::StdExpansion::GetCoordim
int GetCoordim()
Definition
StdExpansion.h:673
Nektar::LocalRegions
Definition
StdExpansion.h:50
Nektar::NekDouble
double NekDouble
Definition
NektarUnivTypeDefs.hpp:43
Generated on Sun Nov 9 2025 20:16:58 for Nektar++ by
1.9.8