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
f51437ec
Commit
f51437ec
authored
11 years ago
by
Nicolas Marsic
Browse files
Options
Downloads
Patches
Plain Diff
Clever (but not super awesome) way to handle mutliple FS (dof type offset)
parent
164be46b
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
+23
-2
23 additions, 2 deletions
FunctionSpace/FunctionSpace.cpp
FunctionSpace/FunctionSpace.h
+4
-3
4 additions, 3 deletions
FunctionSpace/FunctionSpace.h
with
27 additions
and
5 deletions
FunctionSpace/FunctionSpace.cpp
+
23
−
2
View file @
f51437ec
...
@@ -13,8 +13,6 @@ const size_t FunctionSpace::nGeoType = 9;
...
@@ -13,8 +13,6 @@ const size_t FunctionSpace::nGeoType = 9;
size_t
FunctionSpace
::
nxtOffset
=
0
;
size_t
FunctionSpace
::
nxtOffset
=
0
;
FunctionSpace
::
FunctionSpace
(
void
){
FunctionSpace
::
FunctionSpace
(
void
){
offset
=
nxtOffset
;
nxtOffset
+=
21
;
}
}
FunctionSpace
::~
FunctionSpace
(
void
){
FunctionSpace
::~
FunctionSpace
(
void
){
...
@@ -24,6 +22,9 @@ FunctionSpace::~FunctionSpace(void){
...
@@ -24,6 +22,9 @@ FunctionSpace::~FunctionSpace(void){
}
}
void
FunctionSpace
::
build
(
const
GroupOfElement
&
goe
,
string
family
){
void
FunctionSpace
::
build
(
const
GroupOfElement
&
goe
,
string
family
){
// Save Dof type offset //
offset
=
nxtOffset
;
// Save GroupOfElement & Mesh //
// Save GroupOfElement & Mesh //
this
->
goe
=
&
goe
;
this
->
goe
=
&
goe
;
this
->
mesh
=
&
(
goe
.
getMesh
());
this
->
mesh
=
&
(
goe
.
getMesh
());
...
@@ -79,6 +80,10 @@ void FunctionSpace::build(const GroupOfElement& goe, string family){
...
@@ -79,6 +80,10 @@ void FunctionSpace::build(const GroupOfElement& goe, string family){
// Build Dof //
// Build Dof //
buildDof
();
buildDof
();
// Find next next offset //
size_t
maxType
=
findMaxType
();
nxtOffset
+=
maxType
+
1
;
}
}
void
FunctionSpace
::
buildDof
(
void
){
void
FunctionSpace
::
buildDof
(
void
){
...
@@ -98,6 +103,22 @@ void FunctionSpace::buildDof(void){
...
@@ -98,6 +103,22 @@ void FunctionSpace::buildDof(void){
}
}
}
}
size_t
FunctionSpace
::
findMaxType
(
void
){
// Maximum type //
size_t
maxType
=
0
;
// Iterate for dof //
const
set
<
Dof
>::
iterator
end
=
dof
.
end
();
set
<
Dof
>::
iterator
it
=
dof
.
begin
();
for
(;
it
!=
end
;
it
++
)
// If this type is bigger, it becomes the new 'maxType'
if
(
it
->
getType
()
>
maxType
)
maxType
=
it
->
getType
();
return
maxType
;
}
vector
<
Dof
>
FunctionSpace
::
getUnorderedKeys
(
const
MElement
&
elem
)
const
{
vector
<
Dof
>
FunctionSpace
::
getUnorderedKeys
(
const
MElement
&
elem
)
const
{
// Const_Cast //
// Const_Cast //
MElement
&
element
=
const_cast
<
MElement
&>
(
elem
);
MElement
&
element
=
const_cast
<
MElement
&>
(
elem
);
...
...
This diff is collapsed.
Click to expand it.
FunctionSpace/FunctionSpace.h
+
4
−
3
View file @
f51437ec
...
@@ -30,7 +30,7 @@ class GroupOfElement;
...
@@ -30,7 +30,7 @@ class GroupOfElement;
class
FunctionSpace
{
class
FunctionSpace
{
protected:
protected:
// Number of possible geomtrical topologies //
// Number of possible geomtrical topologies
& Dof Type offset
//
static
const
size_t
nGeoType
;
static
const
size_t
nGeoType
;
static
size_t
nxtOffset
;
static
size_t
nxtOffset
;
...
@@ -79,8 +79,9 @@ class FunctionSpace{
...
@@ -79,8 +79,9 @@ class FunctionSpace{
protected:
protected:
FunctionSpace
(
void
);
FunctionSpace
(
void
);
void
build
(
const
GroupOfElement
&
goe
,
std
::
string
family
);
void
build
(
const
GroupOfElement
&
goe
,
std
::
string
family
);
void
buildDof
(
void
);
void
buildDof
(
void
);
size_t
findMaxType
(
void
);
std
::
vector
<
Dof
>
getUnorderedKeys
(
const
MElement
&
element
)
const
;
std
::
vector
<
Dof
>
getUnorderedKeys
(
const
MElement
&
element
)
const
;
};
};
...
...
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