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
af50a1c6
Commit
af50a1c6
authored
15 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
dd2228bb
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
Geo/GRegionCompound.cpp
+84
-0
84 additions, 0 deletions
Geo/GRegionCompound.cpp
Geo/GRegionCompound.h
+44
-0
44 additions, 0 deletions
Geo/GRegionCompound.h
with
128 additions
and
0 deletions
Geo/GRegionCompound.cpp
0 → 100644
+
84
−
0
View file @
af50a1c6
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
//
// Contributor(s):
// Emilie Marchandise
//
#include
<stdlib.h>
#include
"GmshConfig.h"
#include
"GRegionCompound.h"
#include
"Numeric.h"
GRegionCompound
::
GRegionCompound
(
GModel
*
m
,
int
tag
,
std
::
vector
<
GRegion
*>
&
compound
)
:
GRegion
(
m
,
tag
),
_compound
(
compound
)
{
printf
(
"********* In GRegion compound size =%d
\n
"
,
_compound
.
size
());
getBoundingFaces
();
}
GRegionCompound
::~
GRegionCompound
()
{
}
void
GRegionCompound
::
getBoundingFaces
(){
std
::
set
<
GFace
*>
_unique
;
std
::
multiset
<
GFace
*>
_touched
;
std
::
vector
<
GRegion
*>::
iterator
it
=
_compound
.
begin
();
for
(
;
it
!=
_compound
.
end
();
++
it
){
printf
(
"face %d
\n
"
,
(
*
it
)
->
tag
());
std
::
list
<
GFace
*>
ed
=
(
*
it
)
->
faces
();
std
::
list
<
GFace
*>
::
iterator
ite
=
ed
.
begin
();
for
(
;
ite
!=
ed
.
end
();
++
ite
){
_touched
.
insert
(
*
ite
);
}
}
it
=
_compound
.
begin
();
for
(
;
it
!=
_compound
.
end
();
++
it
){
std
::
list
<
GFace
*>
ed
=
(
*
it
)
->
faces
();
std
::
list
<
GFace
*>
::
iterator
ite
=
ed
.
begin
();
for
(
;
ite
!=
ed
.
end
()
;
++
ite
){
if
(
!
(
*
ite
)
->
degenerate
(
0
)
&&
_touched
.
count
(
*
ite
)
==
1
)
{
_unique
.
insert
(
*
ite
);
}
}
}
std
::
set
<
GFace
*>::
iterator
itf
=
_unique
.
begin
();
for
(
;
itf
!=
_unique
.
end
();
++
itf
){
l_faces
.
push_back
(
*
itf
);
printf
(
"for face %d, add region %d
\n
"
,
(
*
itf
)
->
tag
(),
this
->
tag
());
(
*
itf
)
->
addRegion
(
this
);
}
}
SBoundingBox3d
GRegionCompound
::
bounds
()
const
{
Msg
::
Error
(
"Cannot evaluate bounds on GRegion Compound"
);
return
SBoundingBox3d
(
SPoint3
());
}
double
GRegionCompound
::
curvature
(
double
par
)
const
{
double
k
=
0.0
;
Msg
::
Error
(
"Cannot evaluate curvature on GRegionCompound"
);
return
k
;
}
GPoint
GRegionCompound
::
point
(
double
par
)
const
{
Msg
::
Error
(
"Cannot evaluate point on GRegionCompound"
);
return
GPoint
();
}
SVector3
GRegionCompound
::
firstDer
(
double
par
)
const
{
Msg
::
Error
(
"Cannot evaluate firstDeriv on GRegionCompound"
);
return
SVector3
();
}
This diff is collapsed.
Click to expand it.
Geo/GRegionCompound.h
0 → 100644
+
44
−
0
View file @
af50a1c6
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _GREGION_COMPOUND_H_
#define _GREGION_COMPOUND_H_
#include
<list>
#include
<map>
#include
"GRegion.h"
#include
"GFace.h"
#include
"GFaceCompound.h"
/*
A GRegionCompound is a model region that is the compound of model regions.
It is assumed that all the regions of the compound have been meshed
first and that all the faces of the compound region are compound surfaces.
The compound can therefore be re-meshed using any surface mesh
generator of gmsh!
*/
class
GRegionCompound
:
public
GRegion
{
public:
GRegionCompound
(
GModel
*
m
,
int
tag
,
std
::
vector
<
GRegion
*>
&
compound
);
virtual
~
GRegionCompound
();
virtual
SBoundingBox3d
bounds
()
const
;
virtual
double
curvature
(
double
t
)
const
;
virtual
GPoint
point
(
double
par
)
const
;
virtual
SVector3
firstDer
(
double
par
)
const
;
virtual
GEntity
::
GeomType
geomType
()
const
{
return
CompoundVolume
;
}
ModelType
getNativeType
()
const
{
return
GmshModel
;
}
void
*
getNativePtr
()
const
{
return
0
;
}
protected
:
std
::
vector
<
GRegion
*>
_compound
;
void
getBoundingFaces
();
};
#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