Compare commits

...

26 Commits

Author SHA1 Message Date
vsr
b66afe6860 Implement 'make dist' and 'make distcheck' steps support 2008-09-16 10:56:24 +00:00
eap
8c0d5f2b5c [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D
add 2 hypotheses
2008-09-16 09:33:25 +00:00
eap
6d0e6cdf38 [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D
add 2 hypotheses and support submeshes
2008-09-16 09:07:55 +00:00
eap
b3a86141bf [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D
+	NETGENPlugin_SimpleHypothesis_2D.cxx \
+	NETGENPlugin_SimpleHypothesis_3D.cxx \
+	NETGENPlugin_SimpleHypothesis_2D_i.cxx \
+	NETGENPlugin_SimpleHypothesis_3D_i.cxx \
2008-09-16 09:05:25 +00:00
eap
82e450db91 [SALOME platform 0013410]: SubMesh not taken into account with Netgen 1D-2D et 1D-2D-3D
patch NETGEN to support submeshes
2008-09-16 09:04:59 +00:00
vsr
0bd29bc595 Issue 0019955: put latest patches for netgen 4.5 2008-08-26 11:40:10 +00:00
vsr
a8e590fdc3 Fix combo box model problems 2008-07-28 13:47:42 +00:00
vsr
1f02bc8fb3 Remove obsolete files 2008-07-28 07:04:24 +00:00
vsr
1bf863ac26 Merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev_08Jul08) 2008-07-28 06:29:05 +00:00
mkr
23f07d64cc Salome5x : fix for bug IPAL13068 : There is no help page for "Hypothesis Construction" dlg for "Netgen 1D-2D-3D" hypothesis. 2008-07-01 05:23:04 +00:00
vsr
d282e89310 Change version number : 5.0.0 2008-04-25 08:09:40 +00:00
mkr
fc90ba3687 Qt4 porting. 2008-03-24 15:26:49 +00:00
mkr
045264aff0 Merge from BR_Dev_For_4_0. 2008-03-24 11:48:15 +00:00
admin
22cc72b40c This commit was generated by cvs2git to create branch 'BR_QT4_Dev'.
Sprout from BR_Dev_For_4_0 2007-04-24 14:54:27 UTC abd <abd@opencascade.com> 'Fix mistakes'
Cherrypick from master 2008-03-07 07:47:18 UTC jfa <jfa@opencascade.com> 'Join modifications from BR_Dev_For_4_0 tag V4_1_1.':
    src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.cxx
    src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY.hxx
    src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.cxx
    src/NETGENPlugin/NETGENPlugin_NETGEN_2D_ONLY_i.hxx
2008-03-07 07:47:21 +00:00
abd
e085934a8b Fix mistakes 2007-04-24 14:54:27 +00:00
abd
ce5b064500 Fix compilation errors on RedHat 2007-04-24 14:31:34 +00:00
abd
022e2014eb Fix unresolvable symbols 2007-04-24 14:15:45 +00:00
abd
ec771163a9 Fix compilation problems on Mandriva64 2007-04-20 15:13:41 +00:00
abd
12cdbbdbc5 Fix compilation problems on RedHat( HDF flags ) 2007-04-20 15:03:43 +00:00
abd
493f933497 Fix compilation problems on Mandriva( right fortran flags ) 2007-04-20 14:53:04 +00:00
abd
7493430a76 Remove KERNEL DEPRECATED files from local salome_adm directory 2007-04-20 12:33:34 +00:00
abd
ee0caf7948 Merging from V3_2_6pre4 2007-04-18 15:47:16 +00:00
abd
b7ca47a69a Using AutoTools for build procedure 2007-04-13 15:00:48 +00:00
abd
e5dc843e81 Update Salome version 2007-02-09 15:31:09 +00:00
abd
a32024e0bc Merging with WPdev 2007-02-07 12:33:37 +00:00
admin
90e60e9d4a This commit was generated by cvs2git to create branch 'BR_Dev_For_4_0'.
Sprout from master 2006-06-01 11:42:55 UTC jfa <jfa@opencascade.com> 'Join modifications from branch BR_DEBUG_3_2_0b1'
Cherrypick from V3_2_0_maintainance 2006-08-25 07:09:10 UTC vsr <vsr@opencascade.com> 'Increment version number: 3.2.2':
    adm_local/unix/make_commence.in
    configure.in.base
    src/NETGEN/ReadMeForNgUsers
2006-08-25 07:09:11 +00:00
81 changed files with 6274 additions and 1774 deletions

0
AUTHORS Normal file
View File

340
COPYING Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

0
ChangeLog Normal file
View File

57
Makefile.am Normal file
View File

@ -0,0 +1,57 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
#
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
# Modified by : Alexander BORODIN (OCN) - autotools usage
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
if NETGENPLUGIN_ENABLE_GUI
ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${SMESH_ROOT_DIR}/adm_local/unix/config_files
else !NETGENPLUGIN_ENABLE_GUI
ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${SMESH_ROOT_DIR}/adm_local/unix/config_files
endif
SUBDIRS = idl adm_local resources src bin
DIST_SUBDIRS = idl adm_local resources src bin
DISTCLEANFILES = a.out aclocal.m4 configure
salomeinclude_DATA = NETGENPLUGIN_version.h
EXTRA_DIST += \
build_configure \
clean_configure
dist-hook:
rm -rf `find $(distdir) -name CVS`

View File

@ -1,116 +0,0 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
#
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
# $Header$
#
# source path
top_srcdir=@top_srcdir@
top_builddir=.
srcdir=@srcdir@
VPATH=.:@srcdir@:@top_srcdir@/bin:./bin/salome:@top_srcdir@/resources:./bin:@top_srcdir@/idl
@COMMENCE@
SUBDIRS = idl src adm_local
RESOURCES_FILES = \
NETGENPlugin.xml \
mesh_hypo_netgen.png \
mesh_hypo_netgen_2d.png \
mesh_algo_netgen_2d3d.png \
mesh_algo_netgen_2d.png \
mesh_tree_hypo_netgen.png \
mesh_tree_hypo_netgen_2d.png \
mesh_tree_algo_netgen_2d3d.png \
mesh_tree_algo_netgen_2d.png
BIN_SCRIPT = VERSION
# copy header files in common directory ------------
include_list = include/salome/SALOMEconfig.h \
include/salome/NETGENPLUGIN_version.h
ifneq ($(HAVE_SSTREAM),yes)
include_list += include/salome/sstream
endif
inc: idl $(include_list)
bin: bin/salome/VERSION
bin/salome/VERSION : bin/VERSION
-$(RM) $@
$(LN_S) ../../$< $@
include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref
-$(RM) $@
$(LN_S) ../../$< $@
# test if SALOMEconfig.h has changed (contents)
salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h
@if ! [ -a $@ ]; then \
cp -p -f $< $@; \
fi; \
if ! cmp $< $@; then \
cp -p -f $< $@; \
fi; \
include/salome/sstream: salome_adm/unix/sstream
-$(RM) $@
$(LN_S) ../../$< $@
include/salome/NETGENPLUGIN_version.h: NETGENPLUGIN_version.h
-$(RM) $@
$(LN_S) ../../$< $@
install-include: $(include_list)
$(INSTALL) -d $(includedir)
@for f in X $(include_list); do \
if test $$f != X; then \
($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1); \
fi; \
done
# install script in $(bindir) :
install-bin: $(BIN_SCRIPT)
$(INSTALL) -d $(bindir)
if test $(BIN_SCRIPT)X != X; then \
$(INSTALL_PROGRAM) $^ $(bindir); \
fi
# CLEAN --------------------
distclean: distclean-other
distclean-other:
-$(RM) salome_adm/unix/*~ salome_adm/unix/*% salome_adm/unix/*.bak salome_adm/unix/*.new salome_adm/unix/*.old
-$(RM) salome_adm/unix/make_*
-$(RM) salome_adm/unix/depend salome_adm/unix/SALOMEconfig.h
-$(RM) config.cache config.log config.status
@MODULE@
install: install-bin install-include

0
NEWS Normal file
View File

0
README Normal file
View File

22
adm_local/Makefile.am Normal file
View File

@ -0,0 +1,22 @@
# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = unix

View File

@ -0,0 +1,22 @@
# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
SUBDIRS = config_files

View File

@ -0,0 +1,24 @@
# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocalm4_DATA = \
check_NETGEN.m4 \
check_NETGENPLUGIN.m4

View File

@ -0,0 +1,145 @@
AC_DEFUN([CHECK_NETGEN],[
AC_REQUIRE([AC_PROG_CXX])dnl
AC_REQUIRE([AC_PROG_CXXCPP])dnl
AC_CHECKING(for Netgen 4.5 and higher Libraries)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_ARG_WITH(netgen,
[ --with-netgen=DIR root directory path of NETGEN installation],
NETGEN_HOME=$withval,NETGEN_HOME="")
NETGEN_INCLUDES=""
NETGEN_LIBS_DIR=""
Netgen_ok=no
if test "x$NETGEN_HOME" == "x" ; then
# no --with-netgen option used
if test "x$NETGENHOME" != "x" ; then
# NETGENHOME environment variable defined
NETGEN_HOME=$NETGENHOME
fi
#
fi
if test "x$NETGEN_HOME" != "x"; then
echo
echo
echo -------------------------------------------------
echo You are about to choose to use somehow the
echo Netgen Library to generate Tetrahedric mesh.
echo
echo WARNING
echo ----------------------------------------------------------
echo ----------------------------------------------------------
echo You are strongly advised to consult the file
echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly about
echo assumptions made on the installation of the Netgen
echo application and libraries.
echo Ask your system administrator for those details.
echo ----------------------------------------------------------
echo ----------------------------------------------------------
echo
echo
NETGEN_INCLUDES="-I${NETGEN_HOME}/include"
# check ${NETGEN_HOME}/lib/LINUX directory for libraries
if test -f ${NETGEN_HOME}/lib/LINUX/libcsg.a ; then
NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX"
else
# check ${NETGEN_HOME}/lib/LINUX64 directory for libraries
if test -f ${NETGEN_HOME}/lib/LINUX64/libcsg.a ; then
NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX64"
else
NETGEN_LIBS_DIR="${NETGEN_HOME}/lib"
fi
fi
echo "NETGEN_LIBS_DIR = $NETGEN_LIBS_DIR"
CPPFLAGS_old="$CPPFLAGS"
CXXFLAGS_old="$CXXFLAGS"
CPPFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CPPFLAGS"
CXXFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CXXFLAGS"
AC_MSG_CHECKING(for Netgen header file)
AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
if test "x$Netgen_ok" == "xyes"; then
AC_MSG_CHECKING(for Netgen libraries)
LDFLAGS_old="$LDFLAGS"
LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS"
AC_TRY_COMPILE(#include <iostream.h>
#include <fstream.h>
namespace nglib {
#include "nglib.h"
}
#define OCCGEOMETRY
#include <occgeom.hpp>
,nglib::Ng_Init();
netgen::OCCGeometry occgeo;
nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a";
ar x "$NETGEN_LIBS_DIR/libocc.a";
ar x "$NETGEN_LIBS_DIR/libcsg.a";
ar x "$NETGEN_LIBS_DIR/libgprim.a";
ar x "$NETGEN_LIBS_DIR/libmesh.a";
ar x "$NETGEN_LIBS_DIR/libopti.a";
ar x "$NETGEN_LIBS_DIR/libgen.a";
ar x "$NETGEN_LIBS_DIR/libla.a";
ar x "$NETGEN_LIBS_DIR/libstlgeom.a";
ar x "$NETGEN_LIBS_DIR/libgeom2d.a";
$CXX -shared linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o -o libNETGEN.so;
rm -rf linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o,
Netgen_ok=no)
AC_CACHE_VAL(salome_netgen_lib,[
AC_TRY_LINK(
#include <iostream.h>
#include <fstream.h>
namespace nglib {
#include "nglib.h"
}
#define OCCGEOMETRY
#include <occgeom.hpp>
,nglib::Ng_Init();
netgen::OCCGeometry occgeo;
nglib::Ng_Exit();,
eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so)
])
Netgen_ok="$salome_netgen_lib"
LDFLAGS="$LDFLAGS_old"
fi
CPPFLAGS="$CPPFLAGS_old"
CXXFLAGS="$CXXFLAGS_old"
if test "x$Netgen_ok" == xno ; then
AC_MSG_RESULT(no)
AC_MSG_WARN(Netgen libraries not found or not properly installed)
else
AC_MSG_RESULT(yes)
fi
fi
AC_SUBST(NETGEN_INCLUDES)
AC_SUBST(NETGEN_LIBS_DIR)
AC_LANG_RESTORE
])dnl

View File

@ -1,132 +1,53 @@
AC_DEFUN([CHECK_NETGEN],[
#------------------------------------------------------------
# Check availability of Salome NETGEN mesh plugin module
# distribution
#------------------------------------------------------------
AC_REQUIRE([AC_PROG_CXX])dnl
AC_REQUIRE([AC_PROG_CXXCPP])dnl
AC_DEFUN([CHECK_NETGENPLUGIN],[
AC_CHECKING(for Netgen 4.5 and higher Libraries)
AC_CHECKING(for NETGEN mesh plugin)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
NGplugin_ok=no
AC_ARG_WITH(netgen,
[ --with-netgen=DIR root directory path of NETGEN installation],
NETGEN_HOME=$withval,NETGEN_HOME="")
NETGENPLUGIN_LDLAGS=""
NETGENPLUGIN_CXXFLAGS=""
NETGEN_INCLUDES=""
NETGEN_LIBS_DIR=""
AC_ARG_WITH(netgenplugin,
[ --with-netgenplugin=DIR root directory path of NETGEN mesh plugin installation ],
NETGENPLUGIN_DIR="$withval",NETGENPLUGIN_DIR="")
Netgen_ok=no
if test "x$NETGENPLUGIN_DIR" == "x" ; then
if test "x$NETGEN_HOME" == "x" ; then
# no --with-netgenplugin-dir option used
# no --with-netgen option used
if test "x$NETGENHOME" != "x" ; then
if test "x$NETGENPLUGIN_ROOT_DIR" != "x" ; then
# NETGENHOME environment variable defined
NETGEN_HOME=$NETGENHOME
# NETGENPLUGIN_ROOT_DIR environment variable defined
NETGENPLUGIN_DIR=$NETGENPLUGIN_ROOT_DIR
fi
#
fi
if test "x$NETGEN_HOME" != "x"; then
if test -f ${NETGENPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome/libNETGENEngine.so ; then
NGplugin_ok=yes
AC_MSG_RESULT(Using NETGEN mesh plugin distribution in ${NETGENPLUGIN_DIR})
echo
echo
echo -------------------------------------------------
echo You are about to choose to use somehow the
echo Netgen Library to generate Tetrahedric mesh.
echo
echo WARNING
echo ----------------------------------------------------------
echo ----------------------------------------------------------
echo You are strongly advised to consult the file
echo NETGENPLUGIN_SRC/src/ReadMeForNgUsers, particularly about
echo assumptions made on the installation of the Netgen
echo application and libraries.
echo Ask your system administrator for those details.
echo ----------------------------------------------------------
echo ----------------------------------------------------------
echo
echo
if test "x$NETGENPLUGIN_ROOT_DIR" == "x" ; then
NETGENPLUGIN_ROOT_DIR=${NETGENPLUGIN_DIR}
fi
AC_SUBST(NETGENPLUGIN_ROOT_DIR)
NETGENPLUGIN_LDFLAGS=-L${NETGENPLUGIN_DIR}/lib${LIB_LOCATION_SUFFIX}/salome
NETGENPLUGIN_CXXFLAGS=-I${NETGENPLUGIN_DIR}/include/salome
NETGEN_INCLUDES="-I$NETGEN_HOME/include"
NETGEN_LIBS_DIR="$NETGEN_HOME/lib/LINUX"
AC_SUBST(NETGENPLUGIN_LDFLAGS)
AC_SUBST(NETGENPLUGIN_CXXFLAGS)
CPPFLAGS_old="$CPPFLAGS"
CXXFLAGS_old="$CXXFLAGS"
CPPFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CPPFLAGS"
CXXFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CXXFLAGS"
AC_MSG_CHECKING(for Netgen header file)
AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
if test "x$Netgen_ok" == "xyes"; then
AC_MSG_CHECKING(for Netgen libraries)
LDFLAGS_old="$LDFLAGS"
LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS"
AC_TRY_COMPILE(#include <iostream.h>
#include <fstream.h>
namespace nglib {
#include "nglib.h"
}
#define OCCGEOMETRY
#include <occgeom.hpp>
,nglib::Ng_Init();
netgen::OCCGeometry occgeo;
nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a";
ar x "$NETGEN_LIBS_DIR/libocc.a";
ar x "$NETGEN_LIBS_DIR/libcsg.a";
ar x "$NETGEN_LIBS_DIR/libgprim.a";
ar x "$NETGEN_LIBS_DIR/libmesh.a";
ar x "$NETGEN_LIBS_DIR/libopti.a";
ar x "$NETGEN_LIBS_DIR/libgen.a";
ar x "$NETGEN_LIBS_DIR/libla.a";
ar x "$NETGEN_LIBS_DIR/libstlgeom.a";
ar x "$NETGEN_LIBS_DIR/libgeom2d.a";
$CXX -shared linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o -o libNETGEN.so;
rm -rf linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o,
Netgen_ok=no)
AC_CACHE_VAL(salome_netgen_lib,[
AC_TRY_LINK(
#include <iostream.h>
#include <fstream.h>
namespace nglib {
#include "nglib.h"
}
#define OCCGEOMETRY
#include <occgeom.hpp>
,nglib::Ng_Init();
netgen::OCCGeometry occgeo;
nglib::Ng_Exit();,
eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so)
])
Netgen_ok="$salome_netgen_lib"
LDFLAGS="$LDFLAGS_old"
fi
CPPFLAGS="$CPPFLAGS_old"
CXXFLAGS="$CXXFLAGS_old"
if test "x$Netgen_ok" == xno ; then
AC_MSG_RESULT(no)
AC_MSG_WARN(Netgen libraries not found or not properly installed)
else
AC_MSG_RESULT(yes)
fi
else
AC_MSG_WARN("Cannot find compiled NETGEN mesh plugin distribution")
fi
AC_SUBST(NETGEN_INCLUDES)
AC_SUBST(NETGEN_LIBS_DIR)
AC_LANG_RESTORE
AC_MSG_RESULT(for NETGEN mesh plugin: $NGplugin_ok)
])dnl

View File

@ -1,288 +0,0 @@
# common directories to put headerfiles
inc_builddir=$(top_builddir)/include/salome
@SET_MAKE@
SHELL=/bin/sh
# header missing
HAVE_SSTREAM=@HAVE_SSTREAM@
LIBS=@LIBS@
LDFLAGS=@LDFLAGS@ -L$(top_builddir)/lib/salome -Xlinker -rpath-link -Xlinker $(top_builddir)/lib/salome
# add libstdc++ to link c++ library with libtool !
LDFLAGS+= -lstdc++
CP=@CP@
# CPP
CPP=@CPP@
CXXCPP=@CXXCPP@
CPPFLAGS=@CPPFLAGS@ -I$(inc_builddir) -I$(srcdir) -I.
# C
CC = @CC@
CFLAGS = @CFLAGS@
C_DEPEND_FLAG = @C_DEPEND_FLAG@
# C++
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
CXX_DEPEND_FLAG = @CXX_DEPEND_FLAG@
# BOOST Library
BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
# JAVA
JAVA_INCLUDES = @JAVA_INCLUDES@
JAVA_LIBS = @JAVA_LIBS@
JAVA_LDPATH = @JAVA_LDPATH@
# PYTHON
PYTHON = @PYTHON@
PYTHONHOME = @PYTHONHOME@
PYTHON_INCLUDES = @PYTHON_INCLUDES@
PYTHON_LIBS = @PYTHON_LIBS@
PYTHON_VERSION = @PYTHON_VERSION@
PYTHON_SITE = @PYTHON_SITE@
PYTHON_SITE_INSTALL = @PYTHON_SITE_INSTALL@
# QT
QT_ROOT = @QT_ROOT@
QT_INCLUDES = @QT_INCLUDES@
QT_MT_INCLUDES = @QT_INCLUDES@ -DQT_THREAD_SUPPORT
QT_LIBS = @QT_LIBS@
QT_MT_LIBS = @QT_MT_LIBS@
MOC = @MOC@
UIC = @UIC@
MSG2QM = @MSG2QM@
#QWT
QWT_INCLUDES=@QWT_INCLUDES@
QWT_LIBS=@QWT_LIBS@
# SIP
SIP = @SIP@
SIP_INCLUDES = @SIP_INCLUDES@
SIP_LIBS = @SIP_LIBS@
# PYQT
PYQT_SIPS = @PYQT_SIPS@
PYQT_LIBS = @PYQT_LIBS@
# openGL
OGL_INCLUDES=@OGL_INCLUDES@
OGL_LIBS=@OGL_LIBS@
# VTK
VTK_INCLUDES=@VTK_INCLUDES@
VTK_LIBS=@VTK_LIBS@
# HDF5
HDF5_INCLUDES=@HDF5_INCLUDES@
HDF5_LIBS=@HDF5_LIBS@
HDF5_MT_LIBS=@HDF5_MT_LIBS@
# OpenCasCade
OCC_INCLUDES=@CAS_CPPFLAGS@
OCC_CXXFLAGS=@CAS_CXXFLAGS@
OCC_KERNEL_LIBS=@CAS_KERNEL@
OCC_OCAF_LIBS=@CAS_OCAF@
OCC_VIEWER_LIBS=@CAS_VIEWER@
OCC_MODELER_LIBS=@CAS_MODELER@
OCC_DATAEXCHANGE_LIBS=@CAS_DATAEXCHANGE@
OCC_LIBS=@CAS_LDFLAGS@
OCC_LDPATH=@CAS_LDPATH@
# MPICH
MPICH_INCLUDES=@MPICH_INCLUDES@
MPICH_LIBS=@MPICH_LIBS@
# Swig C++ Python
SWIG = @SWIG@
SWIG_FLAGS = @SWIG_FLAGS@ -I$(inc_builddir) -I$(srcdir) -I.
# OMNIORB
OMNIORB_ROOT = @OMNIORB_ROOT@
OMNIORB_INCLUDES = @OMNIORB_INCLUDES@
OMNIORB_LIBS = @OMNIORB_LIBS@
OMNIORB_CXXFLAGS = @OMNIORB_CXXFLAGS@
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome\
-I$(SMESH_ROOT_DIR)/idl/salome
OMNIORB_IDL_CLN_H = @OMNIORB_IDL_CLN_H@
OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@
OMNIORB_IDL_CLN_OBJ = @OMNIORB_IDL_CLN_OBJ@
OMNIORB_IDL_SRV_H = @OMNIORB_IDL_SRV_H@
OMNIORB_IDL_SRV_CXX = @OMNIORB_IDL_SRV_CXX@
OMNIORB_IDL_SRV_OBJ = @OMNIORB_IDL_SRV_OBJ@
# Default ORB
CORBA_ROOT = @CORBA_ROOT@
CORBA_INCLUDES = @CORBA_INCLUDES@
CORBA_LIBS = @CORBA_LIBS@
CORBA_CXXFLAGS = @CORBA_CXXFLAGS@
IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome\
-I$(SMESH_ROOT_DIR)/idl/salome
IDLPYFLAGS = @IDLPYFLAGS@
IDL = @IDL@
IDL_CLN_H = @IDL_CLN_H@
IDL_CLN_CXX = @IDL_CLN_CXX@
IDL_CLN_OBJ = @IDL_CLN_OBJ@
IDL_SRV_H = @IDL_SRV_H@
IDL_SRV_CXX = @IDL_SRV_CXX@
IDL_SRV_OBJ = @IDL_SRV_OBJ@
CPPFLAGS+= $(CORBA_INCLUDES)
CXXFLAGS+= $(CORBA_CXXFLAGS)
# SALOME
SALOME_INCLUDES = \
-I$(KERNEL_ROOT_DIR)/include/salome \
-I$(GEOM_ROOT_DIR)/include/salome \
-I$(SMESH_ROOT_DIR)/include/salome
CPPFLAGS += -DSOLIDGEOM -DLINUX $(OCC_INCLUDES) $(SALOME_INCLUDES) $(BOOST_CPPFLAGS)
CXXFLAGS += -DSOLIDGEOM -DLINUX $(OCC_CXXFLAGS) $(SALOME_INCLUDES)
LDFLAGS += -lSMESHimpl -lSMESHEngine -lStdMeshers -lStdMeshersEngine -L${KERNEL_ROOT_DIR}/lib/salome -L${SMESH_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -lSalomeGenericObj
# add corba libs when link salome application !
#LDFLAGS+= $(CORBA_LIBS)
LIBS+=$(CORBA_LIBS)
## Shared libraries
LT_STATIC_EXEC=@LT_STATIC_EXEC@
DYNAMIC_DIRS=@DYNAMIC_DIRS@
LT_LIB=libtool
LT=$(top_builddir)/libtool
LT_COMPILE=$(LT) --mode=compile $(CC)
LT_LINK_LIB=$(LT_LIB) --mode=link $(CC) -rpath $(libdir)
LT_LINK_EXE=$(LT) --mode=link $(CC) $(LT_STATIC_EXEC) -dlopen self -rpath $(bindir) $(DYNAMIC_DIRS)
LT_RUN=$(LT) --mode=execute
LT_INSTALL_PROG=$(LT) --mode=install $(INSTALL_PROGRAM)
LT_INSTALL_LIB=$(LT) --mode=install $(INSTALL_DATA)
LT_UNINSTALL=$(LT) --mode=uninstall $(RM)
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
# create a symbolic link (or a copie ?)
LN_S=@LN_S@
## Installation points
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@/salome
libdir=@libdir@/salome
# warning : if user give this path in configure we could have salome/salome :-(
includedir=@includedir@/salome
datadir=@datadir@/salome
idldir=$(prefix)/idl/salome
sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
docdir=${prefix}/doc/salome
#
# begin of package rules
#
.PHONY: all lib bin inc resources docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
.SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm
all:
$(MAKE) inc
$(MAKE) depend_idl
$(MAKE) depend
$(MAKE) lib
$(MAKE) bin
$(MAKE) resources
#
# add target to build administrative files
#
Makefile: $(top_builddir)/config.status $(srcdir)/Makefile.in
cd $(top_builddir) ; ./config.status
LOCAL_MAKE = make_commence make_omniorb
KERNEL_MAKE = make_module make_conclude depend SALOMEconfig.h F77config.h sstream envScript
$(top_builddir)/config.status: $(top_srcdir)/configure \
$(LOCAL_MAKE:%=$(top_srcdir)/adm_local/unix/%.in) \
$(KERNEL_MAKE:%=$(KERNEL_ROOT_DIR)/salome_adm/unix/%.in)
cd $(top_builddir) ; ./config.status --recheck
# VPATH contain $(srcdir), so make configure is good in top_srcdir and we must add target configure otherwise :-)
ifneq ($(top_srcdir),$(srcdir))
configure: $(top_srcdir)/configure
endif
$(top_srcdir)/configure: $(top_srcdir)/configure.in $(top_srcdir)/aclocal.m4
cd $(top_srcdir) ; autoconf
$(top_srcdir)/configure.in: $(top_srcdir)/configure.in.base
cd $(top_srcdir) && ./build_configure
ACLOCAL_KERNEL = \
ac_cxx_bool.m4 check_corba.m4 \
ac_cxx_depend_flag.m4 check_hdf5.m4 enable_pthreads.m4 \
ac_cxx_mutable.m4 check_mico.m4 libtool.m4 \
ac_cxx_namespaces.m4 check_omniorb.m4 pyembed.m4 \
ac_cxx_partial_specialization.m4 python.m4 \
ac_cxx_typename.m4 check_pthreads.m4 check_cas.m4 \
ac_cc_warnings.m4 check_swig.m4 check_boost.m4
#ifeq (@WITHNETGEN@,yes)
# ACLOCAL_SRC += check_Netgen.m4
#endif
ACLOCAL_GUI = \
check_vtk.m4 check_opengl.m4 check_qt.m4 \
check_GUI.m4 check_corba_in_GUI.m4
ACLOCAL_GEOM = check_GEOM.m4
ACLOCAL_SMESH = check_SMESH.m4
$(top_srcdir)/aclocal.m4: $(ACLOCAL_KERNEL%=@KERNEL_ROOT_DIR@/salome_adm/unix/config_files/%) \
$(ACLOCAL_GUI:%=@GUI_ROOT_DIR@/adm_local/unix/config_files/%) \
$(ACLOCAL_GEOM:%=@GEOM_ROOT_DIR@/adm_local/unix/config_files/%) \
$(ACLOCAL_SMESH:%=@SMESH_ROOT_DIR@/adm_local/unix/config_files/%)
cd $(top_srcdir) ; aclocal -I adm_local/unix/config_files -I @KERNEL_ROOT_DIR@/salome_adm/unix/config_files \
-I @GUI_ROOT_DIR@/adm_local/unix/config_files \
-I @GEOM_ROOT_DIR@/adm_local/unix/config_files \
-I @SMESH_ROOT_DIR@/adm_local/unix/config_files

View File

@ -0,0 +1,69 @@
#
# ============================================================
# This file defines the common definitions used in several
# Makefile. This file must be included, if needed, by the file
# Makefile.am.
# ============================================================
#
# Standard directory for installation
salomeincludedir = $(includedir)/salome
libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome
bindir = $(prefix)/bin/salome
salomescriptdir = $(bindir)
salomepythondir = $(pythondir)/salome
salomepyexecdir = $(pyexecdir)/salome
# Directory for installing idl files
salomeidldir = $(prefix)/idl/salome
# Directory for installing resource files
salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@
# Directories for installing admin files
admlocaldir = $(prefix)/adm_local
admlocalunixdir = $(admlocaldir)/unix
admlocalm4dir = $(admlocaldir)/unix/config_files
# Shared modules installation directory
sharedpkgpythondir = $(salomepythondir)/shared_modules
# Documentation directory
docdir = $(datadir)/doc/salome
# common rules
# meta object implementation files generation (moc)
%_moc.cxx: %.h
$(MOC) $< -o $@
# translation (*.qm) files generation (lrelease)
%.qm: %.ts
$(LRELEASE) $< -qm $@
# resource files generation (qrcc)
qrc_%.cxx: %.qrc
$(QRCC) $< -o $@ -name $(*F)
# qt forms files generation (uic)
ui_%.h: %.ui
$(UIC) -o $@ $<
# extra distributed files
EXTRA_DIST = $(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cxx=%.qrc) \
$(UIC_FILES:ui_%.h=%.ui) $(nodist_salomeres_DATA:%.qm=%.ts)
# customize clean operation
mostlyclean-local:
rm -f @builddir@/*_moc.cxx
rm -f @builddir@/*.qm
rm -f @builddir@/ui_*.h
rm -f @builddir@/qrc_*.cxx
# tests
tests: unittest
unittest: $(UNIT_TEST_PROG)
@if test "x$(UNIT_TEST_PROG)" != "x"; then \
$(UNIT_TEST_PROG); \
fi;

View File

@ -1,62 +0,0 @@
#=======================================================================
# Begin specific part to omniorb
# (include from file adm/unix/make_omniorb generated by
# adm/unix/make_omniorb.in)
#=======================================================================
# -* Makefile *-
#
# Author : Patrick GOLDBRONN (CEA)
# Date : 29/06/2001
# $Header$
#
# Client and server object are the same with omniorb
# There are one header file and one source file generate
#IDLOBJ=$(IDLSRC:%.idl=%$(IDL_CLN_OBJ))
# dependancies between idl and it's generated files
%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${KERNEL_ROOT_DIR}/idl/salome/%.idl
$(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${GEOM_ROOT_DIR}/idl/salome/%.idl
$(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
#%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${MED_ROOT_DIR}/idl/salome/%.idl
# $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${SMESH_ROOT_DIR}/idl/salome/%.idl
$(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
%$(OMNIORB_IDL_CLN_CXX) %$(OMNIORB_IDL_CLN_H): ${top_builddir}/idl/salome/%.idl
$(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
# dependncies between idl files
depend_idl: .depidl
# we use cpp to generate dependencies between idl files.
# we change cpp output to keep only idl file and transform it to get a suitable rule
.depidl: $(IDL_FILES)
@touch $@
@for dep in $? dummy; do \
if [ $$dep != "dummy" ]; then \
echo Building dependencies for $$dep; \
basedep=`basename $$dep .idl`; \
header="$$basedep"$(IDL_CLN_H); \
sed '\%^'"$$header"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
$(CPP) $(C_DEPEND_FLAG) -I$(srcdir) $$dep 2>/dev/null | \
sed `echo "s%$$basedep\\.idl%$$header:%g"` | \
sed 's% $(srcdir)/% %g' | \
sed 's% $(top_srcdir)/% %g' | \
sed 's% $(top_builddir)/% %g' | \
sed 's%^.*:\.o: *%%' | sed 's%^ *\\ *%%'| sed 's%^ *\(.*\):%\1:%' | \
sed 's/\.idl/$(IDL_CLN_H)/' >>$@; \
echo '' >>$@; \
fi; \
done ;
-include .depidl
#=======================================================================
# End specific part to omniorb
#=======================================================================

31
bin/Makefile.am Normal file
View File

@ -0,0 +1,31 @@
# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# -* Makefile *-
#
# Author : Guillaume Boulant (CSSI)
# Module : KERNEL
# $Header$
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# non-distributed files
nodist_salomescript_DATA = VERSION
# distributed files
dist_salomescript_SCRIPTS =

View File

@ -6,11 +6,14 @@
#
# Author : Marc Tajchman - CEA
# Date : 10/10/2002
# 13/03/2007: Alexander BORODIN - OCN
# Reorganization for usage of autotools
# $Header$
#
ORIG_DIR=`pwd`
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
NETGENPLUGIN_WITH_GUI="yes"
########################################################################
# Test if the KERNEL_ROOT_DIR is set correctly
@ -26,12 +29,26 @@ fi
# echo "failed : KERNEL_SRC variable is not correct !"
# exit
#fi
for option
do
case $option in
-with-gui | --with-gui)
NETGENPLUGIN_WITH_GUI="yes"
break;;
-without-gui | --without-gui | -with-gui=no | --with-gui=no)
NETGENPLUGIN_WITH_GUI="no"
break;;
esac
done
########################################################################
# Test if the GUI_ROOT_DIR is set correctly
if test ! -d "${GUI_ROOT_DIR}"; then
echo "failed : GUI_ROOT_DIR variable is not correct !"
exit
if test ${NETGENPLUGIN_WITH_GUI} = yes; then
if test ! -d "${GUI_ROOT_DIR}"; then
echo "failed : GUI_ROOT_DIR variable is not correct !"
exit
fi
fi
########################################################################
@ -58,195 +75,93 @@ if test ! -d "${SMESH_ROOT_DIR}"; then
exit
fi
########################################################################
# find_in - utility function
#
# usage :
# find_in directory filename
#
# Finds files following the *.in pattern, recursively in the
# directory (first argument).
# Results are appended into the file (second argument)
#
# Difference from the standard unix find is that files are tested
# before directories
#
find_in()
{
local i
local f=$2
# if the first argument is not a directory, returns
if [ ! -d "$1" ] ; then
return
fi
# dont look in the CVS directories
case $1 in
*/CVS) return ;;
*/adm_local/*) return ;;
*) ;;
esac
# for each regular file contained in the directory
# test if it's a .in file
for i in "$1"/*
do
if [ -f "$i" ] ; then
case $i in
*.in) echo " "$i" \\" >> $f;;
*) ;;
esac
fi
done
# for each subdirectory of the first argument, proceeds recursively
for i in "$1"/*
do
if [ -d "$i" ] ; then
find_in "$i" "$f"
fi
done
}
#######################################################################
# Generate list of .in files (Makefile.in, config.h.in, etc)
# appending it in file configure.in
cd ${CONF_DIR}
ABS_CONF_DIR=`pwd`
#
# Common part of the configure.in file
#
chmod u+w configure.in.base
if ! \cp -f configure.in.base configure.in_tmp1
then
echo
echo "error : can't create files in" ${CONF_DIR}
echo "aborting ..."
chmod u-w configure.in.base
exit
fi
chmod u-w configure.in.base
#######################################################################
# Update configure.ac script: to set NETGENPLUGIN_WITH_GUI variable
sed -e s/NETGENPLUGIN_WITH_GUI=[a-z]*/NETGENPLUGIN_WITH_GUI=${NETGENPLUGIN_WITH_GUI}/g configure.ac > configure.tmp
mv -f configure.tmp configure.ac
if [ -e "${CONF_DIR}/salome_adm" ] ; then
\rm -f ${CONF_DIR}/salome_adm
fi
mkdir -p salome_adm/unix/config_files
#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files/* salome_adm/unix/config_files
#cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/pythonbe.py salome_adm/unix
# make a link allowing AC_OUTPUT to find the salome_adm/.../*.in files
echo "" >> configure.in_tmp1
echo 'ln -fs ${KERNEL_ROOT_DIR}/salome_adm ${ROOT_SRCDIR}/.' >> configure.in_tmp1
cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix
echo "" >> configure.in_tmp1
echo "AC_OUTPUT([ \\" >> configure.in_tmp1
#cp -f ${GUI_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
#cp -f ${MED_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
#cp -f ${GEOM_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
#cp -f ${SMESH_ROOT_DIR}/adm_local/unix/config_files/* salome_adm/unix/config_files
#
# List of .in files in the adm/unix directory
# These files MUST be on top of AC_OUTPUT list so we
# put them "manually"
#
# remove KERNEL deprecated configure files
#for deprecated in ac_cc_warnings.m4 ac_cxx_partial_specialization.m4 \
# check_mico.m4 config.guess ltmain.sh ac_cxx_bool.m4 ltconfig ac_cxx_typename.m4 \
# check_pthreads.m4 config.sub libtool.m4 ac_cxx_mutable.m4 missing
# do
# rm -f salome_adm/unix/config_files/${deprecated}
# done
echo " ./salome_adm/unix/SALOMEconfig.h \\" >> configure.in_tmp1
echo " ./salome_adm/unix/F77config.h \\" >> configure.in_tmp1
echo " ./salome_adm/unix/sstream \\" >> configure.in_tmp1
echo " ./salome_adm/unix/depend \\" >> configure.in_tmp1
echo " ./adm_local/unix/make_omniorb:${ABS_CONF_DIR}/adm_local/unix/make_omniorb.in \\" >> configure.in_tmp1
echo " ./salome_adm/unix/envScript \\" >> configure.in_tmp1
echo " ./adm_local/unix/make_commence:${ABS_CONF_DIR}/adm_local/unix/make_commence.in \\" >> configure.in_tmp1
echo " ./salome_adm/unix/make_conclude \\" >> configure.in_tmp1
echo " ./salome_adm/unix/make_module \\" >> configure.in_tmp1
# ____________________________________________________________________
# aclocal creates the aclocal.m4 file from the standard macro and the
# custom macro embedded in the directory salome_adm/unix/config_files
# and KERNEL config_files directory.
# output:
# aclocal.m4
# autom4te.cache (directory)
echo "====================================================== aclocal"
\rm -f configure.in_tmp2 configure.in_tmp3
touch configure.in_tmp2
find_in . configure.in_tmp2
sed -e '/^...salome_adm/d' configure.in_tmp2 > configure.in_tmp3
sed -e '/^...adm_local.unix.make_omniorb/d' configure.in_tmp3 configure.in_tmp2
sed -e '/^...adm_local.unix.make_commence/d' configure.in_tmp2 > configure.in_tmp3
sed -e '/configure.in/d' configure.in_tmp3 > configure.in_tmp2
sed -e 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
#sed '/^.salome_adm/d' configure.in_tmp2 > configure.in_tmp3
#sed '/configure.in/d' configure.in_tmp3 > configure.in_tmp2
#sed 's/.in / /' configure.in_tmp2 >> configure.in_tmp1
echo "])" >> configure.in_tmp1
# delete the link created for AC_OUTPUT
echo "" >> configure.in_tmp1
#echo 'rm -f ${ROOT_SRCDIR}/salome_adm' >> configure.in_tmp1
\mv configure.in_tmp1 configure.in_new
\rm -f configure.in_tmp2 configure.in_tmp3
########################################################################
# Create new (or replace old) configure.in file
# Print a message if the file is write protected
#
echo
if test ! -f configure.in
then
echo -n "Creating new file 'configure.in' ... "
if \mv configure.in_new configure.in >& /dev/null
then
echo "done"
else
echo "error, check your file permissions"
fi
if test ${NETGENPLUGIN_WITH_GUI} = yes; then
aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
else
echo -n "Updating 'configure.in' file ... "
if ! \cp configure.in configure.in_old >& /dev/null
then
echo
echo
echo "Can't backup previous configure.in"
echo -n "Continue (you will not be able to revert) - (Y/N) ? "
read R
case "x$R" in
xn*) exit;;
xN*) exit;;
esac
echo
echo -n " "
fi
if \cp configure.in_new configure.in >& /dev/null
then
echo "done"
else
echo
echo "error, can't update previous configure.in"
fi
aclocal -I adm_local/unix/config_files \
-I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${SMESH_ROOT_DIR}/adm_local/unix/config_files || exit 1
fi
########################################################################
# Use autoconf to rebuild the configure script
#
# ____________________________________________________________________
# libtoolize creates some configuration files (ltmain.sh,
# config.guess and config.sub). It only depends on the libtool
# version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac).
# output:
# salome_adm/unix/config_files/config.guess
# salome_adm/unix/config_files/config.sub
# salome_adm/unix/config_files/ltmain.sh
#echo "====================================================== libtoolize"
if test -f configure
then
echo -n "Updating 'configure' script ... "
else
echo -n "Creating 'configure' script ... "
fi
libtoolize --force --copy --automake || exit 1
aclocal -I adm_local/unix/config_files -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \
-I ${GUI_ROOT_DIR}/adm_local/unix/config_files \
-I ${MED_ROOT_DIR}/adm_local/unix/config_files \
-I ${GEOM_ROOT_DIR}/adm_local/unix/config_files \
-I ${SMESH_ROOT_DIR}/adm_local/unix/config_files
if autoconf
then
echo "done"
else
echo "failed (check file permissions and/or user quotas ...)"
fi
# ____________________________________________________________________
# autoconf creates the configure script from the file configure.ac (or
# configure.in if configure.ac doesn't exist)
# output:
# configure
echo "====================================================== autoconf"
cd ${ORIG_DIR}
autoconf
echo
# ____________________________________________________________________
# automake creates some scripts used in building process
# (install-sh, missing, ...). It only depends on the automake
# version. The files are created in the directory specified with the
# AC_CONFIG_AUX_DIR(<mydir>) tag (see configure.ac). This step also
# creates the Makefile.in files from the Makefile.am files.
# output:
# salome_adm/unix/config_files/compile
# salome_adm/unix/config_files/depcomp
# salome_adm/unix/config_files/install-sh
# salome_adm/unix/config_files/missing
# salome_adm/unix/config_files/py-compile
# Makefile.in (from Makefile.am)
echo "====================================================== automake"
automake --copy --gnu --add-missing

15
clean_configure Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
rm -rf autom4te.cache aclocal.m4 configure make_config
find . -name "*~" -print -exec rm {} \;
find . -name "*.pyc" -print -exec rm {} \;
#exit
# ==================== ON SORT AVANT
find bin -name Makefile.in | xargs rm -f
find doc -name Makefile.in | xargs rm -f
find idl -name Makefile.in | xargs rm -f
find resources -name Makefile.in | xargs rm -f
find salome_adm -name Makefile.in | xargs rm -f
find src -name Makefile.in | xargs rm -f
rm -f Makefile.in

View File

@ -11,22 +11,25 @@
# Date : 28/06/2001
# Modified by : Patrick GOLDBRONN (CEA)
# Modified by : Marc Tajchman (CEA)
# 13/03/2007: Alexander BORODIN - OCN
# Reorganization for usage of autotools
#
# Created from configure.in.base
#
AC_INIT(src)
AC_CONFIG_AUX_DIR(${KERNEL_ROOT_DIR}/salome_adm/unix/config_files)
AC_INIT([Salome2 Project NETGENPLUGIN module], [5.0.0], [webmaster.salome@opencascade.com], [SalomeNETGENPLUGIN])
AC_CONFIG_AUX_DIR(salome_adm/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
PACKAGE=salome
AC_SUBST(PACKAGE)
VERSION=3.2.0
XVERSION=0x030200
AC_SUBST(VERSION)
XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'`
AC_SUBST(XVERSION)
# set up MODULE_NAME variable for dynamic construction of directories (resources, etc.)
MODULE_NAME=netgenplugin
AC_SUBST(MODULE_NAME)
dnl
dnl Initialize source and build root directories
dnl
@ -102,6 +105,21 @@ AC_DEPEND_FLAG
# AC_CC_WARNINGS([ansi])
cc_ok=yes
echo
echo ---------------------------------------------
echo testing Fortran
echo ---------------------------------------------
echo
fortran_ok=no
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
if test "X$FC" != "X" ; then
fortran_ok=yes
fi
dnl Library libdl :
AC_CHECK_LIB(dl,dlopen)
@ -150,6 +168,8 @@ echo
CHECK_PYTHON
AM_PATH_PYTHON(2.3)
dnl echo
dnl echo ---------------------------------------------
dnl echo testing java
@ -203,37 +223,55 @@ AC_SUBST_FILE(CORBA)
corba=make_$ORB
CORBA=adm_local/unix/$corba
echo
echo ---------------------------------------------
echo testing openGL
echo ---------------------------------------------
echo
NETGENPLUGIN_WITH_GUI=yes
CHECK_OPENGL
AM_CONDITIONAL(NETGENPLUGIN_ENABLE_GUI, [test "${NETGENPLUGIN_WITH_GUI}" = "yes"])
echo
echo ---------------------------------------------
echo testing QT
echo ---------------------------------------------
echo
if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then
echo
echo ---------------------------------------------
echo testing openGL
echo ---------------------------------------------
echo
CHECK_QT
CHECK_OPENGL
echo
echo ---------------------------------------------
echo testing MSG2QM
echo ---------------------------------------------
echo
echo
echo ---------------------------------------------
echo testing QT
echo ---------------------------------------------
echo
CHECK_MSG2QM
CHECK_QT
echo
echo ---------------------------------------------
echo testing VTK
echo ---------------------------------------------
echo
echo
echo ---------------------------------------------
echo testing VTK
echo ---------------------------------------------
echo
CHECK_VTK
CHECK_VTK
echo
echo ---------------------------------------------
echo Testing GUI
echo ---------------------------------------------
echo
CHECK_SALOME_GUI
echo
echo ---------------------------------------------
echo Testing full GUI
echo ---------------------------------------------
echo
CHECK_CORBA_IN_GUI
if test "x${CORBA_IN_GUI}" != "xyes"; then
echo "failed : For configure NETGENPLUGIN module necessary full GUI !"
exit
fi
fi
echo
echo ---------------------------------------------
@ -259,26 +297,6 @@ echo
CHECK_HTML_GENERATORS
echo
echo ---------------------------------------------
echo Testing GUI
echo ---------------------------------------------
echo
CHECK_SALOME_GUI
echo
echo ---------------------------------------------
echo Testing full GUI
echo ---------------------------------------------
echo
CHECK_CORBA_IN_GUI
if test "x${CORBA_IN_GUI}" != "xyes"; then
echo "failed : For configure NETGENPLUGIN module necessary full GUI !"
exit
fi
echo
echo ---------------------------------------------
echo Testing Kernel
@ -295,13 +313,13 @@ echo
CHECK_GEOM
# echo
# echo ---------------------------------------------
# echo Testing Med
# echo ---------------------------------------------
# echo
#
# CHECK_MED
echo
echo ---------------------------------------------
echo Testing Med
echo ---------------------------------------------
echo
CHECK_MED
echo
echo ---------------------------------------------
@ -325,8 +343,15 @@ echo Summary
echo ---------------------------------------------
echo
#AM_CONDITIONAL( USE_GFORTRAN, [test "$F77" = "gfortran"])
echo Configure
if test "${NETGENPLUGIN_WITH_GUI}" = "yes"; then
variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok"
fi
if test "${NETGENPLUGIN_WITH_GUI}" = "no"; then
variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok"
fi
for var in $variables
do
@ -338,15 +363,6 @@ echo
echo "Default ORB : $DEFAULT_ORB"
echo
dnl generals files which could be included in every makefile
AC_SUBST_FILE(COMMENCE) COMMENCE=adm_local/unix/make_commence
AC_SUBST_FILE(CONCLUDE) CONCLUDE=salome_adm/unix/make_conclude
AC_SUBST_FILE(MODULE) MODULE=salome_adm/unix/make_module
dnl les dependences
AC_SUBST_FILE(DEPEND) DEPEND=salome_adm/unix/depend
dnl We don t need to say when we re entering directories if we re using
dnl GNU make becuase make does it for us.
if test "X$GMAKE" = "Xyes"; then
@ -355,67 +371,10 @@ else
AC_SUBST(SETX) SETX="set -x"
fi
# make other build directories
for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
do
# if test ! -d $rep ; then
# eval mkdir $rep
# fi
$INSTALL -d $rep
done
echo
echo ---------------------------------------------
echo copying resource files, shell scripts, and
echo xml files
echo ---------------------------------------------
echo
dnl copy resources directories
#for i in `find $ROOT_SRCDIR -name 'resources' -print`
#do
# local_res=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
# local_res_dir=`echo $local_res | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"`
# mkdir -p $local_res_dir
# cd $local_res_dir
# ln -fs $i
# echo $local_res
# cd $ROOT_BUILDDIR
#done
dnl copy shells and utilities contained in the bin directory
dnl excluding .in files (treated in AC-OUTPUT below) and CVS
dnl excluding .in files (treated in AC-OUTPUT below) and CVS
dnl directory
#mkdir -p bin/salome
#cd bin/salome
#for i in $ROOT_SRCDIR/bin/*
#do
# local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
# case "$local_bin" in
# *.in | *~) ;;
# ./bin/CVS | ./bin/salome) ;;
# *) /usr/bin/install -C $i .; echo $local_bin ;;
# esac
#done
#cd $ROOT_BUILDDIR
AC_SUBST_FILE(ENVSCRIPT) ENVSCRIPT=salome_adm/unix/envScript
dnl copy xml files to the build tree (lib directory)
dnl pourquoi ????
#cd lib
#for i in `find $ROOT_SRCDIR -name "*.xml" -print`
#do
# ln -fs $i
# echo `echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
#done
#cd $ROOT_BUILDDIR
echo
echo ---------------------------------------------
echo generating Makefiles and configure files
@ -423,7 +382,27 @@ echo ---------------------------------------------
echo
#AC_OUTPUT_COMMANDS([ \
# chmod +x ./bin/* \
# chmod +x ./bin/*; \
# chmod +x ./bin/salome/*;
#])
## do not delete this line
# This list is initiated using autoscan and must be updated manually
# when adding a new file <filename>.in to manage. When you execute
# autoscan, the Makefile list is generated in the output file configure.scan.
# This could be helpfull to update de configuration.
AC_OUTPUT([ \
./salome_adm/unix/SALOMEconfig.h \
./adm_local/Makefile \
./adm_local/unix/Makefile \
./adm_local/unix/config_files/Makefile \
./bin/VERSION \
./bin/Makefile \
./NETGENPLUGIN_version.h \
./src/Makefile \
./src/GUI/Makefile \
./src/NETGEN/Makefile \
./src/NETGENPlugin/Makefile \
./resources/Makefile \
./idl/Makefile \
Makefile \
])

116
idl/Makefile.am Normal file
View File

@ -0,0 +1,116 @@
# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
# This Makefile is responsible of generating the client and server
# implementation of IDL interfaces for both C++ and python usage.
# The building process of the C++ files is in charge of each source
# package and then is not manage here.
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
BASEIDL_FILES= NETGENPlugin_Algorithm.idl
# This variable defines the files to be installed
dist_salomeidl_DATA = $(BASEIDL_FILES)
# GUI idl common library
lib_LTLIBRARIES = libSalomeIDLNETGENPLUGIN.la
# Sources built from idl files
nodist_libSalomeIDLNETGENPLUGIN_la_SOURCES = NETGENPlugin_AlgorithmSK.cc
# header files must be exported: other modules have to use this library
nodist_salomeinclude_HEADERS = $(BASEIDL_FILES:%.idl=%.hh)
libSalomeIDLNETGENPLUGIN_la_CPPFLAGS = \
$(KERNEL_CXXFLAGS) \
$(GEOM_CXXFLAGS) \
$(SMESH_CXXFLAGS) \
@CORBA_CXXFLAGS@ \
@CORBA_INCLUDES@ \
-I$(top_builddir)/salome_adm/unix \
-I$(top_builddir)/idl
libSalomeIDLNETGENPLUGIN_la_LDFLAGS = -no-undefined -version-info=0:0:0
libSalomeIDLNETGENPLUGIN_la_LIBADD = \
$(KERNEL_LDFLAGS) -lSalomeIDLKernel \
$(SMESH_LDFLAGS) -lSalomeIDLSMESH \
$(GEOM_LDFLAGS) -lSalomeIDLGEOM \
@CORBA_LIBS@
# These variables defines the building process of CORBA files
OMNIORB_IDL = @OMNIORB_IDL@
OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
OMNIORB_IDLPYFLAGS = @OMNIORB_IDLPYFLAGS@ \
-I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome \
-I$(SMESH_ROOT_DIR)/idl/salome
IDLCXXFLAGS = \
-bcxx \
@IDLCXXFLAGS@ \
-I$(top_builddir)/idl/salome \
-I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome \
-I$(SMESH_ROOT_DIR)/idl/salome \
-I$(top_builddir)/salome_adm/unix
IDLPYFLAGS = \
@IDLPYFLAGS@ \
-I$(KERNEL_ROOT_DIR)/idl/salome \
-I$(GEOM_ROOT_DIR)/idl/salome \
-I$(SMESH_ROOT_DIR)/idl/salome
# potential problem on parallel make on the following - multiple outputs
SUFFIXES = .idl .hh SK.cc
.idlSK.cc:
$(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
.idl.hh:
$(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $<
install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%)
$(INSTALL) -d $(DESTDIR)$(salomepythondir)
ls $^ | while read file; do \
$(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \
done
# uninstall-local removes too much, but it works in distcheck
uninstall-local:
rm -rf $(DESTDIR)$(salomepythondir)/*
mostlyclean-local:
-rm -f *.hh *.cc .depidl
# we use cpp to generate dependencies between idl files.
# option x c tells the preprocessor to consider idl as a c file.
# if an idl is modified, all idl dependencies are rebuilt
.depidl: $(BASEIDL_FILES)
@echo "" > $@
@for dep in $^ dummy; do \
if [ $$dep != "dummy" ]; then \
echo Building dependencies for $$dep; \
$(CPP) $(C_DEPEND_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome -I$(GEOM_ROOT_DIR)/idl/salome -I$(SMESH_ROOT_DIR)/idl/salome -I$(top_builddir)/salome_adm/unix $$dep 2>/dev/null | \
sed 's/\.o/\SK.cc/' >>$@; \
fi; \
done ;
-include .depidl

View File

@ -1,84 +0,0 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
# generate dependencies for idl file :
#
# source path
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome :${SMESH_ROOT_DIR}/idl/salome
#:${MED_ROOT_DIR}/idl/salome
@COMMENCE@
IDL_FILES = NETGENPlugin_Algorithm.idl
# copy all idl file in $(top_builddir)/idl
inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(top_builddir)/idl/salome:
$(INSTALL) -d $@
$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
cp -f $^ $(top_builddir)/idl/salome
# python wrap
lib: pyidl
PYTHON_BUILD_SITE=$(top_builddir)/lib/python$(PYTHON_VERSION)/site-packages/@PACKAGE@
pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py)
$(PYTHON_BUILD_SITE):
$(INSTALL) -d $@
$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl
$(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $<
# install python client (generated from idl file)
install: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
$(INSTALL) -d $(idldir) $(PYTHON_SITE_INSTALL)
$(INSTALL_DATA) $^ $(idldir)
@for file in $^ dummy; do \
if [ $$file != "dummy" ]; then \
$(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_SITE_INSTALL) $$file ; \
fi ; \
done ;
uninstall:
-$(RM) $(IDL_FILES:%=$(idldir)/%)
-$(RM) $(IDL_FILES:%.idl=$(PYTHON_SITE_INSTALL)/%_idl.py)
# clean
cleandep:
-$(RM) .dep*
clean: cleandep
-$(RM) $(top_builddir)/idl/salome/*.idl
-$(RM) $(PYTHON_BUILD_SITE)/*.py
distclean: clean
-$(RM) Makefile

View File

@ -26,6 +26,7 @@
#ifndef _SMESH_NETGENALGORITHM_IDL_
#define _SMESH_NETGENALGORITHM_IDL_
#include "SALOME_Exception.idl"
#include "SMESH_Hypothesis.idl"
/*!
@ -41,19 +42,28 @@ module NETGENPlugin
};
/*!
* NETGENPlugin_NETGEN_2D: interface of "1D-2D (Netgen)" algorithm
* NETGENPlugin_NETGEN_2D: interface of "Netgen 1D-2D" algorithm
*/
interface NETGENPlugin_NETGEN_2D : SMESH::SMESH_2D_Algo
{
};
/*!
* NETGENPlugin_NETGEN_2D3D: interface of "1D-2D-3D (Netgen)" algorithm
* NETGENPlugin_NETGEN_2D3D: interface of "Netgen 1D-2D-3D" algorithm
*/
interface NETGENPlugin_NETGEN_2D3D : SMESH::SMESH_3D_Algo
{
};
/*!
* NETGENPlugin_NETGEN_2D_ONLY: interface of "Netgen 2D" algorithm,
* generating 2D elements on a geometrical face taking
* into account pre-existing nodes on face boundaries
*/
interface NETGENPlugin_NETGEN_2D_ONLY : SMESH::SMESH_2D_Algo
{
};
/*!
* NETGENPlugin_Hypothesis: interface of "NETGEN parameters" hypothesis
*/
@ -90,6 +100,69 @@ module NETGENPlugin
boolean GetQuadAllowed();
};
/*!
* NETGENPlugin_Hypothesis: interface of "NETGEN 2D simple parameters" hypothesis
*/
interface NETGENPlugin_SimpleHypothesis_2D : SMESH::SMESH_Hypothesis
{
/*!
* Sets <number of segments> value
*/
void SetNumberOfSegments(in short nb) raises (SALOME::SALOME_Exception);
/*!
* Returns <number of segments> value.
* Can be zero in case if LocalLength() has been set
*/
short GetNumberOfSegments();
/*!
* Sets <segment length> value
*/
void SetLocalLength(in double segmentLength);
/*!
* Returns <segment length> value.
* Can be zero in case if NumberOfSegments() has been set
*/
double GetLocalLength();
/*!
* Sets <maximum element area> to be dependent on 1D discretization
*/
void LengthFromEdges();
/*!
* Sets <maximum element area> value.
* Zero or negative value means same as LengthFromEdges().
*/
void SetMaxElementArea(in double area);
/*!
* Returns <maximum element area> value.
* Can be zero in case of LengthFromEdges()
*/
double GetMaxElementArea();
};
/*!
* NETGENPlugin_SimpleHypothesis_3D: interface of "NETGEN 3D simple parameters" hypothesis
*/
interface NETGENPlugin_SimpleHypothesis_3D : NETGENPlugin_SimpleHypothesis_2D
{
/*!
* Sets <maximum element volume> to be dependent on 2D discretization
*/
void LengthFromFaces();
/*!
* Sets <maximum element volume> value.
* Zero or negative value means same as LengthFromFaces().
*/
void SetMaxElementVolume(in double volume);
/*!
* Returns <maximum element volume> value
* Can be zero in case of LengthFromFaces()
*/
double GetMaxElementVolume();
};
};
#endif

View File

@ -1,5 +1,5 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -17,44 +17,29 @@
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# source path
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
VPATH=.:$(srcdir)/adm_local
# -* Makefile *-
#
# Author : Patrick GOLDBRONN (CEA)
# Date : 28/06/2001
# Modified by : Alexander BORODIN (OCN) - autotools usage
# $Header$
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
all: resources
install:
cp -rf @top_srcdir@/adm_local @prefix@
bin:
resources :
cp -rf @top_srcdir@/adm_local $(top_builddir)
inc:
lib:
depend:
depend_idl:
install-end:
install-include:
install-bin:
uninstall:
uninstall-idl:
distclean:
clean:
distclean-other:
dist_salomeres_DATA = \
NETGENPlugin.xml \
SalomeApp.xml
if NETGENPLUGIN_ENABLE_GUI
dist_salomeres_DATA += \
mesh_algo_netgen_2d.png \
mesh_algo_netgen_2d3d.png \
mesh_hypo_netgen.png \
mesh_hypo_netgen_2d.png \
mesh_tree_algo_netgen_2d.png \
mesh_tree_algo_netgen_2d3d.png \
mesh_tree_hypo_netgen.png \
mesh_tree_hypo_netgen_2d.png \
mesh_tree_algo_netgen.png
endif

View File

@ -7,8 +7,8 @@
<meshers-group name="NETGEN"
resources="NETGENPlugin"
server-lib="libNETGENEngine.so"
gui-lib="libNETGENPluginGUI.so">
server-lib="NETGENEngine"
gui-lib="NETGENPluginGUI">
<hypotheses>
<hypothesis type="NETGEN_Parameters"
label-id="NETGEN 3D Parameters"
@ -18,25 +18,46 @@
label-id="NETGEN 2D Parameters"
icon-id="mesh_hypo_netgen_2d.png"
dim="2"/>
<hypothesis type="NETGEN_SimpleParameters_2D"
label-id="NETGEN 2D Simple Parameters"
icon-id="mesh_hypo_netgen_2d.png"
dim="2"/>
<hypothesis type="NETGEN_SimpleParameters_3D"
label-id="NETGEN 3D Simple Parameters"
icon-id="mesh_hypo_netgen.png"
dim="3"/>
</hypotheses>
<algorithms>
<algorithm type="NETGEN_3D"
label-id="Tetrahedron (Netgen)"
icon-id="mesh_algo_tetra.png"
hypos="MaxElementVolume"
input="TRIA"
need-geom="false"
input="TRIA,QUAD"
dim="3"/>
<algorithm type="NETGEN_2D"
label-id="Netgen 1D-2D"
icon-id="mesh_algo_netgen_2d.png"
hypos="NETGEN_Parameters_2D"
hypos="NETGEN_Parameters_2D, NETGEN_SimpleParameters_2D"
output="TRIA,QUAD"
dim="2"/>
dim="2"
support-submeshes="true"
/>
<algorithm type="NETGEN_2D3D"
label-id="Netgen 1D-2D-3D"
icon-id="mesh_algo_netgen_2d3d.png"
hypos="NETGEN_Parameters"
dim="3"/>
hypos="NETGEN_Parameters, NETGEN_SimpleParameters_3D"
dim="3"
support-submeshes="true"
/>
<algorithm type="NETGEN_2D_ONLY"
label-id="Netgen 2D"
icon-id="mesh_algo_netgen_2d.png"
hypos="LengthFromEdges,MaxElementArea"
opt-hypos="QuadranglePreference"
input="EDGE"
output="TRIA,QUAD"
dim="2"/>
</algorithms>
</meshers-group>

9
resources/SalomeApp.xml Normal file
View File

@ -0,0 +1,9 @@
<document>
<section name="resources">
<parameter name="NETGENPlugin" value="${NETGENPLUGIN_ROOT_DIR}/share/salome/resources/netgenplugin"/>
</section>
<section name="SMESH">
<!-- Default SMESH module plugins -->
<parameter name="plugins" value="NETGENPlugin,GHS3DPlugin"/>
</section>
</document>

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

75
src/GUI/Makefile.am Normal file
View File

@ -0,0 +1,75 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : Makefile.in
# Author : Michael Sazonov
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : NETGENPLUGIN
# $Header$
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# header files
salomeinclude_HEADERS =
# Libraries targets
lib_LTLIBRARIES = libNETGENPluginGUI.la
dist_libNETGENPluginGUI_la_SOURCES = \
NETGENPluginGUI.cxx \
NETGENPluginGUI_HypothesisCreator.h \
NETGENPluginGUI_HypothesisCreator.cxx \
NETGENPluginGUI_SimpleCreator.h \
NETGENPluginGUI_SimpleCreator.cxx
MOC_FILES = \
NETGENPluginGUI_HypothesisCreator_moc.cxx \
NETGENPluginGUI_SimpleCreator_moc.cxx
nodist_libNETGENPluginGUI_la_SOURCES= \
$(MOC_FILES)
# additionnal information to compil and link file
libNETGENPluginGUI_la_CPPFLAGS = \
$(QT_INCLUDES) \
$(CAS_CPPFLAGS) \
$(PYTHON_INCLUDES) \
$(KERNEL_CXXFLAGS) \
$(GUI_CXXFLAGS) \
$(GEOM_CXXFLAGS) \
$(MED_CXXFLAGS) \
$(SMESH_CXXFLAGS) \
$(BOOST_CPPFLAGS) \
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
-I$(srcdir)/../NETGENPlugin \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
libNETGENPluginGUI_la_LDFLAGS = \
../NETGENPlugin/libNETGENEngine.la \
${SMESH_LDFLAGS} -lSMESH \
$(CAS_KERNEL)
# resources files
nodist_salomeres_DATA= \
NETGENPlugin_images.qm \
NETGENPlugin_msg_en.qm

View File

@ -1,74 +0,0 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# File : Makefile.in
# Author : Michael Sazonov
# Module : NETGENPLUGIN
# $Header$
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome:${GUI_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${SMESH_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
@COMMENCE@
# .po files to transform in .qm
PO_FILES = \
NETGENPlugin_images.po \
NETGENPlugin_msg_en.po
# Libraries targets
LIB = libNETGENPluginGUI.la
LIB_SRC = \
NETGENPluginGUI.cxx \
NETGENPluginGUI_HypothesisCreator.cxx
LIB_MOC = \
NETGENPluginGUI_HypothesisCreator.h
LIB_CLIENT_IDL = \
SALOME_Exception.idl \
SALOME_GenericObj.idl \
SALOME_Component.idl \
SALOME_Comm.idl \
GEOM_Gen.idl \
MED.idl \
SMESH_Gen.idl \
SMESH_Mesh.idl \
SMESH_Group.idl \
NETGENPlugin_Algorithm.idl
LIB_SERVER_IDL =
# additionnal information to compil and link file
CPPFLAGS += $(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) \
-I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \
-I${GEOM_ROOT_DIR}/include/salome -I${SMESH_ROOT_DIR}/include/salome \
$(BOOST_CPPFLAGS)
CXXFLAGS += -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \
-I${GEOM_ROOT_DIR}/include/salome -I${SMESH_ROOT_DIR}/include/salome
LDFLAGS += -lSMESH $(OCC_KERNEL_LIBS) -L${KERNEL_ROOT_DIR}/lib/salome \
-L${GUI_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome \
-L${SMESH_ROOT_DIR}/lib/salome
@CONCLUDE@

View File

@ -27,6 +27,7 @@
//#include "SMESHGUI_Hypotheses.h"
#include "NETGENPluginGUI_HypothesisCreator.h"
#include "NETGENPluginGUI_SimpleCreator.h"
//=============================================================================
/*! GetHypothesisCreator
@ -35,11 +36,15 @@
//=============================================================================
extern "C"
{
NETGENPLUGIN_GUI_EXPORT
SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType )
{
SMESHGUI_GenericHypothesisCreator* aCreator = NULL;
if( aHypType=="NETGEN_Parameters_2D" || aHypType=="NETGEN_Parameters" )
aCreator = new NETGENPluginGUI_HypothesisCreator( aHypType );
else if ( aHypType=="NETGEN_SimpleParameters_2D" ||
aHypType=="NETGEN_SimpleParameters_3D" )
aCreator = new NETGENPluginGUI_SimpleCreator( aHypType );
return aCreator;
}
}

View File

@ -33,19 +33,20 @@
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
#include <SalomeApp_Tools.h>
#include <QtxDblSpinBox.h>
#include <QtxComboBox.h>
#include <QtxDoubleSpinBox.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include <qframe.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qpixmap.h>
#include <QComboBox>
#include <QLabel>
#include <QGroupBox>
#include <QFrame>
#include <QLayout>
#include <QLineEdit>
#include <QCheckBox>
#include <QPixmap>
enum Fineness
{
@ -79,69 +80,86 @@ bool NETGENPluginGUI_HypothesisCreator::checkParams() const
QFrame* NETGENPluginGUI_HypothesisCreator::buildFrame()
{
QFrame* fr = new QFrame( 0, "myframe" );
QVBoxLayout* lay = new QVBoxLayout( fr, 5, 0 );
QFrame* fr = new QFrame( 0 );
fr->setObjectName( "myframe" );
QVBoxLayout* lay = new QVBoxLayout( fr );
lay->setMargin( 5 );
lay->setSpacing( 0 );
QGroupBox* GroupC1 = new QGroupBox( 2, Qt::Horizontal, fr, "GroupC1" );
QGroupBox* GroupC1 = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
lay->addWidget( GroupC1 );
GroupC1->setTitle( tr( "SMESH_ARGUMENTS" ) );
GroupC1->layout()->setSpacing( 6 );
GroupC1->layout()->setMargin( 11 );
QGridLayout* aGroupLayout = new QGridLayout( GroupC1 );
aGroupLayout->setSpacing( 6 );
aGroupLayout->setMargin( 11 );
int row = 0;
myName = 0;
if( isCreation() )
{
new QLabel( tr( "SMESH_NAME" ), GroupC1 );
aGroupLayout->addWidget( new QLabel( tr( "SMESH_NAME" ), GroupC1 ), row, 0 );
myName = new QLineEdit( GroupC1 );
aGroupLayout->addWidget( myName, row, 1 );
row++;
}
new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 );
myMaxSize = new QtxDblSpinBox( GroupC1 );
myMaxSize->setPrecision( 7 );
myMaxSize->setMinValue( 1e-07 );
myMaxSize->setMaxValue( 1e+06 );
myMaxSize->setLineStep( 10 );
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_MAX_SIZE" ), GroupC1 ), row, 0 );
myMaxSize = new QtxDoubleSpinBox( GroupC1 );
myMaxSize->setDecimals( 7 );
myMaxSize->setMinimum( 1e-07 );
myMaxSize->setMaximum( 1e+06 );
myMaxSize->setSingleStep( 10 );
aGroupLayout->addWidget( myMaxSize, row, 1 );
row++;
mySecondOrder = new QCheckBox( tr( "NETGEN_SECOND_ORDER" ), GroupC1 );
GroupC1->addSpace(0);
aGroupLayout->addWidget( mySecondOrder, row, 0 );
row++;
new QLabel( tr( "NETGEN_FINENESS" ), GroupC1 );
myFineness = new QtxComboBox( GroupC1 );
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_FINENESS" ), GroupC1 ), row, 0 );
myFineness = new QComboBox( GroupC1 );
QStringList types;
types.append( QObject::tr( "NETGEN_VERYCOARSE" ) );
types.append( QObject::tr( "NETGEN_COARSE" ) );
types.append( QObject::tr( "NETGEN_MODERATE" ) );
types.append( QObject::tr( "NETGEN_FINE" ) );
types.append( QObject::tr( "NETGEN_VERYFINE" ) );
types.append( QObject::tr( "NETGEN_CUSTOM" ) );
myFineness->insertStringList( types );
types << tr( "NETGEN_VERYCOARSE" ) << tr( "NETGEN_COARSE" ) << tr( "NETGEN_MODERATE" ) <<
tr( "NETGEN_FINE" ) << tr( "NETGEN_VERYFINE" ) << tr( "NETGEN_CUSTOM" );
myFineness->addItems( types );
aGroupLayout->addWidget( myFineness, row, 1 );
row++;
new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 );
myGrowthRate = new QtxDblSpinBox( GroupC1 );
myGrowthRate->setMinValue( 0.1 );
myGrowthRate->setMaxValue( 10 );
myGrowthRate->setLineStep( 0.1 );
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_GROWTH_RATE" ), GroupC1 ), row, 0 );
myGrowthRate = new QtxDoubleSpinBox( GroupC1 );
myGrowthRate->setMinimum( 0.1 );
myGrowthRate->setMaximum( 10 );
myGrowthRate->setSingleStep( 0.1 );
aGroupLayout->addWidget( myGrowthRate, row, 1 );
row++;
const double VALUE_MAX = 1.0e+6;
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 ), row, 0 );
myNbSegPerEdge = new QtxDoubleSpinBox( GroupC1 );
myNbSegPerEdge->setMinimum( 0.2 );
myNbSegPerEdge->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
aGroupLayout->addWidget( myNbSegPerEdge, row, 1 );
row++;
new QLabel( tr( "NETGEN_SEG_PER_EDGE" ), GroupC1 );
myNbSegPerEdge = new QtxDblSpinBox( GroupC1 );
myNbSegPerEdge->setMinValue( 0.2 );
myNbSegPerEdge->setMaxValue( 5.0 );
new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 );
myNbSegPerRadius = new QtxDblSpinBox( GroupC1 );
myNbSegPerRadius->setMinValue( 0.2 );
myNbSegPerRadius->setMaxValue( 5.0 );
aGroupLayout->addWidget( new QLabel( tr( "NETGEN_SEG_PER_RADIUS" ), GroupC1 ), row, 0 );
myNbSegPerRadius = new QtxDoubleSpinBox( GroupC1 );
myNbSegPerRadius->setMinimum( 0.2 );
myNbSegPerRadius->setMaximum( VALUE_MAX ); // (PAL14890) max value in native netgen gui is 5
aGroupLayout->addWidget( myNbSegPerRadius, row, 1 );
row++;
if ( hypType()=="NETGEN_Parameters_2D" )
{
myAllowQuadrangles = new QCheckBox( tr( "NETGEN_ALLOW_QUADRANGLES" ), GroupC1 );
GroupC1->addSpace(0);
aGroupLayout->addWidget( myAllowQuadrangles, row, 0 );
myIs2D = true;
row++;
}
myOptimize = new QCheckBox( tr( "NETGEN_OPTIMIZE" ), GroupC1 );
GroupC1->addSpace(0);
aGroupLayout->addWidget( myOptimize, row, 0 );
row++;
connect( myFineness, SIGNAL( activated( int ) ), this, SLOT( onFinenessChanged() ) );
@ -158,7 +176,7 @@ void NETGENPluginGUI_HypothesisCreator::retrieveParams() const
myMaxSize->setValue( data.myMaxSize );
mySecondOrder->setChecked( data.mySecondOrder );
myOptimize->setChecked( data.myOptimize );
myFineness->setCurrentItem( data.myFineness );
myFineness->setCurrentIndex( data.myFineness );
myGrowthRate->setValue( data.myGrowthRate );
myNbSegPerEdge->setValue( data.myNbSegPerEdge );
myNbSegPerRadius->setValue( data.myNbSegPerRadius );
@ -166,7 +184,7 @@ void NETGENPluginGUI_HypothesisCreator::retrieveParams() const
myAllowQuadrangles->setChecked( data.myAllowQuadrangles );
// update widgets
bool isCustom = (myFineness->currentItem() == UserDefined);
bool isCustom = (myFineness->currentIndex() == UserDefined);
myGrowthRate->setEnabled(isCustom);
myNbSegPerEdge->setEnabled(isCustom);
myNbSegPerRadius->setEnabled(isCustom);
@ -231,7 +249,7 @@ bool NETGENPluginGUI_HypothesisCreator::storeParamsToHypo( const NetgenHypothesi
try
{
if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.latin1() );
SMESH::SetName( SMESH::FindSObject( h ), h_data.myName.toLatin1().data() );
h->SetMaxSize( h_data.myMaxSize );
h->SetSecondOrder( h_data.mySecondOrder );
@ -269,7 +287,7 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD
h_data.myMaxSize = myMaxSize->value();
h_data.mySecondOrder = mySecondOrder->isChecked();
h_data.myOptimize = myOptimize->isChecked();
h_data.myFineness = myFineness->currentItem();
h_data.myFineness = myFineness->currentIndex();
h_data.myGrowthRate = myGrowthRate->value();
h_data.myNbSegPerEdge = myNbSegPerEdge->value();
h_data.myNbSegPerRadius = myNbSegPerRadius->value();
@ -282,7 +300,7 @@ bool NETGENPluginGUI_HypothesisCreator::readParamsFromWidgets( NetgenHypothesisD
void NETGENPluginGUI_HypothesisCreator::onFinenessChanged()
{
bool isCustom = (myFineness->currentItem() == UserDefined);
bool isCustom = (myFineness->currentIndex() == UserDefined);
myGrowthRate->setEnabled(isCustom);
myNbSegPerEdge->setEnabled(isCustom);
@ -292,7 +310,7 @@ void NETGENPluginGUI_HypothesisCreator::onFinenessChanged()
{
double aGrowthRate, aNbSegPerEdge, aNbSegPerRadius;
switch ( myFineness->currentItem() )
switch ( myFineness->currentIndex() )
{
case VeryCoarse:
aGrowthRate = 0.7;
@ -330,16 +348,21 @@ void NETGENPluginGUI_HypothesisCreator::onFinenessChanged()
QString NETGENPluginGUI_HypothesisCreator::caption() const
{
return tr( QString( "NETGEN_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")) );
return tr( QString( "NETGEN_%1_TITLE" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
}
QPixmap NETGENPluginGUI_HypothesisCreator::icon() const
{
QString hypIconName = tr( QString("ICON_DLG_NETGEN_PARAMETERS%1").arg(myIs2D?QString("_2D"):QString("")) );
QString hypIconName = tr( QString("ICON_DLG_NETGEN_PARAMETERS%1").arg(myIs2D?QString("_2D"):QString("")).toLatin1().data() );
return SUIT_Session::session()->resourceMgr()->loadPixmap( "NETGENPlugin", hypIconName );
}
QString NETGENPluginGUI_HypothesisCreator::type() const
{
return tr( QString( "NETGEN_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")) );
return tr( QString( "NETGEN_%1_HYPOTHESIS" ).arg(myIs2D?QString("2D"):QString("3D")).toLatin1().data() );
}
QString NETGENPluginGUI_HypothesisCreator::helpPage() const
{
return "netgen_2d_3d_hypo_page.html";
}

View File

@ -28,10 +28,20 @@
#ifndef NETGENPLUGINGUI_HypothesisCreator_HeaderFile
#define NETGENPLUGINGUI_HypothesisCreator_HeaderFile
#ifdef WIN32
#ifdef NETGENPLUGIN_GUI_EXPORTS
#define NETGENPLUGIN_GUI_EXPORT __declspec( dllexport )
#else
#define NETGENPLUGIN_GUI_EXPORT __declspec( dllimport )
#endif
#else
#define NETGENPLUGIN_GUI_EXPORT
#endif
#include <SMESHGUI_Hypotheses.h>
class QtxDblSpinBox;
class QtxComboBox;
class QtxDoubleSpinBox;
class QComboBox;
class QCheckBox;
class QLineEdit;
@ -46,7 +56,7 @@ typedef struct
/*!
* \brief Class for creation of NETGEN2D and NETGEN3D hypotheses
*/
class NETGENPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
class NETGENPLUGIN_GUI_EXPORT NETGENPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
{
Q_OBJECT
@ -54,7 +64,8 @@ public:
NETGENPluginGUI_HypothesisCreator( const QString& );
virtual ~NETGENPluginGUI_HypothesisCreator();
virtual bool checkParams() const;
virtual bool checkParams() const;
virtual QString helpPage() const;
protected:
virtual QFrame* buildFrame ();
@ -74,15 +85,15 @@ private:
bool storeParamsToHypo( const NetgenHypothesisData& ) const;
private:
QLineEdit* myName;
QtxDblSpinBox* myMaxSize;
QCheckBox* mySecondOrder;
QCheckBox* myOptimize;
QtxComboBox* myFineness;
QtxDblSpinBox* myGrowthRate;
QtxDblSpinBox* myNbSegPerEdge;
QtxDblSpinBox* myNbSegPerRadius;
QCheckBox* myAllowQuadrangles;
QLineEdit* myName;
QtxDoubleSpinBox* myMaxSize;
QCheckBox* mySecondOrder;
QCheckBox* myOptimize;
QComboBox* myFineness;
QtxDoubleSpinBox* myGrowthRate;
QtxDoubleSpinBox* myNbSegPerEdge;
QtxDoubleSpinBox* myNbSegPerRadius;
QCheckBox* myAllowQuadrangles;
bool myIs2D;
};

View File

@ -0,0 +1,358 @@
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPluginGUI_SimpleCreator.cxx
// Author : Open CASCADE S.A.S.
//
// SMESH includes
#include "NETGENPluginGUI_SimpleCreator.h"
#include <SMESHGUI_Utils.h>
#include <SMESHGUI_HypothesesUtils.h>
#include <SMESHGUI_SpinBox.h>
// IDL includes
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
// SALOME GUI includes
#include <SalomeApp_Tools.h>
#include <QtxIntSpinBox.h>
// Qt includes
#include <QLabel>
#include <QGroupBox>
#include <QFrame>
#include <QLineEdit>
//#include <QButtonGroup>
#include <QRadioButton>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QApplication>
#include <QCheckBox>
#define SPACING 6
#define MARGIN 11
// copied from StdMeshersGUI_StdHypothesisCreator.cxx
const double VALUE_MAX = 1.0e+15, // COORD_MAX
VALUE_MAX_2 = VALUE_MAX * VALUE_MAX,
VALUE_MAX_3 = VALUE_MAX_2 * VALUE_MAX,
VALUE_SMALL = 1.0e-15,
VALUE_SMALL_2 = VALUE_SMALL * VALUE_SMALL,
VALUE_SMALL_3 = VALUE_SMALL_2 * VALUE_SMALL;
NETGENPluginGUI_SimpleCreator::NETGENPluginGUI_SimpleCreator(const QString& theHypType)
: SMESHGUI_GenericHypothesisCreator( theHypType ),
myName(0),
myNbSeg(0),
myLength(0),
myNbSegRadioBut(0),
myLengthRadioBut(0),
myLenFromEdgesCheckBox(0),
myArea(0),
myLenFromFacesCheckBox(0),
myVolume(0)
{
}
NETGENPluginGUI_SimpleCreator::~NETGENPluginGUI_SimpleCreator()
{
}
bool NETGENPluginGUI_SimpleCreator::checkParams() const
{
return true;
}
QFrame* NETGENPluginGUI_SimpleCreator::buildFrame()
{
QFrame* fr = new QFrame();
QVBoxLayout* lay = new QVBoxLayout( fr );
lay->setMargin( 0 );
lay->setSpacing( 0 );
QGroupBox* argGroup = new QGroupBox( tr( "SMESH_ARGUMENTS" ), fr );
lay->addWidget( argGroup );
QGridLayout* argLay = new QGridLayout( argGroup );
argLay->setSpacing( SPACING );
argLay->setMargin( MARGIN );
argLay->setColumnStretch( 0, 0 );
argLay->setColumnStretch( 1, 1 );
int argRow = 0;
// Name
if( isCreation() ) {
myName = new QLineEdit( argGroup );
argLay->addWidget( new QLabel( tr( "SMESH_NAME" ), argGroup ), argRow, 0 );
argLay->addWidget( myName, argRow, 1 );
argRow++;
}
QGroupBox* dimGroup;
QGridLayout* dimLay;
int dimRow;
// 1D params group
dimGroup = new QGroupBox( tr( "NG_1D" ), argGroup );
argLay->addWidget( dimGroup, argRow, 0, 1, 2 );
argRow++;
dimLay = new QGridLayout( dimGroup );
dimLay->setSpacing( SPACING );
dimLay->setMargin( MARGIN );
dimLay->setColumnStretch( 0, 0 );
dimLay->setColumnStretch( 1, 1 );
dimRow = 0;
// * number of segments
myNbSegRadioBut = new QRadioButton( tr( "SMESH_NB_SEGMENTS_HYPOTHESIS" ), dimGroup );
myNbSeg = new QtxIntSpinBox( dimGroup );
myNbSeg->setMinimum( 1 );
myNbSeg->setMaximum( 9999 );
myNbSeg->setValue( 1 );
dimLay->addWidget( myNbSegRadioBut, dimRow, 0 );
dimLay->addWidget( myNbSeg, dimRow, 1 );
dimRow++;
// * local length
myLengthRadioBut = new QRadioButton( tr( "SMESH_LOCAL_LENGTH_HYPOTHESIS" ), dimGroup );
myLength = new SMESHGUI_SpinBox( dimGroup );
myLength->RangeStepAndValidator( VALUE_SMALL, VALUE_MAX, 0.1, 6 );
myLength->setValue( 1. );
dimLay->addWidget( myLengthRadioBut, dimRow, 0 );
dimLay->addWidget( myLength, dimRow, 1 );
dimRow++;
// 2D params group
dimGroup = new QGroupBox( tr( "NG_2D" ), argGroup );
argLay->addWidget( dimGroup, argRow, 0, 1, 2 );
argRow++;
dimLay = new QGridLayout( dimGroup );
dimLay->setSpacing( SPACING );
dimLay->setMargin( MARGIN );
dimLay->setColumnStretch( 0, 0 );
dimLay->setColumnStretch( 1, 1 );
dimRow = 0;
// * Length from edges
myLenFromEdgesCheckBox = new QCheckBox( tr( "NG_LENGTH_FROM_EDGES" ), dimGroup );
dimLay->addWidget( myLenFromEdgesCheckBox, dimRow, 0, 1, 2 );
dimRow++;
// * max area
dimLay->addWidget( new QLabel( tr( "SMESH_MAX_ELEMENT_AREA_HYPOTHESIS" ), dimGroup), dimRow, 0);
myArea = new SMESHGUI_SpinBox( dimGroup );
myArea->RangeStepAndValidator( VALUE_SMALL_2, VALUE_MAX_2, 0.1, 6 );
myArea->setValue( 1. );
dimLay->addWidget( myArea, dimRow, 1 );
dimRow++;
// 3D params group
if ( hypType()=="NETGEN_SimpleParameters_3D" )
{
dimGroup = new QGroupBox( tr( "NG_3D" ), argGroup );
argLay->addWidget( dimGroup, argRow, 0, 1, 2 );
argRow++;
dimLay = new QGridLayout( dimGroup );
dimLay->setSpacing( SPACING );
dimLay->setMargin( MARGIN );
dimLay->setColumnStretch( 0, 0 );
dimLay->setColumnStretch( 1, 1 );
dimRow = 0;
// * Length from faces
myLenFromFacesCheckBox = new QCheckBox( tr( "NG_LENGTH_FROM_FACES" ), dimGroup );
dimLay->addWidget( myLenFromFacesCheckBox, dimRow, 0, 1, 2 );
dimRow++;
// * max volume
dimLay->addWidget(new QLabel( tr("SMESH_MAX_ELEMENT_VOLUME_HYPOTHESIS"), dimGroup), dimRow, 0);
myVolume = new SMESHGUI_SpinBox( dimGroup );
myVolume->RangeStepAndValidator( VALUE_SMALL_3, VALUE_MAX_3, 0.1, 6 );
myVolume->setValue( 1. );
dimLay->addWidget( myVolume, dimRow, 1 );
dimRow++;
}
connect( myNbSegRadioBut, SIGNAL( clicked(bool) ), this, SLOT( onValueChanged() ));
connect( myLengthRadioBut, SIGNAL( clicked(bool) ), this, SLOT( onValueChanged() ));
connect( myLenFromEdgesCheckBox, SIGNAL( stateChanged(int)), this, SLOT( onValueChanged() ));
if ( myLenFromFacesCheckBox )
connect( myLenFromFacesCheckBox, SIGNAL( stateChanged(int)), this, SLOT( onValueChanged() ));
return fr;
}
void NETGENPluginGUI_SimpleCreator::retrieveParams() const
{
if ( isCreation() )
myName->setText( hypName() );
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h =
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() );
// 1D
int nbSeg = (int) h->GetNumberOfSegments();
myNbSegRadioBut->setChecked( nbSeg );
myLengthRadioBut->setChecked( !nbSeg );
if ( nbSeg ) {
myLength->setEnabled( false );
myNbSeg->setEnabled( true );
myNbSeg->setValue( nbSeg );
}
else {
myNbSeg->setEnabled( false );
myLength->setEnabled( true );
myLength->setValue( h->GetLocalLength() );
}
// 2D
if ( double area = h->GetMaxElementArea() ) {
myLenFromEdgesCheckBox->setChecked( false );
myArea->setEnabled( true );
myArea->setValue( area );
}
else {
myLenFromEdgesCheckBox->setChecked( true );
myArea->setEnabled( false );
}
// 3D
if ( myVolume ) {
NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h =
NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis() );
if ( double volume = (double) h->GetMaxElementVolume() ) {
myLenFromFacesCheckBox->setChecked( false );
myVolume->setEnabled( true );
myVolume->setValue( volume );
}
else {
myLenFromFacesCheckBox->setChecked( true );
myVolume->setEnabled( false );
}
}
}
QString NETGENPluginGUI_SimpleCreator::storeParams() const
{
QString valStr;
try
{
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D_var h =
NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D::_narrow( initParamsHypothesis() );
if( isCreation() )
SMESH::SetName( SMESH::FindSObject( h ), myName->text().toLatin1().data() );
// 1D
if ( myNbSeg->isEnabled() ) {
h->SetNumberOfSegments( myNbSeg->value() );
valStr += "nbSeg=" + myNbSeg->text();
}
else {
h->SetLocalLength( myLength->value() );
valStr += "len=" + myNbSeg->text();
}
// 2D
if ( myArea->isEnabled() ) {
h->SetMaxElementArea( myArea->value() );
valStr += "; area=" + myArea->text();
}
else {
h->LengthFromEdges();
valStr += "; lenFromEdges";
}
// 3D
if ( myVolume ) {
NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D_var h =
NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D::_narrow( initParamsHypothesis() );
if ( myVolume->isEnabled() ) {
h->SetMaxElementVolume( myVolume->value() );
valStr += "; vol=" + myVolume->text();
}
else {
h->LengthFromFaces();
valStr += "; lenFromFaces";
}
}
}
catch(const SALOME::SALOME_Exception& ex)
{
SalomeApp_Tools::QtCatchCorbaException(ex);
}
return valStr;
}
void NETGENPluginGUI_SimpleCreator::onValueChanged()
{
QObject* changed = sender();
if ( myNbSegRadioBut == changed )
{
myLengthRadioBut->setChecked( !myNbSegRadioBut->isChecked() );
}
else if ( myLengthRadioBut == changed )
{
myNbSegRadioBut->setChecked( !myLengthRadioBut->isChecked() );
}
else if ( myLenFromEdgesCheckBox == changed )
{
myArea->setEnabled( !myLenFromEdgesCheckBox->isChecked() );
}
else if ( myLenFromFacesCheckBox == changed )
{
myVolume->setEnabled( !myLenFromFacesCheckBox->isChecked() );
}
myLength->setEnabled( myLengthRadioBut->isChecked() );
myNbSeg->setEnabled( myNbSegRadioBut->isChecked() );
}
QString NETGENPluginGUI_SimpleCreator::caption() const
{
return tr( (hypType() + "_TITLE").toLatin1().data() );
}
QPixmap NETGENPluginGUI_SimpleCreator::icon() const
{
QString hypIconName = tr( ("ICON_DLG_" + hypType()).toLatin1().data() );
return SUIT_Session::session()->resourceMgr()->loadPixmap( "NETGENPlugin", hypIconName );
}
QString NETGENPluginGUI_SimpleCreator::type() const
{
return tr( (hypType() + "_HYPOTHESIS").toLatin1().data() );
}
QString NETGENPluginGUI_SimpleCreator::helpPage() const
{
return "netgen_2d_3d_hypo_page.html";
}

View File

@ -0,0 +1,75 @@
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPluginGUI_SimpleCreator.h
// Author : Open CASCADE S.A.S.
//
#ifndef NETGENPluginGUI_SimpleCreator_H
#define NETGENPluginGUI_SimpleCreator_H
// SMESH includes
#include "NETGENPlugin_Defs.hxx"
#include <SMESHGUI_Hypotheses.h>
class QCheckBox;
class QLineEdit;
class QRadioButton;
class QtxIntSpinBox;
class SMESHGUI_SpinBox;
class NETGENPLUGIN_EXPORT NETGENPluginGUI_SimpleCreator : public SMESHGUI_GenericHypothesisCreator
{
Q_OBJECT
public:
NETGENPluginGUI_SimpleCreator(const QString& theHypType);
virtual ~NETGENPluginGUI_SimpleCreator();
virtual bool checkParams() const;
virtual QString helpPage() const;
protected:
virtual QFrame* buildFrame();
virtual void retrieveParams() const;
virtual QString storeParams() const;
virtual QString caption() const;
virtual QPixmap icon() const;
virtual QString type() const;
protected slots:
void onValueChanged();
private:
QLineEdit * myName;
QtxIntSpinBox* myNbSeg;
SMESHGUI_SpinBox* myLength;
QRadioButton* myNbSegRadioBut, *myLengthRadioBut;
QCheckBox* myLenFromEdgesCheckBox;
SMESHGUI_SpinBox* myArea;
QCheckBox* myLenFromFacesCheckBox;
SMESHGUI_SpinBox* myVolume;
};
#endif // NETGENPluginGUI_SimpleCreator_H

View File

@ -1,59 +0,0 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# This is a Qt message file in .po format. Each msgid starts with
# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
# would be translated to "Pub", not "Foo::Pub".
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n"
"PO-Revision-Date: YYYY-MM-DD\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
#-----------------------------------------------------------
# Hypothesis
#-----------------------------------------------------------
msgid "ICON_DLG_NETGEN_PARAMETERS"
msgstr "mesh_hypo_netgen.png"
msgid "ICON_DLG_NETGEN_PARAMETERS_2D"
msgstr "mesh_hypo_netgen_2d.png"
#-----------------------------------------------------------
# ObjectBrowser
#-----------------------------------------------------------
msgid "ICON_SMESH_TREE_ALGO_NETGEN_3D"
msgstr "mesh_tree_algo_tetra.png"
msgid "ICON_SMESH_TREE_ALGO_NETGEN_2D"
msgstr "mesh_tree_algo_netgen_2d.png"
msgid "ICON_SMESH_TREE_ALGO_NETGEN_2D3D"
msgstr "mesh_tree_algo_netgen_2d3d.png"
msgid "ICON_SMESH_TREE_HYPO_NETGEN_Parameters"
msgstr "mesh_tree_hypo_netgen.png"
msgid "ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D"
msgstr "mesh_tree_hypo_netgen_2d.png"

View File

@ -0,0 +1,50 @@
<!DOCTYPE TS>
<TS version="1.1" >
<context>
<name>@default</name>
<message>
<source>ICON_DLG_NETGEN_PARAMETERS</source>
<translation>mesh_hypo_netgen.png</translation>
</message>
<message>
<source>ICON_DLG_NETGEN_PARAMETERS_2D</source>
<translation>mesh_hypo_netgen_2d.png</translation>
</message>
<message>
<source>ICON_DLG_NETGEN_SimpleParameters_3D</source>
<translation>mesh_hypo_netgen.png</translation>
</message>
<message>
<source>ICON_DLG_NETGEN_SimpleParameters_2D</source>
<translation>mesh_hypo_netgen_2d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_ALGO_NETGEN_2D</source>
<translation>mesh_tree_algo_netgen_2d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_ALGO_NETGEN_2D3D</source>
<translation>mesh_tree_algo_netgen_2d3d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_ALGO_NETGEN_3D</source>
<translation>mesh_tree_algo_tetra.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_HYPO_NETGEN_Parameters</source>
<translation>mesh_tree_hypo_netgen.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_HYPO_NETGEN_Parameters_2D</source>
<translation>mesh_tree_hypo_netgen_2d.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_HYPO_NETGEN_SimpleParameters_3D</source>
<translation>mesh_tree_hypo_netgen.png</translation>
</message>
<message>
<source>ICON_SMESH_TREE_HYPO_NETGEN_SimpleParameters_2D</source>
<translation>mesh_tree_hypo_netgen_2d.png</translation>
</message>
</context>
</TS>

View File

@ -1,84 +0,0 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# This is a Qt message file in .po format. Each msgid starts with
# a scope. This scope should *NOT* be translated - eg. "Foo::Bar"
# would be translated to "Pub", not "Foo::Pub".
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2002-05-28 10:46:48 AM CEST\n"
"PO-Revision-Date: YYYY-MM-DD\n"
"Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
msgid "NETGEN_MAX_SIZE"
msgstr "Max. Size"
msgid "NETGEN_SECOND_ORDER"
msgstr "Second Order"
msgid "NETGEN_OPTIMIZE"
msgstr "Optimize"
msgid "NETGEN_FINENESS"
msgstr "Fineness"
msgid "NETGEN_VERYCOARSE"
msgstr "Very Coarse"
msgid "NETGEN_COARSE"
msgstr "Coarse"
msgid "NETGEN_MODERATE"
msgstr "Moderate"
msgid "NETGEN_FINE"
msgstr "Fine"
msgid "NETGEN_VERYFINE"
msgstr "Very Fine"
msgid "NETGEN_CUSTOM"
msgstr "Custom"
msgid "NETGEN_GROWTH_RATE"
msgstr "Growth Rate"
msgid "NETGEN_SEG_PER_EDGE"
msgstr "Nb. Segs per Edge"
msgid "NETGEN_SEG_PER_RADIUS"
msgstr "Nb. Segs per Radius"
msgid "NETGEN_ALLOW_QUADRANGLES"
msgstr "Allow Quadrangles"
msgid "NETGEN_2D_HYPOTHESIS"
msgstr "Netgen 2D"
msgid "NETGEN_3D_HYPOTHESIS"
msgstr "Netgen 3D"
msgid "NETGEN_2D_TITLE"
msgstr "Hypothesis Construction"
msgid "NETGEN_3D_TITLE"
msgstr "Hypothesis Construction"

View File

@ -0,0 +1,114 @@
<!DOCTYPE TS>
<TS version="1.1" >
<context>
<name>@default</name>
<message>
<source>NETGEN_2D_HYPOTHESIS</source>
<translation>Netgen 2D</translation>
</message>
<message>
<source>NETGEN_2D_TITLE</source>
<translation>Hypothesis Construction</translation>
</message>
<message>
<source>NETGEN_3D_HYPOTHESIS</source>
<translation>Netgen 3D</translation>
</message>
<message>
<source>NETGEN_3D_TITLE</source>
<translation>Hypothesis Construction</translation>
</message>
<message>
<source>NETGEN_SimpleParameters_3D_HYPOTHESIS</source>
<translation>Netgen 3D simple parameters</translation>
</message>
<message>
<source>NETGEN_SimpleParameters_3D_TITLE</source>
<translation>Hypothesis Construction</translation>
</message>
<message>
<source>NETGEN_SimpleParameters_2D_HYPOTHESIS</source>
<translation>Netgen 2D simple parameters</translation>
</message>
<message>
<source>NETGEN_SimpleParameters_2D_TITLE</source>
<translation>Hypothesis Construction</translation>
</message>
<message>
<source>NETGEN_ALLOW_QUADRANGLES</source>
<translation>Allow Quadrangles</translation>
</message>
<message>
<source>NETGEN_COARSE</source>
<translation>Coarse</translation>
</message>
<message>
<source>NETGEN_CUSTOM</source>
<translation>Custom</translation>
</message>
<message>
<source>NETGEN_FINE</source>
<translation>Fine</translation>
</message>
<message>
<source>NETGEN_FINENESS</source>
<translation>Fineness</translation>
</message>
<message>
<source>NETGEN_GROWTH_RATE</source>
<translation>Growth Rate</translation>
</message>
<message>
<source>NETGEN_MAX_SIZE</source>
<translation>Max. Size</translation>
</message>
<message>
<source>NETGEN_MODERATE</source>
<translation>Moderate</translation>
</message>
<message>
<source>NETGEN_OPTIMIZE</source>
<translation>Optimize</translation>
</message>
<message>
<source>NETGEN_SECOND_ORDER</source>
<translation>Second Order</translation>
</message>
<message>
<source>NETGEN_SEG_PER_EDGE</source>
<translation>Nb. Segs per Edge</translation>
</message>
<message>
<source>NETGEN_SEG_PER_RADIUS</source>
<translation>Nb. Segs per Radius</translation>
</message>
<message>
<source>NETGEN_VERYCOARSE</source>
<translation>Very Coarse</translation>
</message>
<message>
<source>NETGEN_VERYFINE</source>
<translation>Very Fine</translation>
</message>
<message>
<source>NG_1D</source>
<translation>1D</translation>
</message>
<message>
<source>NG_2D</source>
<translation>2D</translation>
</message>
<message>
<source>NG_3D</source>
<translation>3D</translation>
</message>
<message>
<source>NG_LENGTH_FROM_EDGES</source>
<translation>Length from edges</translation>
</message>
<message>
<source>NG_LENGTH_FROM_FACES</source>
<translation>Length from faces</translation>
</message>
</context>
</TS>

View File

@ -21,16 +21,16 @@
#
# File : Makefile.in
# Author : Patrick GOLDBRONN (CEA)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : SMESH
# $Header$
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
VPATH=.:@srcdir@
include $(top_srcdir)/adm_local/unix/make_common_starter.am
@COMMENCE@
SUBDIRS = NETGEN NETGENPlugin
SUBDIRS = NETGEN NETGENPlugin GUI
if NETGENPLUGIN_ENABLE_GUI
SUBDIRS += GUI
endif
@MODULE@
DIST_SUBDIRS = NETGEN NETGENPlugin GUI

View File

@ -20,23 +20,17 @@
# -* Makefile *-
#
# Author : Edward AGAPOV (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : NETGENPLUGIN
# Date : 10/01/2004
#
#
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# build .so of NETGEN itself
@COMMENCE@
LIB = libNETGEN.la
@CONCLUDE@
lib_LTLIBRARIES = libNETGEN.la
LIB_OBJ_O = \
linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o \
@ -70,19 +64,18 @@ $(LIB_OBJ_O):
ar x $(NETGEN_LIBS_DIR)/libgeom2d.a
rm -rf csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o
LIB_OBJ_LO = $(LIB_OBJ_O:%.o=%.lo)
#LIB_OBJ_LO = $(LIB_OBJ_O:%.o=%.lo)
#%.lo: %.o; @ln -s $< $@
%.lo: %.o; @ln -s $< $@
nodist_libNETGEN_la_SOURCES =
$(LIB): $(LIB_OBJ_O) $(LIB_OBJ_LO)
LIB_OBJ = $(LIB_OBJ_LO)
libNETGEN_la_LDFLAGS = $(LIB_OBJ_O) \
$(CAS_LDPATH) -lTKernel -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKMesh -lTKSTL $(FCLIBS) $(STDLIB)
ifeq ($(F77),gfortran)
LDFLAGS += -lgfortran
else
LDFLAGS += -lg2c
endif
libNETGEN_la_DEPENDENCIES = $(LIB_OBJ_O)
LDFLAGS += $(OCC_LDPATH) -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES
MOSTLYCLEAN += $(LIB_OBJ_O)
EXTRA_DIST += \
ReadMeForNgUsers \
netgen43ForSalome.patch \
netgen45ForSalome.patch \
netgen45lib64.patch

View File

@ -1,23 +1,40 @@
The Netgen 4.5 from the web location : http://www.hpfem.jku.at/netgen/
(CVS access) is used in the SMESH Module of Salome3 distribution.
How to build Netgen for Salome
1. How to build Netgen for Salome
------------------------------
Patch the netgen 4.5 distribution:
1.1. Download Netgen 4.5 from the NETGEN home site (see above).
1.2. Unpack the downloaded Netgen 4.5 archive
(hereafter we assume that this is netgen45 directory)
1.3. Patch the netgen 4.5 distribution for SALOME:
$ cd netgen45
$ patch -p1 < patch_directory/netgen45ForSalome.patch
Then run makeForSalome.sh (it will be created by the patch):
1.4. For 64-bit platform you also need to apply another patch:
$ cd netgen45
$ patch -p1 < patch_directory/netgen45lib64.patch
1.5. Set CASROOT environment variable to OCCT installation path,
since Netgen 4.5 requires Open CASCADE Technology:
$ setenv CASROOT <occt_installation_path>
1.6. Compile and install netgen 4.5. To do this, simply run
makeForSalome.sh script (it is created from the patch):
$ sh makeForSalome.sh
Additional information for maintainers
2. Additional information for maintainers
--------------------------------------
The file check_NETGENPLUGIN.m4 assumes
that Netgen is installed in the directory <netgen_installation_path> as follow:
The file check_NETGEN.m4 assumes that Netgen is installed in
the directory <netgen_installation_path> as follow:
prompt> ls <netgen_installation_path>
@ -50,17 +67,16 @@ edgeflw.hpp hpref_pyramid.hpp msghandler.hpp sparsmat.hpp
prompt> ls <netgen_installation_path>/lib
LINUX/
prompt> ls <netgen_installation_path>/lib/LINUX
libcsg.a libgeom2d.a libla.a libnginterface.a libopti.a
libgen.a libgprim.a libmesh.a libocc.a libstlgeom.a
The library files can be also installed in the LINUX or LINUX64
subfolder of the lib directory.
All the libraries *.a should be compiled without the option -DOPENGL.
netgen45 is assumed to be the directory downloaded from the above web
location archive of Netgen. The library
<netgen_installation_path>/lib/LINUX/libnginterface.a should contain the objects
<netgen_installation_path>/lib/libnginterface.a should contain the objects
nglib.o (from netgen45/libsrc/interface/nglib.cpp) and ngnewdelete.o
(from netgen45/ngtcltk/ngnewdelete.cpp).
@ -72,7 +88,7 @@ nglib.o and ngnewdelete.o to the library libnginterface.a and
recompile the libraries only.
All this job is done by applying the patch and running the script makeForSalome.sh.
Th suggested patch alters some Netgen sources to compile them.
The suggested patch alters some Netgen sources to compile them.
Michael SAZONOV
m-sazonov@opencascade.com

View File

@ -0,0 +1,221 @@
diff -N -r -u netgen43/libsrc/include/spline2d.hpp /tmp/netgen43/libsrc/include/spline2d.hpp
--- netgen43/libsrc/include/spline2d.hpp 1970-01-01 01:00:00.000000000 +0100
+++ /tmp/netgen43/libsrc/include/spline2d.hpp 2003-12-10 16:28:12.000000000 +0100
@@ -0,0 +1 @@
+#include "../geom2d/spline2d.hpp"
diff -N -r -u netgen43/libsrc/include/splinegeometry2.hpp /tmp/netgen43/libsrc/include/splinegeometry2.hpp
--- netgen43/libsrc/include/splinegeometry2.hpp 1970-01-01 01:00:00.000000000 +0100
+++ /tmp/netgen43/libsrc/include/splinegeometry2.hpp 2003-12-10 16:28:23.000000000 +0100
@@ -0,0 +1 @@
+#include "../geom2d/splinegeometry2.hpp"
diff -N -r -u netgen43/libsrc/interface/Makefile /tmp/netgen43/libsrc/interface/Makefile
--- netgen43/libsrc/interface/Makefile 2003-05-07 16:01:43.000000000 +0200
+++ /tmp/netgen43/libsrc/interface/Makefile 2003-12-10 15:59:47.000000000 +0100
@@ -1,4 +1,4 @@
-src = nginterface.cpp writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp
+src = writeuser.cpp writediffpack.cpp writeabaqus.cpp writefluent.cpp writepermas.cpp writetochnog.cpp writetecplot.cpp wuchemnitz.cpp writetochnog.cpp writefeap.cpp readuser.cpp importsolution.cpp nglib.cpp ngnewdelete.cpp
#
lib = nginterface
libpath = libsrc/interface
diff -N -r -u netgen43/libsrc/interface/nglib.cpp /tmp/netgen43/libsrc/interface/nglib.cpp
--- netgen43/libsrc/interface/nglib.cpp 2003-05-07 16:01:43.000000000 +0200
+++ /tmp/netgen43/libsrc/interface/nglib.cpp 2003-12-10 16:32:54.000000000 +0100
@@ -23,6 +23,20 @@
#include "nglib.h"
+namespace netgen
+{
+ char geomfilename [100];
+
+ //Destination for messages, errors, ...
+ void Ng_PrintDest(const char * s)
+ {
+ (*mycout) << s << flush;
+ }
+
+#include <spline2d.hpp>
+#include <splinegeometry2.hpp>
+}
+
using namespace netgen;
// constants and types:
@@ -171,8 +185,6 @@
// CSG Geometry
// FlexLexer * lexer;
-char geomfilename [100];
-
// 2D Meshing Functions:
@@ -362,7 +374,18 @@
cout << "e(" << readedges.Get(i) << "," << readedges.Get(i+1) << ")" << endl;
}
*/
- geo->AddEdges(readedges);
+
+ ARRAY< Point<3> > readedges1;
+
+ for (i = 1; i <= readedges.Size(); i++)
+ {
+ Point3d readedgesData = readedges.Get(i);
+ Point <3> readedges1Data = Point<3>(readedgesData.X(),readedgesData.Y(),readedgesData.Z());
+
+ readedges1.Append(readedges1Data);
+ }
+
+ geo->AddEdges(readedges1);
}
if (geo->GetStatus() == STLTopology::STL_GOOD || geo->GetStatus() == STLTopology::STL_WARNING) return NG_OK;
@@ -472,7 +495,14 @@
n = Vec3d(nv[0],nv[1],nv[2]);
}
- readtrias.Append(STLReadTriangle(apts,n));
+ Point<3> apts1[3];
+ apts1[0] = Point<3>(p1[0],p1[1],p1[2]);
+ apts1[1] = Point<3>(p2[0],p2[1],p2[2]);
+ apts1[2] = Point<3>(p3[0],p3[1],p3[2]);
+
+ Vec<3> n1 = Vec<3>(n.X(),n.Y(),n.Z());
+
+ readtrias.Append(STLReadTriangle(apts1,n1));
}
// add (optional) edges:
@@ -487,30 +517,29 @@
// compatibility functions:
-void MyError (const char * ch)
+void netgen::MyError (const char * ch)
{
cerr << ch;
}
-//Destination for messages, errors, ...
-void Ng_PrintDest(const char * s)
-{
- (*mycout) << s << flush;
-}
-
-
-double GetTime ()
+double netgen::GetTime ()
{
return 0;
}
-void ResetTime ()
+void netgen::ResetTime ()
{
;
}
-void MyBeep (int i)
+void netgen::MyBeep (int i)
{
;
}
+void MeshFromSpline2D (SplineGeometry2d & geometry,
+ Mesh *& mesh,
+ MeshingParameters & mp)
+{
+ MeshFromSpline2D (geometry, mesh, mp);
+}
diff -N -r -u netgen43/libsrc/makefile.mach.LINUX /tmp/netgen43/libsrc/makefile.mach.LINUX
--- netgen43/libsrc/makefile.mach.LINUX 2003-05-07 16:01:43.000000000 +0200
+++ /tmp/netgen43/libsrc/makefile.mach.LINUX 2003-12-10 15:12:18.000000000 +0100
@@ -14,7 +14,8 @@
#
CFLAGS2 =
# pg stands for profiling - also in linkflags2
-CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL
+#CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX -DOPENGL
+CPLUSPLUSFLAGS2 = -O2 -I/usr/X11R6/include -DLINUX
# -fomit-frame-pointer
# -ffast-math
#
diff -N -r -u netgen43/libsrc/meshing/improve2.cpp /tmp/netgen43/libsrc/meshing/improve2.cpp
--- netgen43/libsrc/meshing/improve2.cpp 2003-05-07 16:01:43.000000000 +0200
+++ /tmp/netgen43/libsrc/meshing/improve2.cpp 2003-12-10 15:42:00.000000000 +0100
@@ -3,7 +3,7 @@
#include "meshing.hpp"
#include <opti.hpp>
-#include <visual.hpp>
+/*#include <visual.hpp>*/
namespace netgen
diff -N -r -u netgen43/libsrc/meshing/meshing2.cpp /tmp/netgen43/libsrc/meshing/meshing2.cpp
--- netgen43/libsrc/meshing/meshing2.cpp 2003-05-07 16:01:43.000000000 +0200
+++ /tmp/netgen43/libsrc/meshing/meshing2.cpp 2003-12-10 15:34:35.000000000 +0100
@@ -1785,7 +1785,7 @@
#else
-void glrender (int wait)
+void netgen::glrender (int wait)
{
;
}
diff -N -r -u netgen43/libsrc/visualization/stlmeshing.cpp /tmp/netgen43/libsrc/visualization/stlmeshing.cpp
--- netgen43/libsrc/visualization/stlmeshing.cpp 2003-05-07 16:01:43.000000000 +0200
+++ /tmp/netgen43/libsrc/visualization/stlmeshing.cpp 2003-12-10 15:52:53.000000000 +0100
@@ -5,7 +5,7 @@
#include <stlgeom.hpp>
#include <meshing.hpp>
-#include <visual.hpp>
+/*#include <visual.hpp>*/
namespace netgen
{
diff -N -r -u netgen43/Makefile /tmp/netgen43/Makefile
--- netgen43/Makefile 2003-05-07 16:01:43.000000000 +0200
+++ /tmp/netgen43/Makefile 2003-12-10 15:11:41.000000000 +0100
@@ -35,7 +35,8 @@
.SUFFIXES: .cpp .o
#
#
-CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
+#CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
+CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include
LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu
#
CPLUSPLUSFLAGS = $(CPLUSPLUSFLAGS1) $(CPLUSPLUSFLAGS2) $(CPLUSPLUSFLAGS3)
diff -N -r -u netgen43/makeForSalome.sh /tmp/netgen43/makeForSalome.sh
--- netgen43/makeForSalome.sh 1970-01-01 01:00:00.000000000 +0100
+++ /tmp/netgen43/makeForSalome.sh 2004-01-05 12:33:59.000000000 +0100
@@ -0,0 +1,26 @@
+#! /bin/sh
+cp ngtcltk/ngnewdelete.* libsrc/interface/
+
+MACHINE=LINUX
+export MACHINE
+make -C libsrc/csg
+make -C libsrc/general
+make -C libsrc/geom2d
+make -C libsrc/gprim
+make -C libsrc/interface
+make -C libsrc/linalg
+make -C libsrc/meshing
+make -C libsrc/opti
+make -C libsrc/stlgeom
+
+if [ ! -d install ] ; then
+ mkdir install
+fi
+
+cp -r lib install/
+
+if [ ! -d install/include ] ; then
+ mkdir install/include
+fi
+
+cp libsrc/interface/nglib.h install/include

File diff suppressed because it is too large Load Diff

45
src/NETGEN/netgen45lib64.patch Executable file
View File

@ -0,0 +1,45 @@
diff -ur netgen-4.5.old/libsrc/makefile.inc netgen-4.5.new/libsrc/makefile.inc
--- netgen-4.5/libsrc/makefile.inc 2006-04-27 13:12:54.000000000 +0400
+++ netgen-4.5/libsrc/makefile.inc 2006-09-05 14:16:32.000000000 +0400
@@ -14,7 +14,7 @@
#
include $(LIBSRC_DIR)/makefile.mach.$(MACHINE)
#
-CPLUSPLUSFLAGS1 = -c -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \
+CPLUSPLUSFLAGS1 = -c -m64 -D_OCC64 -fPIC -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) \
-DOCCGEOMETRY -DOCC52 -DHAVE_IOSTREAM -DHAVE_LIMITS_H
#
ARFLAGS = r
diff -ur netgen-4.5.old/libsrc/makefile.mach.LINUX64 netgen-4.5.new/libsrc/makefile.mach.LINUX64
--- netgen-4.5/libsrc/makefile.mach.LINUX64 2006-03-29 15:09:32.000000000 +0400
+++ netgen-4.5/libsrc/makefile.mach.LINUX64 2006-09-07 15:48:39.000000000 +0400
@@ -11,7 +11,7 @@
#
#
CFLAGS2 =
-CPLUSPLUSFLAGS2 = -pg -march=nocona -O2 -DLINUX -DOPENGL \
+CPLUSPLUSFLAGS2 = -pg -march=nocona -O2 -DLINUX \
-ftemplate-depth-99 -finline-limit=100000 \
-fforce-addr -funroll-loops \
-DTRAFO -DNGSOLVE -DnoADDON -DnoLAPACK -DnoFAST \
@@ -23,7 +23,7 @@
#
#
-LINKFLAGS2 = -pg -L/usr/openwin/lib64 -L/usr/X11R6/lib64 -L/usr/lib/GL3.5 -L/usr/lib64
+LINKFLAGS2 = -fPIC -pg -L/usr/openwin/lib64 -L/usr/X11R6/lib64 -L/usr/lib/GL3.5 -L/usr/lib64
SYSLIB2 = -lstdc++
diff -ur netgen-4.5.old/Makefile netgen-4.5.new/Makefile
--- netgen-4.5/Makefile 2006-03-29 15:09:12.000000000 +0400
+++ netgen-4.5/Makefile 2006-09-07 15:46:07.000000000 +0400
@@ -72,7 +72,7 @@
#
#CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -DOPENGL
-CPLUSPLUSFLAGS1 = -c -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -I./ngsolve/include -Ilibsrc/interface -DOPENGL -I$(METISINC)
+CPLUSPLUSFLAGS1 = -c -m64 -D_OCC64 -I$(LIBSRC_DIR)/include -I$(OCCINC_DIR) -I./ngsolve/include -Ilibsrc/interface -I$(METISINC)
LINKFLAGS1 = -lGL -lGLU -lX11 -lXext -lXmu
#

View File

@ -0,0 +1,93 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
#
# Author : Edward AGAPOV (OCC)
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Module : NETGENPLUGIN
# Date : 10/01/2004
#
#
include $(top_srcdir)/adm_local/unix/make_common_starter.am
# header files
salomeinclude_HEADERS = \
NETGENPlugin_NETGEN_3D.hxx \
NETGENPlugin_NETGEN_3D_i.hxx \
NETGENPlugin_NETGEN_2D.hxx \
NETGENPlugin_NETGEN_2D_i.hxx \
NETGENPlugin_NETGEN_2D3D.hxx \
NETGENPlugin_NETGEN_2D3D_i.hxx \
NETGENPlugin_NETGEN_2D_ONLY.hxx \
NETGENPlugin_NETGEN_2D_ONLY_i.hxx \
NETGENPlugin_Hypothesis.hxx \
NETGENPlugin_Hypothesis_i.hxx \
NETGENPlugin_Hypothesis_2D.hxx \
NETGENPlugin_Hypothesis_2D_i.hxx \
NETGENPlugin_SimpleHypothesis_2D.hxx \
NETGENPlugin_SimpleHypothesis_3D.hxx \
NETGENPlugin_SimpleHypothesis_2D_i.hxx \
NETGENPlugin_SimpleHypothesis_3D_i.hxx \
NETGENPlugin_Mesher.hxx \
NETGENPlugin_Defs.hxx
# Libraries targets
lib_LTLIBRARIES = libNETGENEngine.la
dist_libNETGENEngine_la_SOURCES = \
NETGENPlugin_NETGEN_3D.cxx \
NETGENPlugin_NETGEN_3D_i.cxx \
NETGENPlugin_NETGEN_2D.cxx \
NETGENPlugin_NETGEN_2D_i.cxx \
NETGENPlugin_NETGEN_2D3D.cxx \
NETGENPlugin_NETGEN_2D3D_i.cxx \
NETGENPlugin_NETGEN_2D_ONLY.cxx \
NETGENPlugin_NETGEN_2D_ONLY_i.cxx \
NETGENPlugin_Hypothesis.cxx \
NETGENPlugin_Hypothesis_i.cxx \
NETGENPlugin_Hypothesis_2D.cxx \
NETGENPlugin_Hypothesis_2D_i.cxx \
NETGENPlugin_Mesher.cxx \
NETGENPlugin_SimpleHypothesis_2D.cxx \
NETGENPlugin_SimpleHypothesis_3D.cxx \
NETGENPlugin_SimpleHypothesis_2D_i.cxx \
NETGENPlugin_SimpleHypothesis_3D_i.cxx \
NETGENPlugin_i.cxx
libNETGENEngine_la_CPPFLAGS = \
$(KERNEL_CXXFLAGS) \
$(GUI_CXXFLAGS) \
$(MED_CXXFLAGS) \
$(GEOM_CXXFLAGS) \
$(CAS_CPPFLAGS) \
$(NETGEN_INCLUDES) \
$(SMESH_CXXFLAGS) \
$(CORBA_CXXFLAGS) \
$(CORBA_INCLUDES) \
$(BOOST_CPPFLAGS) \
-I$(top_builddir)/idl \
-I$(top_builddir)/salome_adm/unix
libNETGENEngine_la_LDFLAGS = \
../NETGEN/libNETGEN.la \
../../idl/libSalomeIDLNETGENPLUGIN.la \
$(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lStdMeshersEngine \
$(KERNEL_LDFLAGS) -lSalomeGenericObj

View File

@ -1,66 +0,0 @@
# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
# -* Makefile *-
#
# Author : Edward AGAPOV (OCC)
# Module : NETGENPLUGIN
# Date : 10/01/2004
#
#
# source path
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
VPATH=.:@srcdir@:@top_srcdir@/idl:$(top_builddir)/idl:${KERNEL_ROOT_DIR}/idl/salome:${GUI_ROOT_DIR}/idl/salome:${GEOM_ROOT_DIR}/idl/salome:${SMESH_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
@COMMENCE@
LIB_SRC = \
NETGENPlugin_NETGEN_3D.cxx \
NETGENPlugin_NETGEN_3D_i.cxx \
NETGENPlugin_NETGEN_2D.cxx \
NETGENPlugin_NETGEN_2D_i.cxx \
NETGENPlugin_NETGEN_2D3D.cxx \
NETGENPlugin_NETGEN_2D3D_i.cxx \
NETGENPlugin_Hypothesis.cxx \
NETGENPlugin_Hypothesis_i.cxx \
NETGENPlugin_Hypothesis_2D.cxx \
NETGENPlugin_Hypothesis_2D_i.cxx \
NETGENPlugin_Mesher.cxx \
NETGENPlugin_i.cxx
LIB_SERVER_IDL = NETGENPlugin_Algorithm.idl
LIB_CLIENT_IDL = \
SALOME_Component.idl \
SALOME_Comm.idl \
GEOM_Gen.idl \
MED.idl
# Libraries targets
LIB = libNETGENEngine.la
NETGEN_INCLUDES = @NETGEN_INCLUDES@
CPPFLAGS += $(NETGEN_INCLUDES)
CXXFLAGS += $(NETGEN_INCLUDES)
LDFLAGS += -lNETGEN
@CONCLUDE@

View File

@ -0,0 +1,37 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//=============================================================================
// File : NETGENPlugin_Defs.hxx
// Author : Alexander A. BORODIN
#ifndef _NETGENPlugin_DEFS_HXX_
#define _NETGENPlugin_DEFS_HXX_
#ifdef WIN32
#ifdef NETGENPLUGIN_EXPORTS
#define NETGENPLUGIN_EXPORT __declspec( dllexport )
#else
#define NETGENPLUGIN_EXPORT __declspec( dllimport )
#endif
#else
#define NETGENPLUGIN_EXPORT
#endif
#endif

View File

@ -26,10 +26,11 @@
// $Header$
//=============================================================================
using namespace std;
#include <NETGENPlugin_Hypothesis.hxx>
#include <utilities.h>
using namespace std;
//=============================================================================
/*!
*

View File

@ -29,13 +29,17 @@
#ifndef _NETGENPlugin_Hypothesis_HXX_
#define _NETGENPlugin_Hypothesis_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
// Parameters for work of NETGEN
//
class NETGENPlugin_Hypothesis: public SMESH_Hypothesis
using namespace std;
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis: public SMESH_Hypothesis
{
public:
@ -87,8 +91,8 @@ public:
// Persistence
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);
friend ostream & operator <<(ostream & save, NETGENPlugin_Hypothesis & hyp);
friend istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp);
friend NETGENPLUGIN_EXPORT ostream & operator <<(ostream & save, NETGENPlugin_Hypothesis & hyp);
friend NETGENPLUGIN_EXPORT istream & operator >>(istream & load, NETGENPlugin_Hypothesis & hyp);
/*!
* \brief Does nothing

View File

@ -26,10 +26,11 @@
// $Header$
//=============================================================================
using namespace std;
#include <NETGENPlugin_Hypothesis_2D.hxx>
#include <utilities.h>
using namespace std;
//=============================================================================
/*!
*

View File

@ -29,6 +29,8 @@
#ifndef _NETGENPlugin_Hypothesis_2D_HXX_
#define _NETGENPlugin_Hypothesis_2D_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "NETGENPlugin_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
@ -36,7 +38,7 @@
// This class is just to give 2D dimension, actually
// it inherits all behaviour of the parent
class NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypothesis
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypothesis
{
public:

View File

@ -25,8 +25,6 @@
// Project : SALOME
// $Header$
//=============================================================================
using namespace std;
#include "NETGENPlugin_Hypothesis_2D_i.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_PythonDump.hxx"
@ -34,6 +32,8 @@ using namespace std;
#include "Utils_CorbaException.hxx"
#include "utilities.h"
using namespace std;
//=============================================================================
/*!
* NETGENPlugin_Hypothesis_2D_i::NETGENPlugin_Hypothesis_2D_i

View File

@ -29,6 +29,8 @@
#ifndef _NETGENPlugin_Hypothesis_2D_i_HXX_
#define _NETGENPlugin_Hypothesis_2D_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
@ -39,7 +41,7 @@ class SMESH_Gen;
// NETGENPlugin parameters hypothesis (2D case)
class NETGENPlugin_Hypothesis_2D_i:
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis_2D,
public NETGENPlugin_Hypothesis_i
{

View File

@ -25,8 +25,6 @@
// Project : SALOME
// $Header$
//=============================================================================
using namespace std;
#include "NETGENPlugin_Hypothesis_i.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_PythonDump.hxx"
@ -34,6 +32,8 @@ using namespace std;
#include "Utils_CorbaException.hxx"
#include "utilities.h"
using namespace std;
//=============================================================================
/*!
* NETGENPlugin_Hypothesis_i::NETGENPlugin_Hypothesis_i

View File

@ -29,6 +29,8 @@
#ifndef _NETGENPlugin_Hypothesis_i_HXX_
#define _NETGENPlugin_Hypothesis_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
@ -39,7 +41,7 @@ class SMESH_Gen;
// NETGENPlugin parameters hypothesis
class NETGENPlugin_Hypothesis_i:
class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_i:
public virtual POA_NETGENPlugin::NETGENPlugin_Hypothesis,
public virtual SMESH_Hypothesis_i
{

View File

@ -25,11 +25,16 @@
// Project : SALOME
// $Header$
//=============================================================================
using namespace std;
#include "NETGENPlugin_Mesher.hxx"
#include "NETGENPlugin_Hypothesis_2D.hxx"
#include "NETGENPlugin_SimpleHypothesis_3D.hxx"
#include <SMESH_Mesh.hxx>
#include <SMESH_Comment.hxx>
#include <SMESH_ComputeError.hxx>
#include <SMESH_subMesh.hxx>
#include <SMESH_MesherHelper.hxx>
#include <SMESHDS_Mesh.hxx>
#include <SMDS_MeshElement.hxx>
#include <SMDS_MeshNode.hxx>
@ -42,6 +47,10 @@ using namespace std;
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <NCollection_Map.hxx>
#include <OSD_Path.hxx>
#include <OSD_File.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
// Netgen include files
namespace nglib {
@ -56,36 +65,54 @@ namespace netgen {
extern MeshingParameters mparam;
}
using namespace std;
//=============================================================================
/*!
*
*/
//=============================================================================
NETGENPlugin_Mesher::NETGENPlugin_Mesher (SMESHDS_Mesh* meshDS,
NETGENPlugin_Mesher::NETGENPlugin_Mesher (SMESH_Mesh* mesh,
const TopoDS_Shape& aShape,
const bool isVolume)
: _meshDS (meshDS),
: _mesh (mesh),
_shape (aShape),
_isVolume(isVolume),
_optimize(true)
_optimize(true),
_simpleHyp(NULL)
{
// Initialize global NETGEN parameters by default values:
defaultParameters();
}
//================================================================================
/*!
* \brief Initialize global NETGEN parameters with default values
*/
//================================================================================
void NETGENPlugin_Mesher::defaultParameters()
{
#ifdef WNT
netgen::MeshingParameters& mparams = netgen::GlobalMeshingParameters();
#else
netgen::MeshingParameters& mparams = netgen::mparam;
#endif
// maximal mesh edge size
netgen::mparam.maxh = NETGENPlugin_Hypothesis::GetDefaultMaxSize();
mparams.maxh = NETGENPlugin_Hypothesis::GetDefaultMaxSize();
// minimal number of segments per edge
netgen::mparam.segmentsperedge = NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge();
mparams.segmentsperedge = NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge();
// rate of growth of size between elements
netgen::mparam.grading = NETGENPlugin_Hypothesis::GetDefaultGrowthRate();
mparams.grading = NETGENPlugin_Hypothesis::GetDefaultGrowthRate();
// safety factor for curvatures (elements per radius)
netgen::mparam.curvaturesafety = NETGENPlugin_Hypothesis::GetDefaultNbSegPerRadius();
mparams.curvaturesafety = NETGENPlugin_Hypothesis::GetDefaultNbSegPerRadius();
// create elements of second order
netgen::mparam.secondorder = NETGENPlugin_Hypothesis::GetDefaultSecondOrder() ? 1 : 0;
mparams.secondorder = NETGENPlugin_Hypothesis::GetDefaultSecondOrder() ? 1 : 0;
// quad-dominated surface meshing
if (_isVolume)
netgen::mparam.quad = 0;
mparams.quad = 0;
else
netgen::mparam.quad = NETGENPlugin_Hypothesis_2D::GetDefaultQuadAllowed() ? 1 : 0;
mparams.quad = NETGENPlugin_Hypothesis_2D::GetDefaultQuadAllowed() ? 1 : 0;
}
//=============================================================================
@ -97,26 +124,45 @@ void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_Hypothesis* hyp)
{
if (hyp)
{
#ifdef WNT
netgen::MeshingParameters& mparams = netgen::GlobalMeshingParameters();
#else
netgen::MeshingParameters& mparams = netgen::mparam;
#endif
// Initialize global NETGEN parameters:
// maximal mesh segment size
netgen::mparam.maxh = hyp->GetMaxSize();
mparams.maxh = hyp->GetMaxSize();
// minimal number of segments per edge
netgen::mparam.segmentsperedge = hyp->GetNbSegPerEdge();
mparams.segmentsperedge = hyp->GetNbSegPerEdge();
// rate of growth of size between elements
netgen::mparam.grading = hyp->GetGrowthRate();
mparams.grading = hyp->GetGrowthRate();
// safety factor for curvatures (elements per radius)
netgen::mparam.curvaturesafety = hyp->GetNbSegPerRadius();
mparams.curvaturesafety = hyp->GetNbSegPerRadius();
// create elements of second order
netgen::mparam.secondorder = hyp->GetSecondOrder() ? 1 : 0;
mparams.secondorder = hyp->GetSecondOrder() ? 1 : 0;
// quad-dominated surface meshing
// only triangles are allowed for volumic mesh
if (!_isVolume)
netgen::mparam.quad = static_cast<const NETGENPlugin_Hypothesis_2D*>
mparams.quad = static_cast<const NETGENPlugin_Hypothesis_2D*>
(hyp)->GetQuadAllowed() ? 1 : 0;
_optimize = hyp->GetOptimize();
_simpleHyp = NULL;
}
}
//=============================================================================
/*!
* Pass simple parameters to NETGEN
*/
//=============================================================================
void NETGENPlugin_Mesher::SetParameters(const NETGENPlugin_SimpleHypothesis_2D* hyp)
{
_simpleHyp = hyp;
if ( _simpleHyp )
defaultParameters();
}
//=============================================================================
/*!
* Link - a pair of integer numbers
@ -140,36 +186,21 @@ Standard_Boolean IsEqual(const Link& aLink1, const Link& aLink2)
aLink1.n1 == aLink2.n2 && aLink1.n2 == aLink2.n1);
}
//=============================================================================
//================================================================================
/*!
* Here we are going to use the NETGEN mesher
* \brief Initialize netgen::OCCGeometry with OCCT shape
*/
//=============================================================================
bool NETGENPlugin_Mesher::Compute()
//================================================================================
void NETGENPlugin_Mesher::PrepareOCCgeometry(netgen::OCCGeometry& occgeo,
const TopoDS_Shape& shape,
SMESH_Mesh& mesh,
list< SMESH_subMesh* > * meshedSM)
{
MESSAGE("Compute with:\n"
" max size = " << netgen::mparam.maxh << "\n"
" segments per edge = " << netgen::mparam.segmentsperedge);
MESSAGE("\n"
" growth rate = " << netgen::mparam.grading << "\n"
" elements per radius = " << netgen::mparam.curvaturesafety << "\n"
" second order = " << netgen::mparam.secondorder << "\n"
" quad allowed = " << netgen::mparam.quad);
nglib::Ng_Init();
// -------------------------
// Prepare OCC geometry
// -------------------------
netgen::OCCGeometry occgeo;
occgeo.shape = _shape;
occgeo.changed = 1;
occgeo.BuildFMap();
BRepTools::Clean (_shape);
BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (_shape, 0.01, true);
BRepTools::Clean (shape);
BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, 0.01, true);
Bnd_Box bb;
BRepBndLib::Add (_shape, bb);
BRepBndLib::Add (shape, bb);
double x1,y1,z1,x2,y2,z2;
bb.Get (x1,y1,z1,x2,y2,z2);
MESSAGE("shape bounding box:\n" <<
@ -179,30 +210,435 @@ bool NETGENPlugin_Mesher::Compute()
netgen::Point<3> p2 = netgen::Point<3> (x2,y2,z2);
occgeo.boundingbox = netgen::Box<3> (p1,p2);
occgeo.shape = shape;
occgeo.changed = 1;
//occgeo.BuildFMap();
// fill maps of shapes of occgeo with not yet meshed subshapes
// get root submeshes
list< SMESH_subMesh* > rootSM;
if ( SMESH_subMesh* sm = mesh.GetSubMeshContaining( shape )) {
rootSM.push_back( sm );
}
else {
for ( TopoDS_Iterator it( shape ); it.More(); it.Next() )
rootSM.push_back( mesh.GetSubMesh( it.Value() ));
}
// add subshapes of empty submeshes
list< SMESH_subMesh* >::iterator rootIt = rootSM.begin(), rootEnd = rootSM.end();
for ( ; rootIt != rootEnd; ++rootIt ) {
SMESH_subMesh * root = *rootIt;
SMESH_subMeshIteratorPtr smIt = root->getDependsOnIterator(/*includeSelf=*/true,
/*complexShapeFirst=*/true);
while ( smIt->more() ) {
SMESH_subMesh* sm = smIt->next();
if ( sm->IsEmpty() ) {
switch ( sm->GetSubShape().ShapeType() ) {
case TopAbs_FACE : occgeo.fmap.Add( sm->GetSubShape() ); break;
case TopAbs_EDGE : occgeo.emap.Add( sm->GetSubShape() ); break;
case TopAbs_VERTEX: occgeo.vmap.Add( sm->GetSubShape() ); break;
case TopAbs_SOLID :occgeo.somap.Add( sm->GetSubShape() ); break;
default:;
}
}
// collect submeshes of meshed shapes
else if (meshedSM) {
meshedSM->push_back( sm );
}
}
}
occgeo.facemeshstatus.SetSize (occgeo.fmap.Extent());
occgeo.facemeshstatus = 0;
}
//================================================================================
/*!
* \brief return id of netgen point corresponding to SMDS node
*/
//================================================================================
static int ngNodeId( const SMDS_MeshNode* node,
netgen::Mesh& ngMesh,
map< const SMDS_MeshNode*, int >& nodeNgIdMap)
{
int newNgId = ngMesh.GetNP() + 1;
pair< map< const SMDS_MeshNode*, int >::iterator, bool > it_isNew =
nodeNgIdMap.insert( make_pair( node, newNgId ));
if ( it_isNew.second ) {
netgen::MeshPoint p( netgen::Point<3> (node->X(), node->Y(), node->Z()) );
ngMesh.AddPoint( p );
}
return it_isNew.first->second;
}
//================================================================================
/*!
* \brief fill ngMesh with nodes and elements of computed submeshes
*/
//================================================================================
bool NETGENPlugin_Mesher::fillNgMesh(netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
vector<SMDS_MeshNode*>& nodeVec,
const list< SMESH_subMesh* > & meshedSM)
{
map< const SMDS_MeshNode*, int > nodeNgIdMap;
TopTools_MapOfShape visitedShapes;
SMESH_MesherHelper helper (*_mesh);
int faceID = occgeom.fmap.Extent();
_faceDescriptors.clear();
list< SMESH_subMesh* >::const_iterator smIt, smEnd = meshedSM.end();
for ( smIt = meshedSM.begin(); smIt != smEnd; ++smIt )
{
SMESH_subMesh* sm = *smIt;
if ( !visitedShapes.Add( sm->GetSubShape() ))
continue;
SMESHDS_SubMesh * smDS = sm->GetSubMeshDS();
switch ( sm->GetSubShape().ShapeType() )
{
case TopAbs_EDGE: { // EDGE
// ----------------------
const TopoDS_Edge& geomEdge = TopoDS::Edge( sm->GetSubShape() );
// Add ng segments for each not meshed face the edge bounds
TopTools_MapOfShape visitedAncestors;
const TopTools_ListOfShape& ancestors = _mesh->GetAncestors( geomEdge );
TopTools_ListIteratorOfListOfShape ancestorIt ( ancestors );
for ( ; ancestorIt.More(); ancestorIt.Next() )
{
const TopoDS_Shape & ans = ancestorIt.Value();
if ( ans.ShapeType() != TopAbs_FACE || !visitedAncestors.Add( ans ))
continue;
const TopoDS_Face& face = TopoDS::Face( ans );
int faceID = occgeom.fmap.FindIndex( face );
if ( faceID < 1 )
continue; // meshed face
// find out orientation of geomEdge within face
bool isForwad = false;
for ( TopExp_Explorer exp( face, TopAbs_EDGE ); exp.More(); exp.Next() ) {
if ( geomEdge.IsSame( exp.Current() )) {
isForwad = ( exp.Current().Orientation() == geomEdge.Orientation() );
break;
}
}
bool isQuad = smDS->GetElements()->next()->IsQuadratic();
// get all nodes from geomEdge
StdMeshers_FaceSide fSide( face, geomEdge, _mesh, isForwad, isQuad );
const vector<UVPtStruct>& points = fSide.GetUVPtStruct();
int i, nbSeg = fSide.NbSegments();
double otherSeamParam = 0;
helper.SetSubShape( face );
bool isSeam = helper.IsRealSeam( geomEdge );
if ( isSeam )
otherSeamParam =
helper.GetOtherParam( helper.GetPeriodicIndex() == 1 ? points[0].u : points[0].v );
// add segments
int prevNgId = ngNodeId( points[0].node, ngMesh, nodeNgIdMap );
for ( i = 0; i < nbSeg; ++i )
{
const UVPtStruct& p1 = points[ i ];
const UVPtStruct& p2 = points[ i+1 ];
netgen::Segment seg;
// ng node ids
seg.p1 = prevNgId;
seg.p2 = prevNgId = ngNodeId( p2.node, ngMesh, nodeNgIdMap );
// node param on curve
seg.epgeominfo[ 0 ].dist = p1.param;
seg.epgeominfo[ 1 ].dist = p2.param;
// uv on face
seg.epgeominfo[ 0 ].u = p1.u;
seg.epgeominfo[ 0 ].v = p1.v;
seg.epgeominfo[ 1 ].u = p2.u;
seg.epgeominfo[ 1 ].v = p2.v;
//seg.epgeominfo[ iEnd ].edgenr = edgeID; // = geom.emap.FindIndex(edge);
seg.si = faceID; // = geom.fmap.FindIndex (face);
seg.edgenr = ngMesh.GetNSeg() + 1; // segment id
ngMesh.AddSegment (seg);
if ( isSeam )
{
if ( helper.GetPeriodicIndex() == 1 ) {
seg.epgeominfo[ 0 ].u = otherSeamParam;
seg.epgeominfo[ 1 ].u = otherSeamParam;
swap (seg.epgeominfo[0].v, seg.epgeominfo[1].v);
} else {
seg.epgeominfo[ 0 ].v = otherSeamParam;
seg.epgeominfo[ 1 ].v = otherSeamParam;
swap (seg.epgeominfo[0].u, seg.epgeominfo[1].u);
}
swap (seg.p1, seg.p2);
swap (seg.epgeominfo[0].dist, seg.epgeominfo[1].dist);
seg.edgenr = ngMesh.GetNSeg() + 1; // segment id
ngMesh.AddSegment (seg);
}
}
} // loop on geomEdge ancestors
break;
} // case TopAbs_EDGE
case TopAbs_FACE: { // FACE
// ----------------------
const TopoDS_Face& geomFace = TopoDS::Face( sm->GetSubShape() );
helper.SetSubShape( geomFace );
// find solids geomFace bounds
int solidID1 = 0, solidID2 = 0;
const TopTools_ListOfShape& ancestors = _mesh->GetAncestors( geomFace );
TopTools_ListIteratorOfListOfShape ancestorIt ( ancestors );
for ( ; ancestorIt.More(); ancestorIt.Next() )
{
const TopoDS_Shape & solid = ancestorIt.Value();
if ( solid.ShapeType() == TopAbs_SOLID ) {
int id = occgeom.somap.FindIndex ( solid );
if ( solidID1 && id != solidID1 ) solidID2 = id;
else solidID1 = id;
}
}
faceID++;
_faceDescriptors[ faceID ].first = solidID1;
_faceDescriptors[ faceID ].second = solidID2;
// add surface elements
SMDS_ElemIteratorPtr faces = smDS->GetElements();
while ( faces->more() ) {
const SMDS_MeshElement* f = faces->next();
if ( f->NbNodes() % 3 != 0 ) { // not triangle
for ( ancestorIt.Initialize(ancestors); ancestorIt.More(); ancestorIt.Next() )
if ( ancestorIt.Value().ShapeType() == TopAbs_SOLID ) {
sm = _mesh->GetSubMesh( ancestorIt.Value() );
break;
}
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
smError.reset( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"Not triangle submesh"));
smError->myBadElements.push_back( f );
return false;
}
netgen::Element2d tri(3);
tri.SetIndex ( faceID );
for ( int i = 0; i < 3; ++i ) {
const SMDS_MeshNode* node = f->GetNode( i ), * inFaceNode=0;
if ( helper.IsSeamShape( node->GetPosition()->GetShapeId() ))
if ( helper.IsSeamShape( f->GetNode( i+1 )->GetPosition()->GetShapeId() ))
inFaceNode = f->GetNode( i-1 );
else
inFaceNode = f->GetNode( i+1 );
gp_XY uv = helper.GetNodeUV( geomFace, node, inFaceNode );
tri.GeomInfoPi(i+1).u = uv.X();
tri.GeomInfoPi(i+1).v = uv.Y();
tri.PNum(i+1) = ngNodeId( node, ngMesh, nodeNgIdMap );
}
ngMesh.AddSurfaceElement (tri);
}
break;
} //
case TopAbs_VERTEX: { // VERTEX
// --------------------------
SMDS_NodeIteratorPtr nodeIt = smDS->GetNodes();
if ( nodeIt->more() )
ngNodeId( nodeIt->next(), ngMesh, nodeNgIdMap );
break;
}
default:;
} // switch
} // loop on submeshes
// fill nodeVec
nodeVec.resize( ngMesh.GetNP() + 1 );
map< const SMDS_MeshNode*, int >::iterator node_NgId, nodeNgIdEnd = nodeNgIdMap.end();
for ( node_NgId = nodeNgIdMap.begin(); node_NgId != nodeNgIdEnd; ++node_NgId)
nodeVec[ node_NgId->second ] = (SMDS_MeshNode*) node_NgId->first;
return true;
}
//=============================================================================
/*!
* Here we are going to use the NETGEN mesher
*/
//=============================================================================
bool NETGENPlugin_Mesher::Compute()
{
#ifdef WNT
netgen::MeshingParameters& mparams = netgen::GlobalMeshingParameters();
#else
netgen::MeshingParameters& mparams = netgen::mparam;
#endif
MESSAGE("Compute with:\n"
" max size = " << mparams.maxh << "\n"
" segments per edge = " << mparams.segmentsperedge);
MESSAGE("\n"
" growth rate = " << mparams.grading << "\n"
" elements per radius = " << mparams.curvaturesafety << "\n"
" second order = " << mparams.secondorder << "\n"
" quad allowed = " << mparams.quad);
SMESH_ComputeErrorPtr error = SMESH_ComputeError::New();
nglib::Ng_Init();
// -------------------------
// Prepare OCC geometry
// -------------------------
netgen::OCCGeometry occgeo;
list< SMESH_subMesh* > meshedSM;
PrepareOCCgeometry( occgeo, _shape, *_mesh, &meshedSM );
// -------------------------
// Generate the mesh
// -------------------------
netgen::Mesh *ngMesh = NULL;
// we start always with ANALYSE,
// but end depending on _optimize and _isVolume
int startWith = netgen::MESHCONST_ANALYSE;
int endWith = (_optimize
? (_isVolume ? netgen::MESHCONST_OPTVOLUME : netgen::MESHCONST_OPTSURFACE)
: netgen::MESHCONST_MESHSURFACE);
char *optstr;
SMESH_Comment comment;
int err = 0;
int nbInitNod = 0;
int nbInitSeg = 0;
int nbInitFac = 0;
// vector of nodes in which node index == netgen ID
vector< SMDS_MeshNode* > nodeVec;
try
{
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
if (!err && !_optimize)
{
// we have got surface mesh only, so generate volume mesh
startWith = endWith = netgen::MESHCONST_MESHVOLUME;
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
// ----------------
// compute 1D mesh
// ----------------
// pass 1D simple parameters to NETGEN
if ( _simpleHyp ) {
if ( int nbSeg = _simpleHyp->GetNumberOfSegments() ) {
// nb of segments
mparams.segmentsperedge = nbSeg + 0.1;
mparams.maxh = occgeo.boundingbox.Diam();
mparams.grading = 0;
}
else {
// segment length
mparams.segmentsperedge = 1;
mparams.maxh = _simpleHyp->GetLocalLength();
}
}
if (!err && netgen::mparam.secondorder > 0)
// let netgen create ngMesh and calculate element size on not meshed shapes
char *optstr = 0;
int startWith = netgen::MESHCONST_ANALYSE;
int endWith = netgen::MESHCONST_ANALYSE;
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
if (err) comment << "Error in netgen::OCCGenerateMesh() at MESHCONST_ANALYSE step";
// fill ngMesh with nodes and elements of computed submeshes
err = ! fillNgMesh(occgeo, *ngMesh, nodeVec, meshedSM);
nbInitNod = ngMesh->GetNP();
nbInitSeg = ngMesh->GetNSeg();
nbInitFac = ngMesh->GetNSE();
// compute mesh
if (!err)
{
startWith = endWith = netgen::MESHCONST_MESHEDGES;
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
if (err) comment << "Error in netgen::OCCGenerateMesh() at 1D mesh generation";
}
// ---------------------
// compute surface mesh
// ---------------------
if (!err)
{
// pass 2D simple parameters to NETGEN
if ( _simpleHyp ) {
if ( double area = _simpleHyp->GetMaxElementArea() ) {
// face area
mparams.maxh = sqrt(2. * area/sqrt(3.0));
mparams.grading = 0.4; // moderate size growth
}
else {
// length from edges
double length = 0;
for ( TopExp_Explorer exp( _shape, TopAbs_EDGE ); exp.More(); exp.Next() )
length += SMESH_Algo::EdgeLength( TopoDS::Edge( exp.Current() ));
if ( ngMesh->GetNSeg() )
mparams.maxh = length / ngMesh->GetNSeg();
else
mparams.maxh = 1000;
mparams.grading = 0.2; // slow size growth
}
mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 );
ngMesh->SetGlobalH (mparams.maxh);
netgen::Box<3> bb = occgeo.GetBoundingBox();
bb.Increase (bb.Diam()/20);
ngMesh->SetLocalH (bb.PMin(), bb.PMax(), mparams.grading);
}
// let netgen compute 2D mesh
startWith = netgen::MESHCONST_MESHSURFACE;
endWith = _optimize ? netgen::MESHCONST_OPTSURFACE : netgen::MESHCONST_MESHSURFACE;
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
if (err) comment << "Error in netgen::OCCGenerateMesh() at surface mesh generation";
}
// ---------------------
// generate volume mesh
// ---------------------
if (!err && _isVolume)
{
// add ng face descriptors of meshed faces
std::map< int, std::pair<int,int> >::iterator fId_soIds = _faceDescriptors.begin();
for ( ; fId_soIds != _faceDescriptors.end(); ++fId_soIds ) {
int faceID = fId_soIds->first;
int solidID1 = fId_soIds->second.first;
int solidID2 = fId_soIds->second.second;
ngMesh->AddFaceDescriptor (netgen::FaceDescriptor(faceID, solidID1, solidID2, 0));
}
// pass 3D simple parameters to NETGEN
const NETGENPlugin_SimpleHypothesis_3D* simple3d =
dynamic_cast< const NETGENPlugin_SimpleHypothesis_3D* > ( _simpleHyp );
if ( simple3d ) {
if ( double vol = simple3d->GetMaxElementVolume() ) {
// max volume
mparams.maxh = pow( 72 * vol * vol, 1/3. );
mparams.maxh = min( mparams.maxh, occgeo.boundingbox.Diam()/2 );
}
else {
// length from faces
mparams.maxh = ngMesh->AverageH();
}
// netgen::ARRAY<double> maxhdom;
// maxhdom.SetSize (occgeo.NrSolids());
// maxhdom = mparams.maxh;
// ngMesh->SetMaxHDomain (maxhdom);
ngMesh->SetGlobalH (mparams.maxh);
mparams.grading = 0.4;
ngMesh->CalcLocalH();
}
// let netgen compute 3D mesh
startWith = netgen::MESHCONST_MESHVOLUME;
endWith = _optimize ? netgen::MESHCONST_OPTVOLUME : netgen::MESHCONST_MESHVOLUME;
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
if (err) comment << "Error in netgen::OCCGenerateMesh()";
}
if (!err && mparams.secondorder > 0)
{
netgen::OCCRefinementSurfaces ref (occgeo);
ref.MakeSecondOrder (*ngMesh);
@ -210,8 +646,8 @@ bool NETGENPlugin_Mesher::Compute()
}
catch (netgen::NgException exc)
{
MESSAGE ("Exception in NETGEN: " << exc.What());
err = 1;
error->myName = err = COMPERR_ALGO_FAILED;
comment << exc.What();
}
int nbNod = ngMesh->GetNP();
@ -229,26 +665,26 @@ bool NETGENPlugin_Mesher::Compute()
// Feed back the SMESHDS with the generated Nodes and Elements
// -----------------------------------------------------------
SMESHDS_Mesh* meshDS = _mesh->GetMeshDS();
bool isOK = ( !err && (_isVolume ? (nbVol > 0) : (nbFac > 0)) );
if ( isOK )
if ( true /*isOK*/ ) // get whatever built
{
// vector of nodes in which node index == netgen ID
vector< SMDS_MeshNode* > nodeVec ( nbNod + 1 );
// map of nodes assigned to submeshes
NCollection_Map<int> pindMap;
// create and insert nodes into nodeVec
nodeVec.resize( nbNod + 1 );
int i;
for (i = 1; i <= nbNod && isOK; ++i )
for (i = nbInitNod+1; i <= nbNod /*&& isOK*/; ++i )
{
const netgen::MeshPoint& ngPoint = ngMesh->Point(i);
SMDS_MeshNode* node = NULL;
bool newNodeOnVertex = false;
TopoDS_Vertex aVert;
if (i <= occgeo.vmap.Extent())
if (i-nbInitNod <= occgeo.vmap.Extent())
{
// point on vertex
aVert = TopoDS::Vertex(occgeo.vmap(i));
SMESHDS_SubMesh * submesh = _meshDS->MeshElements(aVert);
aVert = TopoDS::Vertex(occgeo.vmap(i-nbInitNod));
SMESHDS_SubMesh * submesh = meshDS->MeshElements(aVert);
if (submesh)
{
SMDS_NodeIteratorPtr it = submesh->GetNodes();
@ -262,25 +698,26 @@ bool NETGENPlugin_Mesher::Compute()
newNodeOnVertex = true;
}
if (!node)
node = _meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z());
node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z());
if (!node)
{
MESSAGE("Cannot create a mesh node");
isOK = false;
if ( !comment.size() ) comment << "Cannot create a mesh node";
nbSeg = nbFac = nbVol = isOK = 0;
break;
}
nodeVec.at(i) = node;
if (newNodeOnVertex)
{
// point on vertex
_meshDS->SetNodeOnVertex(node, aVert);
meshDS->SetNodeOnVertex(node, aVert);
pindMap.Add(i);
}
}
// create mesh segments along geometric edges
NCollection_Map<Link> linkMap;
for (i = 1; i <= nbSeg && isOK; ++i )
for (i = nbInitSeg+1; i <= nbSeg/* && isOK*/; ++i )
{
const netgen::Segment& seg = ngMesh->LineSegment(i);
Link link(seg.p1, seg.p2);
@ -310,32 +747,33 @@ bool NETGENPlugin_Mesher::Compute()
}
else
param = param2 * 0.5;
if (pindMap.Contains(pind))
if (pind <= nbInitNod || pindMap.Contains(pind))
continue;
if (!aEdge.IsNull())
{
_meshDS->SetNodeOnEdge(nodeVec.at(pind), aEdge, param);
meshDS->SetNodeOnEdge(nodeVec.at(pind), aEdge, param);
pindMap.Add(pind);
}
}
SMDS_MeshEdge* edge;
if (nbp < 3) // second order ?
edge = _meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1]));
edge = meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1]));
else
edge = _meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1]),
edge = meshDS->AddEdge(nodeVec.at(pinds[0]), nodeVec.at(pinds[1]),
nodeVec.at(pinds[2]));
if (!edge)
{
if ( !comment.size() ) comment << "Cannot create a mesh edge";
MESSAGE("Cannot create a mesh edge");
isOK = false;
nbSeg = nbFac = nbVol = isOK = 0;
break;
}
if (!aEdge.IsNull())
_meshDS->SetMeshElementOnShape(edge, aEdge);
meshDS->SetMeshElementOnShape(edge, aEdge);
}
// create mesh faces along geometric faces
for (i = 1; i <= nbFac && isOK; ++i )
for (i = nbInitFac+1; i <= nbFac/* && isOK*/; ++i )
{
const netgen::Element2d& elem = ngMesh->SurfaceElement(i);
int aGeomFaceInd = elem.GetIndex();
@ -348,12 +786,12 @@ bool NETGENPlugin_Mesher::Compute()
int pind = elem.PNum(j);
SMDS_MeshNode* node = nodeVec.at(pind);
nodes.push_back(node);
if (pindMap.Contains(pind))
if (pind <= nbInitNod || pindMap.Contains(pind))
continue;
if (!aFace.IsNull())
{
const netgen::PointGeomInfo& pgi = elem.GeomInfoPi(j);
_meshDS->SetNodeOnFace(node, aFace, pgi.u, pgi.v);
meshDS->SetNodeOnFace(node, aFace, pgi.u, pgi.v);
pindMap.Add(pind);
}
}
@ -361,16 +799,16 @@ bool NETGENPlugin_Mesher::Compute()
switch (elem.GetType())
{
case netgen::TRIG:
face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2]);
face = meshDS->AddFace(nodes[0],nodes[1],nodes[2]);
break;
case netgen::QUAD:
face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
face = meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
break;
case netgen::TRIG6:
face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[5],nodes[3],nodes[4]);
face = meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[5],nodes[3],nodes[4]);
break;
case netgen::QUAD8:
face = _meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3],
face = meshDS->AddFace(nodes[0],nodes[1],nodes[2],nodes[3],
nodes[4],nodes[7],nodes[5],nodes[6]);
break;
default:
@ -379,18 +817,19 @@ bool NETGENPlugin_Mesher::Compute()
}
if (!face)
{
if ( !comment.size() ) comment << "Cannot create a mesh face";
MESSAGE("Cannot create a mesh face");
isOK = false;
nbSeg = nbFac = nbVol = isOK = 0;
break;
}
if (!aFace.IsNull())
_meshDS->SetMeshElementOnShape(face, aFace);
meshDS->SetMeshElementOnShape(face, aFace);
}
// create tetrahedra
for (i = 1; i <= nbVol && isOK; ++i)
for (i = 1; i <= nbVol/* && isOK*/; ++i)
{
const netgen::Element& elem = ngMesh->VolumeElement(i);
const netgen::Element& elem = ngMesh->VolumeElement(i);
int aSolidInd = elem.GetIndex();
TopoDS_Solid aSolid;
if (aSolidInd > 0 && aSolidInd <= occgeo.somap.Extent())
@ -401,12 +840,12 @@ bool NETGENPlugin_Mesher::Compute()
int pind = elem.PNum(j);
SMDS_MeshNode* node = nodeVec.at(pind);
nodes.push_back(node);
if (pindMap.Contains(pind))
if (pind <= nbInitNod || pindMap.Contains(pind))
continue;
if (!aSolid.IsNull())
{
// point in solid
_meshDS->SetNodeInVolume(node, aSolid);
meshDS->SetNodeInVolume(node, aSolid);
pindMap.Add(pind);
}
}
@ -414,11 +853,11 @@ bool NETGENPlugin_Mesher::Compute()
switch (elem.GetType())
{
case netgen::TET:
vol = _meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3]);
vol = meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3]);
break;
case netgen::TET10:
vol = _meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3],
nodes[4],nodes[7],nodes[5],nodes[6],nodes[8],nodes[9]);
vol = meshDS->AddVolume(nodes[0],nodes[1],nodes[2],nodes[3],
nodes[4],nodes[7],nodes[5],nodes[6],nodes[8],nodes[9]);
break;
default:
MESSAGE("NETGEN created a volume of unexpected type, ignoring");
@ -426,17 +865,61 @@ bool NETGENPlugin_Mesher::Compute()
}
if (!vol)
{
if ( !comment.size() ) comment << "Cannot create a mesh volume";
MESSAGE("Cannot create a mesh volume");
isOK = false;
nbSeg = nbFac = nbVol = isOK = 0;
break;
}
if (!aSolid.IsNull())
_meshDS->SetMeshElementOnShape(vol, aSolid);
meshDS->SetMeshElementOnShape(vol, aSolid);
}
}
if ( error->IsOK() && ( !isOK || comment.size() > 0 ))
error->myName = COMPERR_ALGO_FAILED;
if ( !comment.empty() )
error->myComment = comment;
// set bad compute error to subshapes of all failed subshapes shapes
if ( !error->IsOK() && err )
{
for (int i = 1; i <= occgeo.fmap.Extent(); i++) {
int status = occgeo.facemeshstatus[i-1];
if (status == 1 ) continue;
if ( SMESH_subMesh* sm = _mesh->GetSubMeshContaining( occgeo.fmap( i ))) {
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
if ( !smError || smError->IsOK() ) {
if ( status == -1 )
smError.reset( new SMESH_ComputeError( error->myName, error->myComment ));
else
smError.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED, "Ignored" ));
}
}
}
}
nglib::Ng_DeleteMesh((nglib::Ng_Mesh*)ngMesh);
nglib::Ng_Exit();
return isOK;
RemoveTmpFiles();
return error->IsOK();
}
//================================================================================
/*!
* \brief Remove "test.out" and "problemfaces" files in current directory
*/
//================================================================================
void NETGENPlugin_Mesher::RemoveTmpFiles()
{
TCollection_AsciiString str("test.out");
OSD_Path path1( str );
OSD_File file1( path1 );
file1.Remove();
str = "problemfaces";
OSD_Path path2( str );
OSD_File file2( path2 );
file2.Remove();
}

View File

@ -29,31 +29,62 @@
#ifndef _NETGENPlugin_Mesher_HXX_
#define _NETGENPlugin_Mesher_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "StdMeshers_FaceSide.hxx"
#include <map>
class SMESH_Mesh;
class SMESHDS_Mesh;
class TopoDS_Shape;
class NETGENPlugin_Hypothesis;
class NETGENPlugin_SimpleHypothesis_2D;
namespace netgen {
class OCCGeometry;
class Mesh;
}
/*!
* \brief This class calls the NETGEN mesher of OCC geometry
*/
class NETGENPlugin_Mesher
class NETGENPLUGIN_EXPORT NETGENPlugin_Mesher
{
public:
// ---------- PUBLIC METHODS ----------
NETGENPlugin_Mesher (SMESHDS_Mesh* meshDS, const TopoDS_Shape& aShape,
NETGENPlugin_Mesher (SMESH_Mesh* mesh, const TopoDS_Shape& aShape,
const bool isVolume);
void SetParameters(const NETGENPlugin_Hypothesis* hyp);
void SetParameters(const NETGENPlugin_SimpleHypothesis_2D* hyp);
bool Compute();
static void PrepareOCCgeometry(netgen::OCCGeometry& occgeom,
const TopoDS_Shape& shape,
SMESH_Mesh& mesh,
std::list< SMESH_subMesh* > * meshedSM=0);
static void RemoveTmpFiles();
protected:
bool fillNgMesh(netgen::OCCGeometry& occgeom,
netgen::Mesh& ngMesh,
std::vector<SMDS_MeshNode*>& nodeVec,
const std::list< SMESH_subMesh* > & meshedSM);
void defaultParameters();
private:
SMESHDS_Mesh* _meshDS;
SMESH_Mesh* _mesh;
const TopoDS_Shape& _shape;
bool _isVolume;
bool _optimize;
const NETGENPlugin_SimpleHypothesis_2D * _simpleHyp;
std::map< int, std::pair<int,int> > _faceDescriptors;
};
#endif

View File

@ -25,10 +25,9 @@
// Project : SALOME
// $Header$
//=============================================================================
using namespace std;
#include "NETGENPlugin_NETGEN_2D.hxx"
#include "NETGENPlugin_Hypothesis_2D.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D.hxx"
#include "NETGENPlugin_Mesher.hxx"
#include <SMESH_Gen.hxx>
@ -39,6 +38,8 @@ using namespace std;
#include <list>
using namespace std;
//=============================================================================
/*!
*
@ -53,9 +54,11 @@ NETGENPlugin_NETGEN_2D::NETGENPlugin_NETGEN_2D(int hypId, int studyId,
_name = "NETGEN_2D";
_shapeType = (1 << TopAbs_FACE); // 1 bit /shape type
_compatibleHypothesis.push_back("NETGEN_Parameters_2D");
_compatibleHypothesis.push_back("NETGEN_SimpleParameters_2D");
_requireDescretBoundary = false;
_onlyUnaryInput = false;
_hypothesis = NULL;
_supportSubmeshes = true;
}
//=============================================================================
@ -82,9 +85,6 @@ bool NETGENPlugin_NETGEN_2D::CheckHypothesis
{
_hypothesis = NULL;
list<const SMESHDS_Hypothesis*>::const_iterator itl;
const SMESHDS_Hypothesis* theHyp;
const list<const SMESHDS_Hypothesis*>& hyps = GetUsedHypothesis(aMesh, aShape);
int nbHyp = hyps.size();
if (!nbHyp)
@ -92,20 +92,20 @@ bool NETGENPlugin_NETGEN_2D::CheckHypothesis
aStatus = SMESH_Hypothesis::HYP_OK;
return true; // can work with no hypothesis
}
itl = hyps.begin();
theHyp = (*itl); // use only the first hypothesis
// use only the first hypothesis
const SMESHDS_Hypothesis* theHyp = hyps.front();
string hypName = theHyp->GetName();
if (hypName == "NETGEN_Parameters_2D")
if ( find( _compatibleHypothesis.begin(), _compatibleHypothesis.end(),
hypName ) != _compatibleHypothesis.end() )
{
_hypothesis = static_cast<const NETGENPlugin_Hypothesis_2D*> (theHyp);
ASSERT(_hypothesis);
_hypothesis = theHyp;
aStatus = SMESH_Hypothesis::HYP_OK;
}
else
{
aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE;
}
return aStatus == SMESH_Hypothesis::HYP_OK;
}
@ -119,53 +119,11 @@ bool NETGENPlugin_NETGEN_2D::CheckHypothesis
bool NETGENPlugin_NETGEN_2D::Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape)
{
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
//SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
NETGENPlugin_Mesher mesher(meshDS, aShape, false);
mesher.SetParameters(_hypothesis);
NETGENPlugin_Mesher mesher(&aMesh, aShape, false);
// NETGENPlugin_Mesher mesher(meshDS, aShape, false);
mesher.SetParameters(dynamic_cast<const NETGENPlugin_Hypothesis*>(_hypothesis));
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
return mesher.Compute();
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & NETGENPlugin_NETGEN_2D::SaveTo(ostream & save)
{
return save;
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & NETGENPlugin_NETGEN_2D::LoadFrom(istream & load)
{
return load;
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D & hyp)
{
return hyp.SaveTo( save );
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D & hyp)
{
return hyp.LoadFrom( load );
}

View File

@ -29,14 +29,16 @@
#ifndef _NETGENPlugin_NETGEN_2D_HXX_
#define _NETGENPlugin_NETGEN_2D_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_2D_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "StdMeshers_MaxElementVolume.hxx"
#include "Utils_SALOME_Exception.hxx"
class NETGENPlugin_Hypothesis_2D;
//class NETGENPlugin_Hypothesis_2D;
class NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D: public SMESH_2D_Algo
{
public:
NETGENPlugin_NETGEN_2D(int hypId, int studyId, SMESH_Gen* gen);
@ -49,13 +51,8 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
ostream & SaveTo(ostream & save);
istream & LoadFrom(istream & load);
friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D & hyp);
friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D & hyp);
protected:
const NETGENPlugin_Hypothesis_2D* _hypothesis;
const SMESHDS_Hypothesis* _hypothesis;
};
#endif

View File

@ -25,10 +25,9 @@
// Project : SALOME
// $Header$
//=============================================================================
using namespace std;
#include "NETGENPlugin_NETGEN_2D3D.hxx"
#include "NETGENPlugin_Hypothesis.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D.hxx"
#include "NETGENPlugin_Mesher.hxx"
#include <SMESH_Gen.hxx>
@ -39,6 +38,8 @@ using namespace std;
#include <list>
using namespace std;
//=============================================================================
/*!
*
@ -53,9 +54,11 @@ NETGENPlugin_NETGEN_2D3D::NETGENPlugin_NETGEN_2D3D(int hypId, int studyId,
_name = "NETGEN_2D3D";
_shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID);// 1 bit /shape type
_compatibleHypothesis.push_back("NETGEN_Parameters");
_compatibleHypothesis.push_back("NETGEN_SimpleParameters_3D");
_requireDescretBoundary = false;
_onlyUnaryInput = false;
_hypothesis = NULL;
_supportSubmeshes = true;
}
//=============================================================================
@ -84,9 +87,6 @@ bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis
_hypothesis = NULL;
list<const SMESHDS_Hypothesis*>::const_iterator itl;
const SMESHDS_Hypothesis* theHyp;
const list<const SMESHDS_Hypothesis*>& hyps = GetUsedHypothesis(aMesh, aShape);
int nbHyp = hyps.size();
if (!nbHyp)
@ -95,19 +95,20 @@ bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis
return true; // can work with no hypothesis
}
itl = hyps.begin();
theHyp = (*itl); // use only the first hypothesis
const SMESHDS_Hypothesis* theHyp = hyps.front(); // use only the first hypothesis
string hypName = theHyp->GetName();
if (hypName == "NETGEN_Parameters")
if ( find( _compatibleHypothesis.begin(), _compatibleHypothesis.end(),
hypName ) != _compatibleHypothesis.end() )
{
_hypothesis = static_cast<const NETGENPlugin_Hypothesis*> (theHyp);
ASSERT(_hypothesis);
_hypothesis = theHyp;
aStatus = SMESH_Hypothesis::HYP_OK;
}
else
{
aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE;
}
return aStatus == SMESH_Hypothesis::HYP_OK;
}
@ -121,53 +122,11 @@ bool NETGENPlugin_NETGEN_2D3D::CheckHypothesis
bool NETGENPlugin_NETGEN_2D3D::Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape)
{
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
// SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
NETGENPlugin_Mesher mesher(meshDS, aShape, true);
mesher.SetParameters(_hypothesis);
NETGENPlugin_Mesher mesher(&aMesh, aShape, true);
// NETGENPlugin_Mesher mesher(meshDS, aShape, true);
mesher.SetParameters(dynamic_cast<const NETGENPlugin_Hypothesis*>(_hypothesis));
mesher.SetParameters(dynamic_cast<const NETGENPlugin_SimpleHypothesis_2D*>(_hypothesis));
return mesher.Compute();
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & NETGENPlugin_NETGEN_2D3D::SaveTo(ostream & save)
{
return save;
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & NETGENPlugin_NETGEN_2D3D::LoadFrom(istream & load)
{
return load;
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D3D & hyp)
{
return hyp.SaveTo( save );
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D3D & hyp)
{
return hyp.LoadFrom( load );
}

View File

@ -29,14 +29,16 @@
#ifndef _NETGENPlugin_NETGEN_2D3D_HXX_
#define _NETGENPlugin_NETGEN_2D3D_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_3D_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "StdMeshers_MaxElementVolume.hxx"
#include "Utils_SALOME_Exception.hxx"
class NETGENPlugin_Hypothesis;
//class NETGENPlugin_Hypothesis;
class NETGENPlugin_NETGEN_2D3D: public SMESH_3D_Algo
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D: public SMESH_3D_Algo
{
public:
NETGENPlugin_NETGEN_2D3D(int hypId, int studyId, SMESH_Gen* gen);
@ -49,13 +51,8 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
ostream & SaveTo(ostream & save);
istream & LoadFrom(istream & load);
friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_2D3D & hyp);
friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_2D3D & hyp);
protected:
const NETGENPlugin_Hypothesis* _hypothesis;
const SMESHDS_Hypothesis* _hypothesis;
};
#endif

View File

@ -24,13 +24,14 @@
// Module : NETGENPlugin
// $Header$
using namespace std;
#include "NETGENPlugin_NETGEN_2D3D_i.hxx"
#include "SMESH_Gen.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
using namespace std;
//=============================================================================
/*!
* NETGENPlugin_NETGEN_2D3D_i::NETGENPlugin_NETGEN_2D3D_i

View File

@ -27,6 +27,8 @@
#ifndef _NETGENPlugin_NETGEN_2D3D_I_HXX_
#define _NETGENPlugin_NETGEN_2D3D_I_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
@ -36,7 +38,7 @@
// ======================================================
// NETGEN 3d algorithm
// ======================================================
class NETGENPlugin_NETGEN_2D3D_i:
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D3D,
public virtual SMESH_3D_Algo_i
{

View File

@ -0,0 +1,441 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPlugin_NETGEN_2D_ONLY.cxx
// Author : Edward AGAPOV (OCC)
// Project : SALOME
#include "NETGENPlugin_NETGEN_2D_ONLY.hxx"
#include "NETGENPlugin_Mesher.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "StdMeshers_FaceSide.hxx"
#include "StdMeshers_MaxElementArea.hxx"
#include "StdMeshers_LengthFromEdges.hxx"
#include "StdMeshers_QuadranglePreference.hxx"
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include "utilities.h"
#include <list>
#include <vector>
/*
Netgen include files
*/
namespace nglib {
#include <nglib.h>
}
#define OCCGEOMETRY
#include <occgeom.hpp>
#include <meshing.hpp>
//#include <meshtype.hpp>
namespace netgen {
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
/*extern*/ MeshingParameters mparam;
}
using namespace std;
using namespace netgen;
using namespace nglib;
//=============================================================================
/*!
*
*/
//=============================================================================
NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY(int hypId, int studyId,
SMESH_Gen* gen)
: SMESH_2D_Algo(hypId, studyId, gen)
{
MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY");
_name = "NETGEN_2D_ONLY";
_shapeType = (1 << TopAbs_FACE);// 1 bit /shape type
_compatibleHypothesis.push_back("MaxElementArea");
_compatibleHypothesis.push_back("LengthFromEdges");
_compatibleHypothesis.push_back("QuadranglePreference");
_hypMaxElementArea = 0;
_hypLengthFromEdges = 0;
_hypQuadranglePreference = 0;
}
//=============================================================================
/*!
*
*/
//=============================================================================
NETGENPlugin_NETGEN_2D_ONLY::~NETGENPlugin_NETGEN_2D_ONLY()
{
MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::~NETGENPlugin_NETGEN_2D_ONLY");
}
//=============================================================================
/*!
*
*/
//=============================================================================
bool NETGENPlugin_NETGEN_2D_ONLY::CheckHypothesis (SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
Hypothesis_Status& aStatus)
{
_hypMaxElementArea = 0;
_hypLengthFromEdges = 0;
_hypQuadranglePreference = 0;
const list<const SMESHDS_Hypothesis*>& hyps = GetUsedHypothesis(aMesh, aShape, false);
if (hyps.empty())
{
aStatus = HYP_OK; //SMESH_Hypothesis::HYP_MISSING;
return true; // (PAL13464) can work with no hypothesis, LengthFromEdges is default one
}
aStatus = HYP_MISSING;
list<const SMESHDS_Hypothesis*>::const_iterator ith;
for (ith = hyps.begin(); ith != hyps.end(); ++ith )
{
const SMESHDS_Hypothesis* hyp = (*ith);
string hypName = hyp->GetName();
if ( hypName == "MaxElementArea")
_hypMaxElementArea = static_cast<const StdMeshers_MaxElementArea*> (hyp);
else if ( hypName == "LengthFromEdges" )
_hypLengthFromEdges = static_cast<const StdMeshers_LengthFromEdges*> (hyp);
else if ( hypName == "QuadranglePreference" )
_hypQuadranglePreference = static_cast<const StdMeshers_QuadranglePreference*>(hyp);
else {
aStatus = HYP_INCOMPATIBLE;
return false;
}
}
if ( _hypMaxElementArea && _hypLengthFromEdges ) {
aStatus = HYP_CONCURENT;
return false;
}
if ( _hypMaxElementArea || _hypLengthFromEdges )
aStatus = HYP_OK;
return aStatus == HYP_OK;
}
//================================================================================
/*!
* \brief Fill netgen mesh with segments
* \retval SMESH_ComputeErrorPtr - error description
*/
//================================================================================
static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
OCCGeometry& geom,
const TSideVector& wires,
SMESH_MesherHelper& helper,
vector< const SMDS_MeshNode* > & nodeVec)
{
// ----------------------------
// Check wires and count nodes
// ----------------------------
int nbNodes = 0;
for ( int iW = 0; iW < wires.size(); ++iW )
{
StdMeshers_FaceSidePtr wire = wires[ iW ];
if ( wire->MissVertexNode() )
return TError
(new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH, "Missing nodes on vertices"));
const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
if ( uvPtVec.size() != wire->NbPoints() )
return TError
(new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Unexpected nb of points on wire ") << iW
<< ": " << uvPtVec.size()<<" != "<<wire->NbPoints()));
nbNodes += wire->NbSegments();
}
nodeVec.reserve( nbNodes );
// -----------------
// Fill netgen mesh
// -----------------
// netgen::Box<3> bb = geom.GetBoundingBox();
// bb.Increase (bb.Diam()/10);
// ngMesh.SetLocalH (bb.PMin(), bb.PMax(), 0.5); // set grading
const int faceID = 1, solidID = 0;
ngMesh.AddFaceDescriptor (FaceDescriptor(faceID, solidID, solidID, 0));
for ( int iW = 0; iW < wires.size(); ++iW )
{
StdMeshers_FaceSidePtr wire = wires[ iW ];
const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
int firstPointID = ngMesh.GetNP() + 1;
int edgeID = 1, posID = -2;
for ( int i = 0; i < wire->NbSegments(); ++i ) // loop on segments
{
// Add the first point of a segment
const SMDS_MeshNode * n = uvPtVec[ i ].node;
const int posShapeID = n->GetPosition()->GetShapeId();
// skip nodes on degenerated edges
if ( helper.IsDegenShape( posShapeID ) &&
helper.IsDegenShape( uvPtVec[ i+1 ].node->GetPosition()->GetShapeId() ))
continue;
nodeVec.push_back( n );
MeshPoint mp( Point<3> (n->X(), n->Y(), n->Z()) );
ngMesh.AddPoint ( mp, 1, EDGEPOINT );
// Add the segment
Segment seg;
seg.p1 = ngMesh.GetNP(); // ng node id
seg.p2 = seg.p1 + 1; // ng node id
seg.edgenr = ngMesh.GetNSeg() + 1;// segment id
seg.si = faceID; // = geom.fmap.FindIndex (face);
for ( int iEnd = 0; iEnd < 2; ++iEnd)
{
const UVPtStruct& pnt = uvPtVec[ i + iEnd ];
seg.epgeominfo[ iEnd ].dist = pnt.param; // param on curve
seg.epgeominfo[ iEnd ].u = pnt.u;
seg.epgeominfo[ iEnd ].v = pnt.v;
// find out edge id and node parameter on edge
bool onVertex = ( pnt.node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_VERTEX );
if ( onVertex || posShapeID != posID )
{
// get edge id
double normParam = pnt.normParam;
if ( onVertex )
normParam = 0.5 * ( uvPtVec[ i ].normParam + uvPtVec[ i+1 ].normParam );
const TopoDS_Edge& edge = wire->Edge( wire->EdgeIndex( normParam ));
edgeID = geom.emap.FindIndex( edge );
posID = posShapeID;
if ( onVertex ) // param on curve is different on each of two edges
seg.epgeominfo[ iEnd ].dist = helper.GetNodeU( edge, pnt.node );
}
seg.epgeominfo[ iEnd ].edgenr = edgeID; // = geom.emap.FindIndex(edge);
}
ngMesh.AddSegment (seg);
// cout << "Segment: " << seg.edgenr << endl
// << "\tp1: " << seg.p1 << endl
// << "\tp2: " << seg.p2 << endl
// << "\tp0 param: " << seg.epgeominfo[ 0 ].dist << endl
// << "\tp0 uv: " << seg.epgeominfo[ 0 ].u <<", "<< seg.epgeominfo[ 0 ].v << endl
// << "\tp0 edge: " << seg.epgeominfo[ 0 ].edgenr << endl
// << "\tp1 param: " << seg.epgeominfo[ 1 ].dist << endl
// << "\tp1 uv: " << seg.epgeominfo[ 1 ].u <<", "<< seg.epgeominfo[ 1 ].v << endl
// << "\tp1 edge: " << seg.epgeominfo[ 1 ].edgenr << endl;
}
Segment& seg = ngMesh.LineSegment( ngMesh.GetNSeg() );
seg.p2 = firstPointID;
}
ngMesh.CalcSurfacesOfNode();
return TError();
}
//=============================================================================
/*!
*Here we are going to use the NETGEN mesher
*/
//=============================================================================
bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape)
{
MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::Compute()");
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
int faceID = meshDS->ShapeToIndex( aShape );
SMESH_MesherHelper helper(aMesh);
_quadraticMesh = helper.IsQuadraticSubMesh(aShape);
helper.SetElementsOnShape( true );
const bool ignoreMediumNodes = _quadraticMesh;
// ------------------------
// get all edges of a face
// ------------------------
const TopoDS_Face F = TopoDS::Face( aShape.Oriented( TopAbs_FORWARD ));
TError problem;
TSideVector wires = StdMeshers_FaceSide::GetFaceWires( F, aMesh, ignoreMediumNodes, problem );
if ( problem && !problem->IsOK() )
return error( problem );
int nbWires = wires.size();
if ( nbWires == 0 )
return error( "Problem in StdMeshers_FaceSide::GetFaceWires()");
if ( wires[0]->NbSegments() < 3 ) // ex: a circle with 2 segments
return error(COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Too few segments: ")<<wires[0]->NbSegments());
// -------------------------
// Make input netgen mesh
// -------------------------
Ng_Init();
netgen::Mesh * ngMesh = new netgen::Mesh ();
netgen::OCCGeometry occgeo;
NETGENPlugin_Mesher::PrepareOCCgeometry( occgeo, F, aMesh );
vector< const SMDS_MeshNode* > nodeVec;
problem = AddSegmentsToMesh( *ngMesh, occgeo, wires, helper, nodeVec );
if ( problem && !problem->IsOK() ) {
delete ngMesh; Ng_Exit();
return error( problem );
}
// --------------------
// compute edge length
// --------------------
double edgeLength = 0;
if (_hypLengthFromEdges || !_hypLengthFromEdges && !_hypMaxElementArea)
{
int nbSegments = 0;
for ( int iW = 0; iW < nbWires; ++iW )
{
edgeLength += wires[ iW ]->Length();
nbSegments += wires[ iW ]->NbSegments();
}
if ( nbSegments )
edgeLength /= nbSegments;
}
if ( _hypMaxElementArea )
{
double maxArea = _hypMaxElementArea->GetMaxArea();
edgeLength = sqrt(2. * maxArea/sqrt(3.0));
}
if ( edgeLength < DBL_MIN )
edgeLength = occgeo.GetBoundingBox().Diam();
//cout << " edgeLength = " << edgeLength << endl;
netgen::mparam.maxh = edgeLength;
netgen::mparam.quad = _hypQuadranglePreference ? 1 : 0;
//ngMesh->SetGlobalH ( edgeLength );
// -------------------------
// Generate surface mesh
// -------------------------
char *optstr;
int startWith = MESHCONST_MESHSURFACE;
int endWith = MESHCONST_OPTSURFACE;
int err = 1;
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
}
catch (Standard_Failure& ex) {
string comment = ex.DynamicType()->Name();
if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) {
comment += ": ";
comment += ex.GetMessageString();
}
error(COMPERR_OCC_EXCEPTION, comment);
}
catch (NgException exc) {
error( SMESH_Comment("NgException: ") << exc.What() );
}
catch (...) {
error(COMPERR_EXCEPTION,"Exception in netgen::OCCGenerateMesh()");
}
// ----------------------------------------------------
// Fill the SMESHDS with the generated nodes and faces
// ----------------------------------------------------
int nbNodes = ngMesh->GetNP();
int nbFaces = ngMesh->GetNSE();
int nbInputNodes = nodeVec.size();
nodeVec.resize( nbNodes, 0 );
// add nodes
for ( int i = nbInputNodes + 1; i <= nbNodes; ++i )
{
const MeshPoint& ngPoint = ngMesh->Point(i);
SMDS_MeshNode * node = meshDS->AddNode(ngPoint.X(), ngPoint.Y(), ngPoint.Z());
nodeVec[ i-1 ] = node;
}
// create faces
bool reverse = ( aShape.Orientation() == TopAbs_REVERSED );
for ( int i = 1; i <= nbFaces ; ++i )
{
const Element2d& elem = ngMesh->SurfaceElement(i);
vector<const SMDS_MeshNode*> nodes( elem.GetNP() );
for (int j=1; j <= elem.GetNP(); ++j)
{
int pind = elem.PNum(j);
const SMDS_MeshNode* node = nodeVec.at(pind-1);
if ( reverse )
nodes[ nodes.size()-j ] = node;
else
nodes[ j-1 ] = node;
if ( node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_3DSPACE )
{
const PointGeomInfo& pgi = elem.GeomInfoPi(j);
meshDS->SetNodeOnFace((SMDS_MeshNode*)node, faceID, pgi.u, pgi.v);
}
}
SMDS_MeshFace* face = 0;
if ( elem.GetType() == TRIG )
face = helper.AddFace(nodes[0],nodes[1],nodes[2]);
else
face = helper.AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
}
Ng_DeleteMesh((nglib::Ng_Mesh*)ngMesh);
Ng_Exit();
NETGENPlugin_Mesher::RemoveTmpFiles();
return !err;
}

View File

@ -0,0 +1,84 @@
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS, L3S, LJLL, MENSI
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : NETGENPlugin_NETGEN_2D_ONLY.hxx
// Project : SALOME
// Author : Edward AGAPOV (OCC)
#ifndef _NETGENPlugin_NETGEN_2D_ONLY_HXX_
#define _NETGENPlugin_NETGEN_2D_ONLY_HXX_
#include "SMESH_2D_Algo.hxx"
#include "SMESH_Mesh.hxx"
/*#define OCCGEOMETRY
#include <occgeom.hpp>
#include <meshing.hpp>//amv*/
class StdMeshers_MaxElementArea;
class StdMeshers_LengthFromEdges;
class StdMeshers_QuadranglePreference;
//class NETGENPlugin_Hypothesis;
/*namespace netgen {
class OCCGeometry;
}*/
/*namespace netgen {
class OCCGeometry;
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
extern MeshingParameters mparam;
}*/
//using namespace netgen;
/*!
* \brief Mesher generating 2D elements on a geometrical face taking
* into account pre-existing nodes on face boundaries
*
* Historically, NETGENPlugin_NETGEN_2D is actually 1D-2D, that is why
* the class is named NETGENPlugin_NETGEN_2D_ONLY. Renaming is useless as
* algorithm field "_name" can't be changed
*/
class NETGENPlugin_NETGEN_2D_ONLY: public SMESH_2D_Algo
{
public:
NETGENPlugin_NETGEN_2D_ONLY(int hypId, int studyId, SMESH_Gen* gen);
virtual ~NETGENPlugin_NETGEN_2D_ONLY();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
/*static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
OCCGeometry& geom,
const TSideVector& wires,
SMESH_MesherHelper& helper,
vector< const SMDS_MeshNode* > & nodeVec); //amv*/
protected:
const StdMeshers_MaxElementArea* _hypMaxElementArea;
const StdMeshers_LengthFromEdges* _hypLengthFromEdges;
const StdMeshers_QuadranglePreference* _hypQuadranglePreference;
// const NETGENPlugin_Hypothesis* _hypothesis;
};
#endif

View File

@ -0,0 +1,81 @@
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : NETGENPlugin_NETGEN_2D_ONLY_i.cxx
// Author : Edward AGAPOV (OCC)
// Module : SMESH
#include "NETGENPlugin_NETGEN_2D_ONLY_i.hxx"
#include "SMESH_Gen.hxx"
#include "utilities.h"
//=============================================================================
/*!
* NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i
*
* Constructor
*/
//=============================================================================
NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
MESSAGE( "NETGENPlugin_NETGEN_2D_ONLY_i::NETGENPlugin_NETGEN_2D_ONLY_i" );
myBaseImpl = new ::NETGENPlugin_NETGEN_2D_ONLY( theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
}
//=============================================================================
/*!
* NETGENPlugin_NETGEN_2D_ONLY_i::~NETGENPlugin_NETGEN_2D_ONLY_i
*
* Destructor
*/
//=============================================================================
NETGENPlugin_NETGEN_2D_ONLY_i::~NETGENPlugin_NETGEN_2D_ONLY_i()
{
MESSAGE( "NETGENPlugin_NETGEN_2D_ONLY_i::~NETGENPlugin_NETGEN_2D_ONLY_i" );
}
//=============================================================================
/*!
* NETGENPlugin_NETGEN_2D_ONLY_i::GetImpl
*
* Get implementation
*/
//=============================================================================
::NETGENPlugin_NETGEN_2D_ONLY* NETGENPlugin_NETGEN_2D_ONLY_i::GetImpl()
{
MESSAGE( "NETGENPlugin_NETGEN_2D_ONLY_i::GetImpl" );
return ( ::NETGENPlugin_NETGEN_2D_ONLY* )myBaseImpl;
}

View File

@ -0,0 +1,56 @@
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
//
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
//
// File : NETGENPlugin_NETGEN_2D_ONLY_i.cxx
// Author : Edward AGAPOV (OCC)
// Module : SMESH
#ifndef _NETGENPlugin_NETGEN_2D_ONLY_I_HXX_
#define _NETGENPlugin_NETGEN_2D_ONLY_I_HXX_
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "SMESH_2D_Algo_i.hxx"
#include "NETGENPlugin_NETGEN_2D_ONLY.hxx"
// ======================================================
// NETGEN 2D algorithm
// ======================================================
class NETGENPlugin_NETGEN_2D_ONLY_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D_ONLY,
public virtual SMESH_2D_Algo_i
{
public:
// Constructor
NETGENPlugin_NETGEN_2D_ONLY_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~NETGENPlugin_NETGEN_2D_ONLY_i();
// Get implementation
::NETGENPlugin_NETGEN_2D_ONLY* GetImpl();
};
#endif

View File

@ -24,13 +24,14 @@
// Module : NETGENPlugin
// $Header$
using namespace std;
#include "NETGENPlugin_NETGEN_2D_i.hxx"
#include "SMESH_Gen.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
using namespace std;
//=============================================================================
/*!
* NETGENPlugin_NETGEN_2D_i::NETGENPlugin_NETGEN_2D_i

View File

@ -27,6 +27,8 @@
#ifndef _NETGENPlugin_NETGEN_2D_I_HXX_
#define _NETGENPlugin_NETGEN_2D_I_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
@ -36,7 +38,7 @@
// ======================================================
// NETGEN 3d algorithm
// ======================================================
class NETGENPlugin_NETGEN_2D_i:
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_2D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_2D,
public virtual SMESH_2D_Algo_i
{

View File

@ -26,23 +26,28 @@
// Copyright : CEA 2003
// $Header$
//=============================================================================
using namespace std;
#include "NETGENPlugin_NETGEN_3D.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_ControlsDef.hxx"
#include "SMESHDS_Mesh.hxx"
#include "NETGENPlugin_Mesher.hxx"
#include "SMDS_MeshElement.hxx"
#include "SMDS_MeshNode.hxx"
#include "SMESHDS_Mesh.hxx"
#include "SMESH_Comment.hxx"
#include "SMESH_ControlsDef.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "StdMeshers_QuadToTriaAdaptor.hxx"
#include <BRep_Tool.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>
#include "utilities.h"
#include <list>
@ -76,6 +81,8 @@ NETGENPlugin_NETGEN_3D::NETGENPlugin_NETGEN_3D(int hypId, int studyId,
_maxElementVolume = 0.;
_hypMaxElementVolume = NULL;
_requireShape = false; // can work without shape
}
//=============================================================================
@ -160,7 +167,8 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
// get triangles on aShell and make a map of nodes to Netgen node IDs
// -------------------------------------------------------------------
SMESH_MesherHelper* myTool = new SMESH_MesherHelper(aMesh);
SMESH_MesherHelper helper(aMesh);
SMESH_MesherHelper* myTool = &helper;
bool _quadraticMesh = myTool->IsQuadraticSubMesh(aShape);
typedef map< const SMDS_MeshNode*, int> TNodeToIDMap;
@ -174,6 +182,9 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
map< int, int* >::iterator shId_ngId;
list< int > degenNgIds;
StdMeshers_QuadToTriaAdaptor Adaptor;
Adaptor.Compute(aMesh,aShape);
for (TopExp_Explorer exp(aShape,TopAbs_FACE);exp.More();exp.Next())
{
const TopoDS_Shape& aShapeFace = exp.Current();
@ -187,23 +198,46 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
{
// check element
const SMDS_MeshElement* elem = iteratorElem->next();
if ( !elem ||
!( elem->NbNodes()==3 || ( _quadraticMesh && elem->NbNodes()==6) ) ) {
INFOS( "NETGENPlugin_NETGEN_3D::Compute(), bad mesh");
delete myTool; myTool = 0;
return false;
if ( !elem )
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
if ( !isTraingle ) {
//return error( COMPERR_BAD_INPUT_MESH,
// SMESH_Comment("Not triangle element ")<<elem->GetID());
// using adaptor
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
if(faces.size()==0) {
return error( COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
}
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
for(; itf!=faces.end(); itf++ ) {
triangles.push_back( (*itf) );
isReversed.push_back( isRev );
// put triange's nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(myTool->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
}
}
}
// keep a triangle
triangles.push_back( elem );
isReversed.push_back( isRev );
// put elem nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(myTool->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
else {
// keep a triangle
triangles.push_back( elem );
isReversed.push_back( isRev );
// put elem nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(myTool->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
}
}
#ifdef _DEBUG_
// check if a trainge is degenerated
@ -312,12 +346,28 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
Ng_Result status;
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
status = Ng_GenerateVolumeMesh(Netgen_mesh, &Netgen_param);
}
catch (...) {
MESSAGE("An exception has been caught during the Volume Mesh Generation ...");
catch (Standard_Failure& exc) {
error(COMPERR_OCC_EXCEPTION, exc.GetMessageString());
status = NG_VOLUME_FAILURE;
}
catch (...) {
error("Exception in Ng_GenerateVolumeMesh()");
status = NG_VOLUME_FAILURE;
}
if ( GetComputeError()->IsOK() ) {
switch ( status ) {
case NG_SURFACE_INPUT_ERROR:error( status, "NG_SURFACE_INPUT_ERROR");
case NG_VOLUME_FAILURE: error( status, "NG_VOLUME_FAILURE");
case NG_STL_INPUT_ERROR: error( status, "NG_STL_INPUT_ERROR");
case NG_SURFACE_FAILURE: error( status, "NG_SURFACE_FAILURE");
case NG_FILE_NOT_FOUND: error( status, "NG_FILE_NOT_FOUND");
};
}
int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh);
@ -331,7 +381,7 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
// Feed back the SMESHDS with the generated Nodes and Volume Elements
// -------------------------------------------------------------------
bool isOK = ( status == NG_OK && Netgen_NbOfTetra > 0 );
bool isOK = ( /*status == NG_OK &&*/ Netgen_NbOfTetra > 0 );// get whatever built
if ( isOK )
{
// vector of nodes in which node index == netgen ID
@ -368,51 +418,206 @@ bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
Ng_DeleteMesh(Netgen_mesh);
Ng_Exit();
delete myTool; myTool = 0;
NETGENPlugin_Mesher::RemoveTmpFiles();
return isOK;
return (status == NG_OK);
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & NETGENPlugin_NETGEN_3D::SaveTo(ostream & save)
bool NETGENPlugin_NETGEN_3D::Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* aHelper)
{
return save;
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & NETGENPlugin_NETGEN_3D::LoadFrom(istream & load)
{
return load;
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & operator << (ostream & save, NETGENPlugin_NETGEN_3D & hyp)
{
return hyp.SaveTo( save );
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & operator >> (istream & load, NETGENPlugin_NETGEN_3D & hyp)
{
return hyp.LoadFrom( load );
MESSAGE("NETGENPlugin_NETGEN_3D::Compute with maxElmentsize = " << _maxElementVolume);
const int invalid_ID = -1;
bool _quadraticMesh = false;
typedef map< const SMDS_MeshNode*, int> TNodeToIDMap;
TNodeToIDMap nodeToNetgenID;
list< const SMDS_MeshElement* > triangles;
SMESHDS_Mesh* MeshDS = aHelper->GetMeshDS();
SMESH_MesherHelper::MType MeshType = aHelper->IsQuadraticMesh();
if(MeshType == SMESH_MesherHelper::COMP)
return error( COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Mesh with linear and quadratic elements given."));
else if (MeshType == SMESH_MesherHelper::QUADRATIC)
_quadraticMesh = true;
StdMeshers_QuadToTriaAdaptor Adaptor;
Adaptor.Compute(aMesh);
SMDS_FaceIteratorPtr iteratorFace = MeshDS->facesIterator();
while(iteratorFace->more()) {
// check element
const SMDS_MeshElement* elem = iteratorFace->next();
if ( !elem )
return error( COMPERR_BAD_INPUT_MESH, "Null element encounters");
bool isTraingle = ( elem->NbNodes()==3 || (_quadraticMesh && elem->NbNodes()==6 ));
if ( !isTraingle ) {
//return error( COMPERR_BAD_INPUT_MESH,
// SMESH_Comment("Not triangle element ")<<elem->GetID());
// using adaptor
std::list<const SMDS_FaceOfNodes*> faces = Adaptor.GetTriangles(elem);
if(faces.size()==0) {
return error( COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Not triangles in adaptor for element ")<<elem->GetID());
}
std::list<const SMDS_FaceOfNodes*>::iterator itf = faces.begin();
for(; itf!=faces.end(); itf++ ) {
triangles.push_back( (*itf) );
// put triange's nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = (*itf)->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(aHelper->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
}
}
}
else {
// keep a triangle
triangles.push_back( elem );
// put elem nodes to nodeToNetgenID map
SMDS_ElemIteratorPtr triangleNodesIt = elem->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(aHelper->IsMedium(node))
continue;
nodeToNetgenID.insert( make_pair( node, invalid_ID ));
}
}
}
// ---------------------------------
// Feed the Netgen with surface mesh
// ---------------------------------
int Netgen_NbOfNodes = 0;
int Netgen_param2ndOrder = 0;
double Netgen_paramFine = 1.;
double Netgen_paramSize = _maxElementVolume;
double Netgen_point[3];
int Netgen_triangle[3];
int Netgen_tetrahedron[4];
Ng_Init();
Ng_Mesh * Netgen_mesh = Ng_NewMesh();
// set nodes and remember thier netgen IDs
TNodeToIDMap::iterator n_id = nodeToNetgenID.begin();
for ( ; n_id != nodeToNetgenID.end(); ++n_id )
{
const SMDS_MeshNode* node = n_id->first;
Netgen_point [ 0 ] = node->X();
Netgen_point [ 1 ] = node->Y();
Netgen_point [ 2 ] = node->Z();
Ng_AddPoint(Netgen_mesh, Netgen_point);
n_id->second = ++Netgen_NbOfNodes; // set netgen ID
}
// set triangles
list< const SMDS_MeshElement* >::iterator tria = triangles.begin();
for ( ; tria != triangles.end(); ++tria)
{
int i = 0;
SMDS_ElemIteratorPtr triangleNodesIt = (*tria)->nodesIterator();
while ( triangleNodesIt->more() ) {
const SMDS_MeshNode * node =
static_cast<const SMDS_MeshNode *>(triangleNodesIt->next());
if(aHelper->IsMedium(node))
continue;
Netgen_triangle[ i ] = nodeToNetgenID[ node ];
++i;
}
Ng_AddSurfaceElement(Netgen_mesh, NG_TRIG, Netgen_triangle);
}
// -------------------------
// Generate the volume mesh
// -------------------------
Ng_Meshing_Parameters Netgen_param;
Netgen_param.secondorder = Netgen_param2ndOrder;
Netgen_param.fineness = Netgen_paramFine;
Netgen_param.maxh = Netgen_paramSize;
Ng_Result status;
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
status = Ng_GenerateVolumeMesh(Netgen_mesh, &Netgen_param);
}
catch (Standard_Failure& exc) {
error(COMPERR_OCC_EXCEPTION, exc.GetMessageString());
status = NG_VOLUME_FAILURE;
}
catch (...) {
error("Bad mesh input!!!");
status = NG_VOLUME_FAILURE;
}
if ( GetComputeError()->IsOK() ) {
error( status, "Bad mesh input!!!");
}
int Netgen_NbOfNodesNew = Ng_GetNP(Netgen_mesh);
int Netgen_NbOfTetra = Ng_GetNE(Netgen_mesh);
MESSAGE("End of Volume Mesh Generation. status=" << status <<
", nb new nodes: " << Netgen_NbOfNodesNew - Netgen_NbOfNodes <<
", nb tetra: " << Netgen_NbOfTetra);
// -------------------------------------------------------------------
// Feed back the SMESHDS with the generated Nodes and Volume Elements
// -------------------------------------------------------------------
bool isOK = ( Netgen_NbOfTetra > 0 );// get whatever built
if ( isOK )
{
// vector of nodes in which node index == netgen ID
vector< const SMDS_MeshNode* > nodeVec ( Netgen_NbOfNodesNew + 1 );
// insert old nodes into nodeVec
for ( n_id = nodeToNetgenID.begin(); n_id != nodeToNetgenID.end(); ++n_id ) {
nodeVec.at( n_id->second ) = n_id->first;
}
// create and insert new nodes into nodeVec
int nodeIndex = Netgen_NbOfNodes + 1;
for ( ; nodeIndex <= Netgen_NbOfNodesNew; ++nodeIndex )
{
Ng_GetPoint( Netgen_mesh, nodeIndex, Netgen_point );
SMDS_MeshNode * node = aHelper->AddNode(Netgen_point[0],
Netgen_point[1],
Netgen_point[2]);
nodeVec.at(nodeIndex) = node;
}
// create tetrahedrons
for ( int elemIndex = 1; elemIndex <= Netgen_NbOfTetra; ++elemIndex )
{
Ng_GetVolumeElement(Netgen_mesh, elemIndex, Netgen_tetrahedron);
aHelper->AddVolume (nodeVec.at( Netgen_tetrahedron[0] ),
nodeVec.at( Netgen_tetrahedron[1] ),
nodeVec.at( Netgen_tetrahedron[2] ),
nodeVec.at( Netgen_tetrahedron[3] ));
}
}
Ng_DeleteMesh(Netgen_mesh);
Ng_Exit();
NETGENPlugin_Mesher::RemoveTmpFiles();
return (status == NG_OK);
}

View File

@ -23,19 +23,20 @@
// Created : lundi 27 Janvier 2003
// Author : Nadir BOUHAMOU (CEA)
// Project : SALOME
// Copyright : CEA 2003
// $Header$
//=============================================================================
#ifndef _NETGENPlugin_NETGEN_3D_HXX_
#define _NETGENPlugin_NETGEN_3D_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_3D_Algo.hxx"
#include "SMESH_Mesh.hxx"
#include "StdMeshers_MaxElementVolume.hxx"
#include "Utils_SALOME_Exception.hxx"
class NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D: public SMESH_3D_Algo
{
public:
NETGENPlugin_NETGEN_3D(int hypId, int studyId, SMESH_Gen* gen);
@ -48,11 +49,9 @@ public:
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape);
ostream & SaveTo(ostream & save);
istream & LoadFrom(istream & load);
friend ostream & operator << (ostream & save, NETGENPlugin_NETGEN_3D & hyp);
friend istream & operator >> (istream & load, NETGENPlugin_NETGEN_3D & hyp);
virtual bool Compute(SMESH_Mesh& aMesh,
SMESH_MesherHelper* aHelper);
protected:
double _maxElementVolume;

View File

@ -27,13 +27,14 @@
// Module : SMESH
// $Header$
using namespace std;
#include "NETGENPlugin_NETGEN_3D_i.hxx"
#include "SMESH_Gen.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
using namespace std;
//=============================================================================
/*!
* NETGENPlugin_NETGEN_3D_i::NETGENPlugin_NETGEN_3D_i

View File

@ -30,6 +30,8 @@
#ifndef _NETGENPlugin_NETGEN_3D_I_HXX_
#define _NETGENPlugin_NETGEN_3D_I_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
@ -39,7 +41,7 @@
// ======================================================
// NETGEN 3d algorithm
// ======================================================
class NETGENPlugin_NETGEN_3D_i:
class NETGENPLUGIN_EXPORT NETGENPlugin_NETGEN_3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_NETGEN_3D,
public virtual SMESH_3D_Algo_i
{

View File

@ -0,0 +1,207 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_2D.cxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#include "NETGENPlugin_SimpleHypothesis_2D.hxx"
#include "NETGENPlugin_Hypothesis.hxx"
#include <SMESH_Mesh.hxx>
#include <SMESH_subMesh.hxx>
#include <SMESH_ControlsDef.hxx>
#include <TopExp_Explorer.hxx>
#include <utilities.h>
using namespace std;
//=============================================================================
/*!
*
*/
//=============================================================================
NETGENPlugin_SimpleHypothesis_2D::NETGENPlugin_SimpleHypothesis_2D (int hypId,
int studyId,
SMESH_Gen * gen)
: SMESH_Hypothesis(hypId, studyId, gen),
_nbSegments ((int)NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge()),
_segmentLength(0),
_area (0.)
{
_name = "NETGEN_SimpleParameters_2D";
_param_algo_dim = 2;
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_2D::SetNumberOfSegments(int nb) throw (SALOME_Exception)
{
if ( nb < 1 )
throw SALOME_Exception("Number of segments must be positive");
if (nb != _nbSegments)
{
_nbSegments = nb;
if ( _nbSegments ) _segmentLength = 0.;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_2D::SetLocalLength(double segmentLength)
throw (SALOME_Exception)
{
if ( segmentLength < DBL_MIN )
throw SALOME_Exception("segment length must be more than zero");
if (segmentLength != _segmentLength)
{
_segmentLength = segmentLength;
if ( _segmentLength > DBL_MIN ) _nbSegments = 0;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_2D::LengthFromEdges()
{
if (_area > DBL_MIN )
{
_area = 0;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_2D::SetMaxElementArea(double area)
{
if ( area < DBL_MIN )
area = 0.;
if (_area != area)
{
_area = area;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & NETGENPlugin_SimpleHypothesis_2D::SaveTo(ostream & save)
{
save << _nbSegments << " " << _segmentLength << " " << _area;
return save;
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & NETGENPlugin_SimpleHypothesis_2D::LoadFrom(istream & load)
{
bool isOK = true;
double val;
isOK = (load >> val);
if (isOK)
_nbSegments = (int) val;
else
load.clear(ios::badbit | load.rdstate());
isOK = (load >> val);
if (isOK)
_segmentLength = val;
else
load.clear(ios::badbit | load.rdstate());
isOK = (load >> val);
if (isOK)
_area = val;
else
load.clear(ios::badbit | load.rdstate());
return load;
}
//================================================================================
/*!
* \brief Does nothing
* \param theMesh - the built mesh
* \param theShape - the geometry of interest
* \retval bool - always false
*/
//================================================================================
bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByMesh(const SMESH_Mesh* theMesh,
const TopoDS_Shape& theShape)
{
// Find out nb of segments.
int nbSeg = 0, nbEdges = 0;
TopExp_Explorer exp( theShape, TopAbs_EDGE );
for ( ; exp.More(); exp.Next() ) {
SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() );
if ( sm && !sm->IsEmpty() ) {
nbSeg += sm->GetSubMeshDS()->NbElements();
nbEdges++;
}
}
if ( nbEdges )
_nbSegments = nbSeg / nbEdges;
// Find out max face area
_area = 0;
SMESH::Controls::Area areaControl;
SMESH::Controls::TSequenceOfXYZ nodesCoords;
const int nbFacesToCheck = 100;
for ( exp.Init( theShape, TopAbs_FACE ); exp.More(); exp.Next() ) {
SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() );
if ( sm && !sm->IsEmpty() ) {
SMDS_ElemIteratorPtr fIt = sm->GetSubMeshDS()->GetElements();
int nbCheckedFaces = 0;
while ( fIt->more() && nbCheckedFaces++ < nbFacesToCheck ) {
const SMDS_MeshElement* elem = fIt->next();
areaControl.GetPoints( elem, nodesCoords );
_area = max( _area, areaControl.GetValue( nodesCoords ));
}
}
}
return nbEdges;
}

View File

@ -0,0 +1,99 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_2D.hxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#ifndef _NETGENPlugin_SimpleHypothesis_2D_HXX_
#define _NETGENPlugin_SimpleHypothesis_2D_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
// Simplified parameters of NETGEN
//
using namespace std;
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D: public SMESH_Hypothesis
{
public:
NETGENPlugin_SimpleHypothesis_2D(int hypId, int studyId, SMESH_Gen * gen);
/*!
* Sets <number of segments> value
*/
void SetNumberOfSegments(int nb) throw (SALOME_Exception);
/*!
* Returns <number of segments> value.
* Can be zero in case if LocalLength() has been set
*/
int GetNumberOfSegments() const { return _nbSegments; }
/*!
* Sets <segment length> value
*/
void SetLocalLength(double segmentLength) throw (SALOME_Exception);
/*!
* Returns <segment length> value.
* Can be zero in case if NumberOfSegments() has been set
*/
double GetLocalLength() const { return _segmentLength; }
/*!
* Sets <maximum element area> to be dependent on 1D discretization
*/
void LengthFromEdges();
/*!
* Sets <maximum element area> value.
* Zero or negative value means same as LengthFromEdges().
*/
void SetMaxElementArea(double area);
/*!
* Returns <maximum element area> value.
* Can be zero in case of LengthFromEdges()
*/
double GetMaxElementArea() const { return _area; }
// Persistence
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);
/*!
* \brief Set parameters by mesh
* \param theMesh - the built mesh
* \param theShape - the geometry of interest
* \retval bool - true if theShape is meshed
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
private:
int _nbSegments;
double _segmentLength, _area;
};
#endif

View File

@ -0,0 +1,194 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_2D_i.cxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#include "NETGENPlugin_SimpleHypothesis_2D_i.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D.hxx"
#include <SMESH_Gen.hxx>
#include <SMESH_PythonDump.hxx>
#include <Utils_CorbaException.hxx>
#include <utilities.h>
using namespace std;
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::NETGENPlugin_SimpleHypothesis_2D_i
*
* Constructor
*/
//=============================================================================
NETGENPlugin_SimpleHypothesis_2D_i::
NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "NETGENPlugin_SimpleHypothesis_2D_i::NETGENPlugin_SimpleHypothesis_2D_i" );
myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_2D (theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i
*
* Destructor
*/
//=============================================================================
NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i()
{
MESSAGE( "NETGENPlugin_SimpleHypothesis_2D_i::~NETGENPlugin_SimpleHypothesis_2D_i" );
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments(CORBA::Short nb)
throw ( SALOME::SALOME_Exception )
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetNumberOfSegments");
ASSERT(myBaseImpl);
try {
this->GetImpl()->SetNumberOfSegments(nb);
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
}
SMESH::TPythonDump() << _this() << ".SetNumberOfSegments( " << nb << " )";
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments()
*/
//=============================================================================
CORBA::Short NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetNumberOfSegments");
ASSERT(myBaseImpl);
return this->GetImpl()->GetNumberOfSegments();
}
//================================================================================
/*!
* LocalLength()
*/
//================================================================================
void NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength(CORBA::Double segmentLength)
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetLocalLength");
ASSERT(myBaseImpl);
try {
this->GetImpl()->SetLocalLength(segmentLength);
}
catch (SALOME_Exception& S_ex) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
}
SMESH::TPythonDump() << _this() << ".LocalLength( " << segmentLength << " )";
}
//================================================================================
/*!
* GetLocalLength()
*/
//================================================================================
CORBA::Double NETGENPlugin_SimpleHypothesis_2D_i::GetLocalLength()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetLocalLength");
ASSERT(myBaseImpl);
return this->GetImpl()->GetLocalLength();
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges()
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::LengthFromEdges");
ASSERT(myBaseImpl);
this->GetImpl()->LengthFromEdges();
SMESH::TPythonDump() << _this() << ".LengthFromEdges()";
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea()
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea(CORBA::Double area)
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::SetMaxElementArea");
ASSERT(myBaseImpl);
this->GetImpl()->SetMaxElementArea(area);
SMESH::TPythonDump() << _this() << ".SetMaxElementArea( " << area << " )";
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea()
*/
//=============================================================================
CORBA::Double NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetMaxElementArea");
ASSERT(myBaseImpl);
return this->GetImpl()->GetMaxElementArea();
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_2D_i::GetImpl
*/
//=============================================================================
::NETGENPlugin_SimpleHypothesis_2D* NETGENPlugin_SimpleHypothesis_2D_i::GetImpl()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_2D_i::GetImpl");
return (::NETGENPlugin_SimpleHypothesis_2D*)myBaseImpl;
}
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
* \param type - dimension (see SMESH::Dimension enumeration)
* \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
*
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
CORBA::Boolean NETGENPlugin_SimpleHypothesis_2D_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_2D;
}

View File

@ -0,0 +1,74 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_2D_i.hxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#ifndef _NETGENPlugin_SimpleHypothesis_2D_i_HXX_
#define _NETGENPlugin_SimpleHypothesis_2D_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
#include "SMESH_Hypothesis_i.hxx"
class SMESH_Gen;
class NETGENPlugin_SimpleHypothesis_2D;
// Simplified NETGEN parameters (2D case)
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_2D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_SimpleHypothesis_2D,
public virtual SMESH_Hypothesis_i
{
public:
// Constructor
NETGENPlugin_SimpleHypothesis_2D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~NETGENPlugin_SimpleHypothesis_2D_i();
void SetNumberOfSegments(CORBA::Short nb) throw ( SALOME::SALOME_Exception );
CORBA::Short GetNumberOfSegments();
void SetLocalLength(CORBA::Double segmentLength);
CORBA::Double GetLocalLength();
void LengthFromEdges();
void SetMaxElementArea(CORBA::Double area);
CORBA::Double GetMaxElementArea();
// Get implementation
::NETGENPlugin_SimpleHypothesis_2D* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
};
#endif

View File

@ -0,0 +1,151 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_3D.cxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#include "NETGENPlugin_SimpleHypothesis_3D.hxx"
#include "NETGENPlugin_Hypothesis.hxx"
#include <SMESH_ControlsDef.hxx>
#include <SMESH_Mesh.hxx>
#include <SMESH_subMesh.hxx>
#include <TopExp_Explorer.hxx>
#include <utilities.h>
using namespace std;
//=============================================================================
/*!
*
*/
//=============================================================================
NETGENPlugin_SimpleHypothesis_3D::NETGENPlugin_SimpleHypothesis_3D (int hypId,
int studyId,
SMESH_Gen * gen)
: NETGENPlugin_SimpleHypothesis_2D(hypId, studyId, gen),
_volume(0)
{
_name = "NETGEN_SimpleParameters_3D";
_param_algo_dim = 3;
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_3D::LengthFromFaces()
{
if (_volume > DBL_MIN )
{
_volume = 0;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_3D::SetMaxElementVolume(double value)
{
if ( value < DBL_MIN )
value = 0.;
if (_volume != value)
{
_volume = value;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & NETGENPlugin_SimpleHypothesis_3D::SaveTo(ostream & save)
{
NETGENPlugin_SimpleHypothesis_2D::SaveTo( save );
save << " " << _volume;
return save;
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & NETGENPlugin_SimpleHypothesis_3D::LoadFrom(istream & load)
{
NETGENPlugin_SimpleHypothesis_2D::LoadFrom(load);
bool isOK = true;
double val;
isOK = (load >> val);
if (isOK)
_volume = val;
else
load.clear(ios::badbit | load.rdstate());
return load;
}
//================================================================================
/*!
* \brief Does nothing
* \param theMesh - the built mesh
* \param theShape - the geometry of interest
* \retval bool - always false
*/
//================================================================================
bool NETGENPlugin_SimpleHypothesis_3D::SetParametersByMesh(const SMESH_Mesh* theMesh,
const TopoDS_Shape& theShape)
{
if ( NETGENPlugin_SimpleHypothesis_2D::SetParametersByMesh(theMesh, theShape) )
{
// Find out max volume
_volume = 0;
SMESH::Controls::Volume volControl;
volControl.SetMesh( ((SMESH_Mesh*)theMesh)->GetMeshDS() );
const int nbElemToCheck = 100;
for ( TopExp_Explorer exp( theShape, TopAbs_SOLID ); exp.More(); exp.Next() ) {
SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() );
if ( sm && !sm->IsEmpty() ) {
SMDS_ElemIteratorPtr fIt = sm->GetSubMeshDS()->GetElements();
int nbCheckedElems = 0;
while ( fIt->more() && nbCheckedElems++ < nbElemToCheck ) {
const SMDS_MeshElement* elem = fIt->next();
_volume = max( _volume, volControl.GetValue( elem->GetID() ));
}
}
}
return int( _volume );
}
return false;
}

View File

@ -0,0 +1,67 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_3D.hxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#ifndef _NETGENPlugin_SimpleHypothesis_3D_HXX_
#define _NETGENPlugin_SimpleHypothesis_3D_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D.hxx"
#include <Utils_SALOME_Exception.hxx>
// Simplified parameters of NETGEN
//
using namespace std;
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D: public NETGENPlugin_SimpleHypothesis_2D
{
public:
NETGENPlugin_SimpleHypothesis_3D(int hypId, int studyId, SMESH_Gen * gen);
void LengthFromFaces();
void SetMaxElementVolume(double value);
double GetMaxElementVolume() const { return _volume; }
// Persistence
virtual ostream & SaveTo(ostream & save);
virtual istream & LoadFrom(istream & load);
/*!
* \brief Set parameters by mesh
* \param theMesh - the built mesh
* \param theShape - the geometry of interest
* \retval bool - true if theShape is meshed
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
private:
double _volume;
};
#endif

View File

@ -0,0 +1,134 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_3D_i.cxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#include "NETGENPlugin_SimpleHypothesis_3D_i.hxx"
#include "NETGENPlugin_SimpleHypothesis_3D.hxx"
#include <SMESH_Gen.hxx>
#include <SMESH_PythonDump.hxx>
#include <Utils_CorbaException.hxx>
#include <utilities.h>
using namespace std;
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_3D_i::NETGENPlugin_SimpleHypothesis_3D_i
*
* Constructor
*/
//=============================================================================
NETGENPlugin_SimpleHypothesis_3D_i::
NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
NETGENPlugin_SimpleHypothesis_2D_i( thePOA,theStudyId,theGenImpl )
{
MESSAGE( "NETGENPlugin_SimpleHypothesis_3D_i::NETGENPlugin_SimpleHypothesis_3D_i" );
if ( myBaseImpl )
delete myBaseImpl;
myBaseImpl = new ::NETGENPlugin_SimpleHypothesis_3D (theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i
*
* Destructor
*/
//=============================================================================
NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i()
{
MESSAGE( "NETGENPlugin_SimpleHypothesis_3D_i::~NETGENPlugin_SimpleHypothesis_3D_i" );
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces()
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::LengthFromFaces");
ASSERT(myBaseImpl);
this->GetImpl()->LengthFromFaces();
SMESH::TPythonDump() << _this() << ".LengthFromFaces()";
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume()
*/
//=============================================================================
void NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume(CORBA::Double value)
{
MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::SetMaxElementVolume");
ASSERT(myBaseImpl);
this->GetImpl()->SetMaxElementVolume(value);
SMESH::TPythonDump() << _this() << ".SetMaxElementVolume( " << value << " )";
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume()
*/
//=============================================================================
CORBA::Double NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::GetMaxElementVolume");
ASSERT(myBaseImpl);
return this->GetImpl()->GetMaxElementVolume();
}
//=============================================================================
/*!
* NETGENPlugin_SimpleHypothesis_3D_i::GetImpl
*/
//=============================================================================
::NETGENPlugin_SimpleHypothesis_3D* NETGENPlugin_SimpleHypothesis_3D_i::GetImpl()
{
MESSAGE("NETGENPlugin_SimpleHypothesis_3D_i::GetImpl");
return (::NETGENPlugin_SimpleHypothesis_3D*)myBaseImpl;
}
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
* \param type - dimension (see SMESH::Dimension enumeration)
* \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
*
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
CORBA::Boolean NETGENPlugin_SimpleHypothesis_3D_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_3D;
}

View File

@ -0,0 +1,65 @@
// NETGENPlugin : C++ implementation
//
// Copyright (C) 2006 OPEN CASCADE, CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
//
// File : NETGENPlugin_SimpleHypothesis_3D_i.hxx
// Author : Edward AGAPOV
// Project : SALOME
//=============================================================================
#ifndef _NETGENPlugin_SimpleHypothesis_3D_i_HXX_
#define _NETGENPlugin_SimpleHypothesis_3D_i_HXX_
#include "NETGENPlugin_Defs.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D_i.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(NETGENPlugin_Algorithm)
class SMESH_Gen;
class NETGENPlugin_SimpleHypothesis_3D;
// Simplified NETGEN parameters (3D case)
class NETGENPLUGIN_EXPORT NETGENPlugin_SimpleHypothesis_3D_i:
public virtual POA_NETGENPlugin::NETGENPlugin_SimpleHypothesis_3D,
public virtual NETGENPlugin_SimpleHypothesis_2D_i
{
public:
// Constructor
NETGENPlugin_SimpleHypothesis_3D_i (PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl);
// Destructor
virtual ~NETGENPlugin_SimpleHypothesis_3D_i();
void LengthFromFaces();
void SetMaxElementVolume(CORBA::Double value);
CORBA::Double GetMaxElementVolume();
// Get implementation
::NETGENPlugin_SimpleHypothesis_3D* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
};
#endif

View File

@ -26,14 +26,16 @@
// Module : SMESH
// $Header$
using namespace std;
#include "utilities.h"
#include "NETGENPlugin_NETGEN_3D_i.hxx"
#include "NETGENPlugin_NETGEN_2D_i.hxx"
#include "NETGENPlugin_NETGEN_2D_ONLY_i.hxx"
#include "NETGENPlugin_NETGEN_2D3D_i.hxx"
#include "NETGENPlugin_Hypothesis_i.hxx"
#include "NETGENPlugin_Hypothesis_2D_i.hxx"
#include "NETGENPlugin_SimpleHypothesis_2D_i.hxx"
#include "NETGENPlugin_SimpleHypothesis_3D_i.hxx"
template <class T> class NETGENPlugin_Creator_i:public HypothesisCreator_i<T>
{
@ -49,6 +51,7 @@ template <class T> class NETGENPlugin_Creator_i:public HypothesisCreator_i<T>
extern "C"
{
NETGENPLUGIN_EXPORT
GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName)
{
MESSAGE("GetHypothesisCreator " << aHypName);
@ -62,6 +65,8 @@ extern "C"
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_NETGEN_3D_i>;
else if (strcmp(aHypName, "NETGEN_2D") == 0)
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_NETGEN_2D_i>;
else if (strcmp(aHypName, "NETGEN_2D_ONLY") == 0)
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_NETGEN_2D_ONLY_i>;
else if (strcmp(aHypName, "NETGEN_2D3D") == 0)
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_NETGEN_2D3D_i>;
// Hypotheses
@ -69,6 +74,10 @@ extern "C"
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_Hypothesis_i>;
else if (strcmp(aHypName, "NETGEN_Parameters_2D") == 0)
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_Hypothesis_2D_i>;
else if (strcmp(aHypName, "NETGEN_SimpleParameters_2D") == 0)
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_SimpleHypothesis_2D_i>;
else if (strcmp(aHypName, "NETGEN_SimpleParameters_3D") == 0)
aCreator = new NETGENPlugin_Creator_i<NETGENPlugin_SimpleHypothesis_3D_i>;
else ;
return aCreator;