Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
d8ef2a52
Commit
d8ef2a52
authored
12 years ago
by
Nicolas Marsic
Browse files
Options
Downloads
Patches
Plain Diff
Fix for getElementType()
parent
6f9f7314
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FunctionSpace/FunctionSpace.cpp
+19
-8
19 additions, 8 deletions
FunctionSpace/FunctionSpace.cpp
FunctionSpace/FunctionSpace.h
+1
-0
1 addition, 0 deletions
FunctionSpace/FunctionSpace.h
with
20 additions
and
8 deletions
FunctionSpace/FunctionSpace.cpp
+
19
−
8
View file @
d8ef2a52
#include
"FunctionSpace.h"
#include
"FunctionSpace.h"
#include
"BasisGenerator.h"
#include
"BasisGenerator.h"
using
namespace
std
;
using
namespace
std
;
FunctionSpace
::
FunctionSpace
(
void
){
FunctionSpace
::
FunctionSpace
(
void
){
...
@@ -31,7 +32,8 @@ void FunctionSpace::build(const GroupOfElement& goe,
...
@@ -31,7 +32,8 @@ void FunctionSpace::build(const GroupOfElement& goe,
basis
=
BasisGenerator
::
generate
(
elementType
,
basis
=
BasisGenerator
::
generate
(
elementType
,
basisType
,
basisType
,
order
);
order
);
// Number of *Per* Entity functions //
fPerVertex
=
basis
->
getNVertexBased
()
/
nVertex
;
fPerVertex
=
basis
->
getNVertexBased
()
/
nVertex
;
// NB: fPreVertex = 0 *or* 1
// NB: fPreVertex = 0 *or* 1
...
@@ -124,18 +126,27 @@ vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{
...
@@ -124,18 +126,27 @@ vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{
}
}
int
FunctionSpace
::
getElementType
(
const
Dof
&
dof
)
const
{
int
FunctionSpace
::
getElementType
(
const
Dof
&
dof
)
const
{
const
unsigned
int
type
=
dof
.
getType
();
// Get Entity //
const
unsigned
int
entity
=
dof
.
getEntity
();
if
(
type
<
fPerVertex
)
// Vertex Based
// Total Number of Entities //
const
unsigned
int
nVertex
=
mesh
->
getVertexNumber
();
const
unsigned
int
nEdge
=
mesh
->
getEdgeNumber
();
const
unsigned
int
nFace
=
mesh
->
getFaceNumber
();
// Vertex Based
if
(
entity
<
nVertex
)
return
0
;
return
0
;
else
if
(
type
<
fPerEdge
)
// Edge Based
// Edge Based
else
if
(
entity
<
nVertex
+
nEdge
)
return
1
;
return
1
;
else
if
(
type
<
fPerFace
)
// Face Based
// Face Based
else
if
(
entity
<
nVertex
+
nEdge
+
nFace
)
return
2
;
return
2
;
else
// Cell Based
// Cell Based
else
return
3
;
return
3
;
}
}
This diff is collapsed.
Click to expand it.
FunctionSpace/FunctionSpace.h
+
1
−
0
View file @
d8ef2a52
...
@@ -44,6 +44,7 @@ class FunctionSpace{
...
@@ -44,6 +44,7 @@ class FunctionSpace{
unsigned
int
fPerEdge
;
unsigned
int
fPerEdge
;
unsigned
int
fPerFace
;
unsigned
int
fPerFace
;
unsigned
int
fPerCell
;
unsigned
int
fPerCell
;
unsigned
int
type
;
unsigned
int
type
;
public:
public:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment