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
Package registry
Model registry
Operate
Terraform modules
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
Romin Tomasetti
gmsh
Commits
ba01e291
Commit
ba01e291
authored
8 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
plugin to get gauss points
parent
980c1541
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Plugin/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Plugin/CMakeLists.txt
Plugin/GaussPoints.cpp
+94
-0
94 additions, 0 deletions
Plugin/GaussPoints.cpp
Plugin/GaussPoints.h
+32
-0
32 additions, 0 deletions
Plugin/GaussPoints.h
Plugin/PluginManager.cpp
+3
-0
3 additions, 0 deletions
Plugin/PluginManager.cpp
with
130 additions
and
0 deletions
Plugin/CMakeLists.txt
+
1
−
0
View file @
ba01e291
...
@@ -37,6 +37,7 @@ set(SRC
...
@@ -37,6 +37,7 @@ set(SRC
MeshSubEntities.cpp
MeshSubEntities.cpp
CVTRemesh.cpp
CVTRemesh.cpp
ShowNeighborElements.cpp
ShowNeighborElements.cpp
GaussPoints.cpp
)
)
file
(
GLOB HDR RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.h
)
file
(
GLOB HDR RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.h
)
...
...
This diff is collapsed.
Click to expand it.
Plugin/GaussPoints.cpp
0 → 100644
+
94
−
0
View file @
ba01e291
// Gmsh - Copyright (C) 1997-2016 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
#include
"GaussPoints.h"
#include
"GModel.h"
#include
"MElement.h"
#include
"PView.h"
StringXNumber
GaussPointsOptions_Number
[]
=
{
{
GMSH_FULLRC
,
"Order"
,
NULL
,
0
},
{
GMSH_FULLRC
,
"Dimension"
,
NULL
,
2
},
{
GMSH_FULLRC
,
"PhysicalGroup"
,
NULL
,
0
}
};
extern
"C"
{
GMSH_Plugin
*
GMSH_RegisterGaussPointsPlugin
()
{
return
new
GMSH_GaussPointsPlugin
();
}
}
int
GMSH_GaussPointsPlugin
::
getNbOptions
()
const
{
return
sizeof
(
GaussPointsOptions_Number
)
/
sizeof
(
StringXNumber
);
}
StringXNumber
*
GMSH_GaussPointsPlugin
::
getOption
(
int
iopt
)
{
return
&
GaussPointsOptions_Number
[
iopt
];
}
std
::
string
GMSH_GaussPointsPlugin
::
getHelp
()
const
{
return
"Given an input mesh, Plugin(GaussPoints) creates a view containing "
"the Gauss points for a given polynomial `Order'.
\n\n
"
"If `PhysicalGroup' is nonzero, the plugin only creates points for the "
"elements belonging to the group."
;
}
PView
*
GMSH_GaussPointsPlugin
::
execute
(
PView
*
v
)
{
int
order
=
(
int
)
GaussPointsOptions_Number
[
0
].
def
;
int
dim
=
(
int
)
GaussPointsOptions_Number
[
1
].
def
;
int
physical
=
(
int
)
GaussPointsOptions_Number
[
2
].
def
;
GModel
*
m
=
GModel
::
current
();
std
::
vector
<
GEntity
*>
entities
;
if
(
physical
){
std
::
map
<
int
,
std
::
vector
<
GEntity
*>
>
groups
[
4
];
m
->
getPhysicalGroups
(
groups
);
entities
=
groups
[
dim
][
physical
];
}
else
{
m
->
getEntities
(
entities
,
dim
);
}
if
(
entities
.
empty
()){
Msg
::
Error
(
"No entities"
);
return
v
;
}
PView
*
v2
=
new
PView
();
PViewDataList
*
data2
=
getDataList
(
v2
);
for
(
unsigned
int
i
=
0
;
i
<
entities
.
size
();
i
++
){
for
(
unsigned
int
j
=
0
;
j
<
entities
[
i
]
->
getNumMeshElements
();
j
++
){
MElement
*
e
=
entities
[
i
]
->
getMeshElement
(
j
);
int
npts
;
IntPt
*
gp
;
e
->
getIntegrationPoints
(
order
,
&
npts
,
&
gp
);
for
(
int
i
=
0
;
i
<
npts
;
i
++
){
double
u
=
gp
[
i
].
pt
[
0
];
double
v
=
gp
[
i
].
pt
[
1
];
double
w
=
gp
[
i
].
pt
[
2
];
double
weight
=
gp
[
i
].
weight
;
SPoint3
p
;
e
->
pnt
(
u
,
v
,
w
,
p
);
data2
->
SP
.
push_back
(
p
.
x
());
data2
->
SP
.
push_back
(
p
.
y
());
data2
->
SP
.
push_back
(
p
.
z
());
data2
->
SP
.
push_back
(
e
->
getNum
());
data2
->
NbSP
++
;
}
}
}
data2
->
setName
(
"GaussPoints"
);
data2
->
setFileName
(
"GaussPoints.pos"
);
data2
->
finalize
();
return
v
;
}
This diff is collapsed.
Click to expand it.
Plugin/GaussPoints.h
0 → 100644
+
32
−
0
View file @
ba01e291
// Gmsh - Copyright (C) 1997-2016 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
#ifndef _GAUSS_POINTS_H_
#define _GAUSS_POINTS_H_
#include
"Plugin.h"
extern
"C"
{
GMSH_Plugin
*
GMSH_RegisterGaussPointsPlugin
();
}
class
GMSH_GaussPointsPlugin
:
public
GMSH_PostPlugin
{
public:
GMSH_GaussPointsPlugin
(){}
std
::
string
getName
()
const
{
return
"GaussPoints"
;
}
std
::
string
getShortHelp
()
const
{
return
"Gauss points"
;
}
std
::
string
getHelp
()
const
;
int
getNbOptions
()
const
;
StringXNumber
*
getOption
(
int
iopt
);
PView
*
execute
(
PView
*
);
};
#endif
This diff is collapsed.
Click to expand it.
Plugin/PluginManager.cpp
+
3
−
0
View file @
ba01e291
...
@@ -66,6 +66,7 @@
...
@@ -66,6 +66,7 @@
#include
"MeshSubEntities.h"
#include
"MeshSubEntities.h"
#include
"CVTRemesh.h"
#include
"CVTRemesh.h"
#include
"ShowNeighborElements.h"
#include
"ShowNeighborElements.h"
#include
"GaussPoints.h"
// for testing purposes only :-)
// for testing purposes only :-)
#undef HAVE_DLOPEN
#undef HAVE_DLOPEN
...
@@ -266,6 +267,8 @@ void PluginManager::registerDefaultPlugins()
...
@@ -266,6 +267,8 @@ void PluginManager::registerDefaultPlugins()
(
"ShowNeighborElements"
,
GMSH_RegisterShowNeighborElementsPlugin
()));
(
"ShowNeighborElements"
,
GMSH_RegisterShowNeighborElementsPlugin
()));
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
(
"MeshSubEntities"
,
GMSH_RegisterMeshSubEntitiesPlugin
()));
(
"MeshSubEntities"
,
GMSH_RegisterMeshSubEntitiesPlugin
()));
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
(
"GaussPoints"
,
GMSH_RegisterGaussPointsPlugin
()));
#if defined(HAVE_MESH)
#if defined(HAVE_MESH)
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
allPlugins
.
insert
(
std
::
pair
<
std
::
string
,
GMSH_Plugin
*>
(
"AnalyseCurvedMesh"
,
GMSH_RegisterAnalyseCurvedMeshPlugin
()));
(
"AnalyseCurvedMesh"
,
GMSH_RegisterAnalyseCurvedMeshPlugin
()));
...
...
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