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
d26697cd
Commit
d26697cd
authored
12 years ago
by
Nicolas Marsic
Browse files
Options
Downloads
Patches
Plain Diff
DofManager & FunctionSpace cleaning
parent
1d57728b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FunctionSpace/FunctionSpace.cpp
+17
-53
17 additions, 53 deletions
FunctionSpace/FunctionSpace.cpp
FunctionSpace/FunctionSpace.h
+13
-17
13 additions, 17 deletions
FunctionSpace/FunctionSpace.h
with
30 additions
and
70 deletions
FunctionSpace/FunctionSpace.cpp
+
17
−
53
View file @
d26697cd
...
@@ -4,24 +4,22 @@
...
@@ -4,24 +4,22 @@
using
namespace
std
;
using
namespace
std
;
FunctionSpace
::
FunctionSpace
(
const
GroupOfElement
&
goe
,
int
basisType
,
int
order
){
FunctionSpace
::
FunctionSpace
(
const
GroupOfElement
&
goe
,
int
basisType
,
int
order
){
// DofManager //
dofM
=
NULL
;
// Save GroupOfElement //
// Save GroupOfElement //
this
->
goe
=
&
goe
;
this
->
goe
=
&
goe
;
// Look for 1st element to get element type //
// Get Geo Data (WARNING HOMOGENE MESH REQUIRED)//
// (We suppose only one type of Mesh !!) //
MElement
&
element
=
goe
.
get
(
0
);
int
elementType
=
goe
.
get
(
0
).
getType
();
int
elementType
=
element
.
getType
();
int
nVertex
=
element
.
getNumVertices
();
int
nEdge
=
element
.
getNumEdges
();
int
nFace
=
element
.
getNumFaces
();
nTotVertex
=
goe
.
getNVertex
();
// Init Struct //
// Init Struct //
type
=
basisType
;
type
=
basisType
;
basis
=
BasisGenerator
::
generate
(
elementType
,
basisType
,
order
);
basis
=
BasisGenerator
::
generate
(
elementType
,
basisType
,
// Count Function per Entity //
order
);
int
nVertex
=
goe
.
get
(
0
).
getNumVertices
();
int
nEdge
=
goe
.
get
(
0
).
getNumEdges
();
int
nFace
=
goe
.
get
(
0
).
getNumFaces
();
fPerVertex
=
basis
->
getNVertexBased
()
/
nVertex
;
fPerVertex
=
basis
->
getNVertexBased
()
/
nVertex
;
// NB: fPreVertex = 0 *or* 1
// NB: fPreVertex = 0 *or* 1
...
@@ -39,10 +37,11 @@ FunctionSpace::FunctionSpace(const GroupOfElement& goe, int basisType, int order
...
@@ -39,10 +37,11 @@ FunctionSpace::FunctionSpace(const GroupOfElement& goe, int basisType, int order
fPerCell
=
basis
->
getNCellBased
();
// We always got 1 cell
fPerCell
=
basis
->
getNCellBased
();
// We always got 1 cell
}
}
const
vector
<
Dof
*>
FunctionSpace
::
getKeys
(
const
MElement
&
elem
)
const
{
FunctionSpace
::~
FunctionSpace
(
void
){
// nTotVertex
delete
basis
;
int
nTotVertex
=
goe
->
getNVertex
();
}
vector
<
Dof
>
FunctionSpace
::
getKeys
(
const
MElement
&
elem
)
const
{
// Const_Cast //
// Const_Cast //
MElement
&
element
=
const_cast
<
MElement
&>
(
elem
);
MElement
&
element
=
const_cast
<
MElement
&>
(
elem
);
...
@@ -79,56 +78,21 @@ const vector<Dof*> FunctionSpace::getKeys(const MElement& elem) const{
...
@@ -79,56 +78,21 @@ const vector<Dof*> FunctionSpace::getKeys(const MElement& elem) const{
int
nDof
=
int
nDof
=
nDofVertex
+
nDofEdge
+
nDofFace
+
nDofCell
;
nDofVertex
+
nDofEdge
+
nDofFace
+
nDofCell
;
vector
<
Dof
*
>
myDof
(
nDof
);
vector
<
Dof
>
myDof
(
nDof
);
int
it
=
0
;
int
it
=
0
;
// Add Vertex Based Dof //
// Add Vertex Based Dof //
for
(
int
i
=
0
;
i
<
nVertex
;
i
++
){
for
(
int
i
=
0
;
i
<
nVertex
;
i
++
){
// Get Id of Vertex
const
int
id
=
vertex
[
i
]
->
getNum
();
// New Dof
for
(
int
j
=
0
;
j
<
nFVertex
;
j
++
){
for
(
int
j
=
0
;
j
<
nFVertex
;
j
++
){
myDof
[
it
]
=
new
Dof
(
id
,
j
);
myDof
[
it
].
setDof
(
vertex
[
i
]
->
getNum
(),
j
);
it
++
;
}
}
// Add Edge Based Dof //
for
(
int
i
=
0
;
i
<
nEdge
;
i
++
){
// Get Id of Edge
MVertex
*
vEdge0
=
edge
[
i
].
getSortedVertex
(
0
);
MVertex
*
vEdge1
=
edge
[
i
].
getSortedVertex
(
1
);
const
int
id
=
vEdge0
->
getNum
()
+
vEdge1
->
getNum
()
*
nTotVertex
;
// Insert new Dof
for
(
int
j
=
0
;
j
<
nFEdge
;
j
++
){
myDof
[
it
]
=
new
Dof
(
id
,
j
);
it
++
;
it
++
;
}
}
}
// Add Cell Based Dof //
// Get Id of Cell
const
int
id
=
element
.
getNum
()
*
nTotVertex
*
nTotVertex
;
// Insert new Dof
for
(
int
j
=
0
;
j
<
nFCell
;
j
++
){
myDof
[
it
]
=
new
Dof
(
id
,
j
);
it
++
;
}
}
return
myDof
;
return
myDof
;
}
}
FunctionSpace
::~
FunctionSpace
(
void
){
delete
basis
;
}
/*
/*
#include "Polynomial.h"
#include "Polynomial.h"
#include "BasisScalar.h"
#include "BasisScalar.h"
...
...
This diff is collapsed.
Click to expand it.
FunctionSpace/FunctionSpace.h
+
13
−
17
View file @
d26697cd
...
@@ -4,10 +4,12 @@
...
@@ -4,10 +4,12 @@
#include
<vector>
#include
<vector>
#include
"Basis.h"
#include
"Basis.h"
#include
"Dof.h"
#include
"GroupOfElement.h"
#include
"GroupOfElement.h"
#include
"MElement.h"
#include
"MElement.h"
#include
"Dof.h"
#include
"MVertex.h"
#include
"DofManager.h"
#include
"MEdge.h"
#include
"MFace.h"
/**
/**
@class FunctionSpace
@class FunctionSpace
...
@@ -19,22 +21,18 @@
...
@@ -19,22 +21,18 @@
Hybrid Mesh@n
Hybrid Mesh@n
*/
*/
class
ElementComparator
;
class
DofManager
;
class
FunctionSpace
{
class
FunctionSpace
{
protected:
protected:
const
Basis
*
basis
;
const
Basis
*
basis
;
const
GroupOfElement
*
goe
;
const
DofManager
*
dofM
;
int
fPerVertex
;
int
fPerVertex
;
int
fPerEdge
;
int
fPerEdge
;
int
fPerFace
;
int
fPerFace
;
int
fPerCell
;
int
fPerCell
;
int
type
;
int
type
;
const
GroupOfElement
*
goe
;
int
nTotVertex
;
public:
public:
FunctionSpace
(
const
GroupOfElement
&
goe
,
FunctionSpace
(
const
GroupOfElement
&
goe
,
int
basisType
,
int
order
);
int
basisType
,
int
order
);
...
@@ -45,14 +43,16 @@ class FunctionSpace{
...
@@ -45,14 +43,16 @@ class FunctionSpace{
const
Basis
&
getBasis
(
const
MElement
&
element
)
const
;
const
Basis
&
getBasis
(
const
MElement
&
element
)
const
;
int
getType
(
void
)
const
;
int
getType
(
void
)
const
;
void
associate
(
const
DofManager
&
dofM
);
const
std
::
vector
<
Dof
*>
getKeys
(
const
MElement
&
element
)
const
;
int
getNFunctionPerVertex
(
const
MElement
&
element
)
const
;
int
getNFunctionPerVertex
(
const
MElement
&
element
)
const
;
int
getNFunctionPerEdge
(
const
MElement
&
element
)
const
;
int
getNFunctionPerEdge
(
const
MElement
&
element
)
const
;
int
getNFunctionPerFace
(
const
MElement
&
element
)
const
;
int
getNFunctionPerFace
(
const
MElement
&
element
)
const
;
int
getNFunctionPerCell
(
const
MElement
&
element
)
const
;
int
getNFunctionPerCell
(
const
MElement
&
element
)
const
;
std
::
vector
<
Dof
>
getKeys
(
const
MElement
&
element
)
const
;
std
::
vector
<
Dof
>
getKeys
(
const
MVertex
&
element
)
const
;
std
::
vector
<
Dof
>
getKeys
(
const
MEdge
&
element
)
const
;
std
::
vector
<
Dof
>
getKeys
(
const
MFace
&
element
)
const
;
/*
/*
void interpolateAtNodes(const MElement& element,
void interpolateAtNodes(const MElement& element,
const std::vector<double>& coef,
const std::vector<double>& coef,
...
@@ -76,10 +76,6 @@ inline int FunctionSpace::getType(void) const{
...
@@ -76,10 +76,6 @@ inline int FunctionSpace::getType(void) const{
return
type
;
return
type
;
}
}
inline
void
FunctionSpace
::
associate
(
const
DofManager
&
dofM
){
this
->
dofM
=
&
dofM
;
}
inline
int
FunctionSpace
::
getNFunctionPerVertex
(
const
MElement
&
element
)
const
{
inline
int
FunctionSpace
::
getNFunctionPerVertex
(
const
MElement
&
element
)
const
{
return
fPerVertex
;
return
fPerVertex
;
}
}
...
...
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