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
a16f4011
Commit
a16f4011
authored
14 years ago
by
Boris Sedji
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
2bc560bc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Solver/groupOfElements.h
+103
-47
103 additions, 47 deletions
Solver/groupOfElements.h
with
103 additions
and
47 deletions
Solver/groupOfElements.h
+
103
−
47
View file @
a16f4011
...
@@ -16,64 +16,120 @@ public:
...
@@ -16,64 +16,120 @@ public:
};
};
class
groupOfElements
{
class
groupOfElements
{
public:
typedef
std
::
set
<
MElement
*>
elementContainer
;
typedef
std
::
set
<
MVertex
*>
vertexContainer
;
private:
vertexContainer
_vertices
;
elementContainer
_elements
;
elementContainer
_parents
;
public:
groupOfElements
(
int
dim
,
int
physical
)
{
addPhysical
(
dim
,
physical
);
}
groupOfElements
(
GFace
*
);
public:
virtual
void
addPhysical
(
int
dim
,
int
physical
)
{
typedef
std
::
set
<
MElement
*>
elementContainer
;
elementFilterTrivial
filter
;
typedef
std
::
set
<
MVertex
*>
vertexContainer
;
addPhysical
(
dim
,
physical
,
filter
);
}
virtual
void
addElementary
(
GEntity
*
ge
,
const
elementFilter
&
f
);
protected:
virtual
void
addPhysical
(
int
dim
,
int
physical
,
const
elementFilter
&
);
vertexContainer
_vertices
;
elementContainer
_elements
;
elementContainer
_parents
;
vertexContainer
::
const_iterator
vbegin
()
const
{
public:
return
_vertices
.
begin
();
}
vertexContainer
::
const_iterator
vend
()
const
{
return
_vertices
.
end
();
}
elementContainer
::
const_iterator
begin
()
const
{
groupOfElements
(){}
return
_elements
.
begin
();
}
groupOfElements
(
int
dim
,
int
physical
)
{
elementContainer
::
const_iterator
end
()
const
{
addPhysical
(
dim
,
physical
);
return
_elements
.
end
();
}
}
size_t
size
()
const
{
groupOfElements
(
GFace
*
);
return
_elements
.
size
();
}
virtual
void
addPhysical
(
int
dim
,
int
physical
)
{
// FIXME : NOT VERY ELEGANT !!!
elementFilterTrivial
filter
;
bool
find
(
MElement
*
e
)
const
{
addPhysical
(
dim
,
physical
,
filter
);
if
(
e
->
getParent
()
&&
_parents
.
find
(
e
->
getParent
())
!=
_parents
.
end
())
return
true
;
}
return
(
_elements
.
find
(
e
)
!=
_elements
.
end
());
}
virtual
void
addElementary
(
GEntity
*
ge
,
const
elementFilter
&
f
);
inline
void
insert
(
MElement
*
e
)
{
_elements
.
insert
(
e
);
virtual
void
addPhysical
(
int
dim
,
int
physical
,
const
elementFilter
&
);
if
(
e
->
getParent
()){
_parents
.
insert
(
e
->
getParent
());
vertexContainer
::
const_iterator
vbegin
()
const
{
for
(
int
i
=
0
;
i
<
e
->
getParent
()
->
getNumVertices
();
i
++
){
return
_vertices
.
begin
();
_vertices
.
insert
(
e
->
getParent
()
->
getVertex
(
i
));
}
vertexContainer
::
const_iterator
vend
()
const
{
return
_vertices
.
end
();
}
elementContainer
::
const_iterator
begin
()
const
{
return
_elements
.
begin
();
}
elementContainer
::
const_iterator
end
()
const
{
return
_elements
.
end
();
}
size_t
size
()
const
{
return
_elements
.
size
();
}
// FIXME : NOT VERY ELEGANT !!!
bool
find
(
MElement
*
e
)
const
// if same parent but different physicals return true ?!
{
if
(
e
->
getParent
()
&&
_parents
.
find
(
e
->
getParent
())
!=
_parents
.
end
())
return
true
;
return
(
_elements
.
find
(
e
)
!=
_elements
.
end
());
}
inline
void
insert
(
MElement
*
e
)
{
_elements
.
insert
(
e
);
if
(
e
->
getParent
()){
_parents
.
insert
(
e
->
getParent
());
for
(
int
i
=
0
;
i
<
e
->
getParent
()
->
getNumVertices
();
i
++
){
_vertices
.
insert
(
e
->
getParent
()
->
getVertex
(
i
));
}
}
else
{
for
(
int
i
=
0
;
i
<
e
->
getNumVertices
();
i
++
){
_vertices
.
insert
(
e
->
getVertex
(
i
));
}
}
}
}
}
else
{
};
for
(
int
i
=
0
;
i
<
e
->
getNumVertices
();
i
++
){
_vertices
.
insert
(
e
->
getVertex
(
i
));
// child elements in pElem restricted to elements who have parent in sElem
class
groupOfLagMultElements
:
public
groupOfElements
{
private
:
void
fillElementContainer
(
groupOfElements
&
pElem
,
groupOfElements
&
sElem
)
{
groupOfElements
::
elementContainer
::
iterator
itp
=
pElem
.
begin
();
for
(;
itp
!=
pElem
.
end
();
itp
++
)
{
MElement
*
ep
;
if
((
*
itp
)
->
getParent
())
{
if
(
sElem
.
find
(
*
itp
))
insert
((
*
itp
))
;
// warning : find method used to check if parent is in sElem
}
}
else
std
::
cout
<<
"groupOfLagMultElements : Warning, level set element has no parent ?! "
<<
std
::
endl
;
}
}
}
}
public
:
groupOfLagMultElements
(
int
dim
,
int
physical
,
groupOfElements
&
sElem
)
:
groupOfElements
()
{
groupOfElements
pElem
(
dim
,
physical
);
fillElementContainer
(
pElem
,
sElem
);
}
groupOfLagMultElements
(
int
dim
,
int
physical
,
std
::
vector
<
groupOfElements
*>
sElem
)
:
groupOfElements
()
{
groupOfElements
pElem
(
dim
,
physical
);
for
(
int
i
;
i
<
sElem
.
size
()
;
i
++
)
{
fillElementContainer
(
pElem
,(
*
sElem
[
i
]));
}
}
};
};
#endif
#endif
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