|
|
From a cross-section of recent setups submitted by users, it’s clear that data import from programs like SolidWorks is absolutely necessary for a practical 3D mesh generator. We’ve been adding such capabilities to MetaMesh for several years. The method for the analysis of STL objects in MetaMesh 2.5 was well-received by users. Nonetheless, occasionally I received examples from users that defeated the routines. The first picture shows one case. The old algorithm (based on the identification of comparison facets by proximity) was slow and was challenged when there were highly acute triangles near sharp edges. For these reasons, my advice to potential users was cautious: use STL objects sparingly for complex shapes and use native MetaMesh solids whenever possible.
In MetaMesh 3.0 (released today) we revamped the STL routines and did an extensive efficiency analysis. Furthermore, we parallelized the import process in the 64-bit program. There are two results:
- A speed increase by up to a factor of 5.
- High reliability for any valid STL object (i.e., no holes), independent of the shape of the facets.
The second figure shows the problematic user example, resolved quickly and successfully by MetaMesh 3.0. I believe that we now have the fastest, most reliable and simplest method for importing 3D CAD information of any finite-element system. Equally important, the process has a high level of user transparency. Accordingly, my official advice to potential users has changed: if you want to transfer an entire assembly from SolidWorks, go right ahead.
I thought I would take an opportunity to explain why we picked STL files as the transfer medium. Semi-proprietary formats like IGES and STEP are verbose, laden with far more information than required for electromagnetic field solutions. Furthermore, these formats are complex and malleable, with the potential introduction of proprietary features. Direct interaction with the API of the CAD programs has its own drawbacks. Creation of the interface involves extensive labor for each CAD program, contributing to higher costs for the finite-element program. A version change by one CAD vendor necessitates additional work and an update of the client program. Most important, with a direct API connection the mesh conversion process is hidden from the FE program user. Although conversions may proceed smoothly for certain classes of solutions, the crash of a closed process for solutions outside the envelope leaves no recourse for repairs.
STL (stereo lithography) files form the basis of the 3D printing industry. An STL file consists simply of list of triangular facets. The facets define the surface of an object of any level of complexity. Each file represents an individual part of an assembly. STL files offer several advantages for 3D data transfer:
- The format is simple and immutable. Because the format is critical for an extensive base of expensive 3D printers, CAD vendors can not introduce modifications or proprietary features.
- Information exchange is highly efficient because the files carry essential geometrical information and nothing else.
- The importance of the 3D printing industry ensures that all 3D CAD programs include an STL export capability.
- A variety of third-party software is available for viewing, transforming and correcting STL objects.
The STL format is a perfect fit to MetaMesh. The mesh generation process involves fabrication of a 3D assembly from a summation of solid parts. The program requires only shape information. All physical data is introduced in the subsequent finite-element solution programs.
Generation of STL files from a CAD program like SolidWorks is straightforward. Export from the Assembly space gives absolute facet coordinates that define the position and orientation of multiple parts, with a separate file for each part. Graphical preview features allow the user to control the quality of the surface representation. Unnecessary details that do not play a role in the electromagnetic solution and even entire parts may be suppressed. The resulting STL objects may then be inserted in the mesh space in Geometer.
The Geometer/MetaMesh system has capabilities that extend beyond the literal import of a CAD assembly:
- Geometer includes tools to introduce reflections, translations and stretching directly into STL files. In addition, the program includes a full-featured STL viewer with three-dimensional and precision projection displays.
- STL objects may be combined with native fundamental solids defined by parametric models.
- Users can introduce shifts and rotations of individual STL parts to perform perturbation analyses without the need to regenerate the CAD model.
- MetaMesh script directives enable global translations and rotations of entire STL assemblies.
If you have MetaMesh 3.0, here are links to input files for the benchmark test in the figures:
new_stl_method.min
new_stl_method.stl
 Facet display of typical STL object (Geometer STL Viewer)
 STL object resolved in MetaMesh
Backup and synchronization are inevitable problems when you work on more than one computer. There are two issues: 1) backing up work you have just performed and 2) transferring files to another computer without accidentally over-writing newer versions. The problem is of particular concern for me as a software developer working in a variety of locations. I am reluctant to use commercial backup programs. They generally have far more features than I need, and I don’t feel that I am completely in control. In this article I wanted share a simple but effective system that I use for synchronization. Although the procedure may be obvious to an experienced computer user, I feel it is worthwhile to document it for people who are not familiar with batch files.
Step 1
The critical thing to realize is that if you only record essential files, you can probably fit your entire professional life on one 8 GB USB Flash Drive. Get a good quality USB stick.
Step 2
The computers that you use must have the same data directory structure. For example, I keep all computer programs in a directory c:\progdev. This directory has the same structure on all my computers although individual files may change as I work on projects. To begin your data organization, pick one computer as the master.
Step 3
Use a text editor to create a file CDriveToUSB.bat in the root directory of the USB drive. Here is an example of the content:
REM Software backup: Disk C to USB
xcopy /S /D /F /Y C:\PROGDEV\*.f90 \PROGDEV\*.f90
xcopy /S /D /F /Y C:\PROGDEV\*.f \PROGDEV\*.f
xcopy /S /D /F /Y C:\PROGDEV\*.rc \PROGDEV\*.rc
xcopy /S /D /F /Y C:\PROGDEV\*.cur \PROGDEV\*.cur
xcopy /S /D /F /Y C:\PROGDEV\*.ico \PROGDEV\*.ico
xcopy /S /D /F /Y C:\PROGDEV\*.bmp \PROGDEV\*.bmp
xcopy /S /D /F /Y C:\PROGDEV\*.wpj \PROGDEV\*.wpj
The batch file invokes the DOS XCopy command, described at
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true
The first entry after the switches is the source directory and the final entry is the destination directory. The switches serve the following functions:
/S → Copy from C:\PROGDEV and all its subdirectories
/D → Copy only files that are newer than those in the destination directory
/F → Display the file names while copying
/Y → Suppress confirmation prompting
The key to a compact backup is to pick only the critical file types. In the example, the batch process saves files of source code, Windows resources, cursors, icons, toolbars and projects. Executables and compiled object files (which take up the most space) are not saved because they may be easily regenerated. With a batch file, you can customize the procedure to fit your data structure and to set the relative importance of material. You needn’t worry about getting everything perfect the first time. You can always add entries later.
To continue, run the batch file on the master computer.
Step 4
Create another file USBToCDrive.bat on the USB drive. This file is the inverse of the first one with an additional line:
REM Software restore: USB to Disk C
xcopy /S /D /F /Y \PROGDEV\*.f90 C:\PROGDEV\*.f90
xcopy /S /D /F /Y \PROGDEV\*.f C:\PROGDEV\*.f
xcopy /S /D /F /Y \PROGDEV\*.rc C:\PROGDEV\*.rc
xcopy /S /D /F /Y \PROGDEV\*.cur C:\PROGDEV\*.cur
xcopy /S /D /F /Y \PROGDEV\*.ico C:\PROGDEV\*.ico
xcopy /S /D /F /Y \PROGDEV\*.bmp C:\PROGDEV\*.bmp
xcopy /S /D /F /Y \PROGDEV\*.wpj C:\PROGDEV\*.wpj
REM Precaution against loss of the USB drive
xcopy /S /D /F /Y *.* C:\USBBACKUP\*.*
To be safe, rename your data directories on the slave computer(s) before doing anything else. Keep the old directories for a few weeks in case they contain a newer version of a task that you forgot. Then, insert the USB drive and run the restore batch file.
Here’s how the system works:
- When you begin work on a computer, insert the USB drive and run USBToCDrive.bat to make sure the computer is up to date. The process also makes a backup copy of the full content of the USB drive.
- When you are finished, run CDriveToUSB.bat.
It’s that simple!
Two final comments:
- It’s useful put shortcuts to the two batch files on the desktops to minimize work and to act as a reminder.
- Because the USB drives may be assigned different drive letters on different computers, the batch files must be on the USB drive and make no absolute reference to its location.
We released AMaze 3.0 this month. One of the main advances is the use of customizable configurations for the postprocessors PhiView, MagView, HWV and RFE3View. In this article, I will review how you can deal with configuration files and the advantages they offer.
Running the post-processor
To begin, existing users have nothing to worry about. As an example, consider PhiView 3.0. The first time you run the program, it loads the default configuration file phiview_dielectric.cfg (included with the package in the same directory as phiview.exe). With this configuration, the program has plotting and analysis capabilities similar to previous versions. You may never need to change things.
If you are doing conductive calculations, use the File/Load configuration file command to load phiview_conductive.cfg. The program quantities are changed to ones more suitable for conductive solutions (like current density). There are also useful new analysis functions, like surface integrals of total current emitted from an electrode. Subsequently, the conductive configuration will be loaded each time you run PhiView unless you switch back to the dielectric analysis. Note that configuration files are in text format. It is useful to take a look at them with an editor.
The only problem that could occur is that the current configuration file is lost or corrupted. If PhiView cannot find a file or detects an error, the program displays a load dialog with the option to read an alternate configuration. If you loose or modify the default configuration files, you can get replacements from our technical library (http://www.fieldp.com/library.html).
The default files are good templates if you want to create custom configurations. PhiView reports syntax errors detected on load, a useful feature for debugging your files.
Advantages and applications
There are many ways that custom configurations can make your work easier:
- You can reorder or eliminate quantities to display only those that are useful for your application.
- You can change the order and appearance of quantities in line scans and matrix files, saving time by eliminating unnecessary information.
- You can introduce scaling factors to display results in convenient units.
- You can add entirely new expressions calculated from the electromagnetic field values. The new quantities are available in all plot types and analysis operations.
Configurations also make our task easier. We can update many features of the postprocessors simply by posting new configuration files in the library. We can also make user contributions available to the general community.
This week, we released a new textbook on our site, Finite-element Methods for Electromagnetics. It joins the books Principles of Charged-particle Acceleration and Charged-particle Beams in our collection of free resources for scientists and engineers.
My interest in electronic texts started in 1999. I got a notice from Wiley-Interscience that Principles of Charged-particle Acceleration (published in 1986) was being taken out of print. This is a wrenching moment for an author, watching three years of work float into limbo. Considering that basic particle acceleration physics is a relatively timeless topic and that the publisher graciously reverted the copyright, I decided to find a new life for the book. I first tried Dover Press, but they thought the topic was too esoteric (a real head-scratcher, considering their current catalog). Then I got the idea to generate an electronic version and make it available on the web. Because my main goal was to save the book from oblivion, I decided to distribute it with no advertisements, restrictions or registrations. There were few full-length books available at the time, and many of these were crude scans. I decided to produce a compact PDF version that would approach the quality of the original text. I wrote the book in Wordstar, with a special ad-on program for Greek letters and equations (this was 1984, after all!). Although I created a custom program to ease the conversion to WordPerfect, the activity required extensive hand corrections and took several months. In the end, it was worth the effort. The PDF file preserved the original figures and pagination of the book with a length of only 10 MB. Since its release, over 20,000 copies have been downloaded. It was even mentioned on Slashdot (to the astonishment of my son).
Finite-element Methods in Electromagnetics was originally published in 1997 as Field Solutions on Computers by CRC Press (now a division of Taylor and Francis). Although the publisher wanted to keep the book in print, I received permission to distribute an electronic version through the kind efforts Ashley Gasque at Taylor and Francis. The book was originally written in WordPerfect, so it would seem that the conversion would be easy. Alas, in the intervening 12 years I fell in love with Latex. I was determined to produce a stylish book with perfectly-formatted equations. I did as much as I could with wp2latex.exe and then wrote yet another program to clear things up and number the equations. After only two months, the final product is ready.
I wrote the book when I was in the middle of developing the TriComp program suite and I was enthusiastic about learning numerical techniques and seeing how much physics could be squeezed into a set of triangles. Here’s the official description
Finite-element Methods for Electromagnetics covers a broad range of practical applications involving electric and magnetic fields. After introducing numerical methods with a thorough treatment of electrostatics, the book moves in a structured sequence to advanced topics. These include magnetostatics with non-linear materials, permanent magnet devices, RF heating, eddy current analysis, electromagnetic pulses, microwave structures, and wave scattering.The book also covers essential supporting techniques such as mesh generation, interpolation, sparse matrix inversions, and advanced plotting routines.
The book is a great companion to any of our Toolkits and our SATE educational package. You can download it at:
http://www.fieldp.com/femethods.html
I just bought a new multi-core laptop with Windows 7 and had a chance to test our software. In particular, I wanted to check the parallel-processing programs that we will release in February. Even though I tend to be skeptical, I have to admit that PC performance is going up as prices are going down. The test computer has a 17 screen, excellent sound-and-graphics support, 4 GB of memory and a state-of-the-art processor − all for less than $1000.
Compared to Vista, Windows 7 has just enough new features to irritate you. At some point, we’re going to admit that a new Windows version release has all the excitement of a BIOS update. The operating system eats somewhat less memory than Vista. With some effort to eliminate unnecessary background tasks with WinPatrol, the resting computer used 984 MB of RAM. The machine went bananas when I installed any software. Flashing screens asking me whether I really wanted to do that stacked up recursively and filled the whole task bar. Turning off all security features and deactivating the work-intensive window transparency effect seemed to calm things down.
When the computer got used to the unfamiliar environment of my office, it settled in and performed well, particularly with parallel programs. On a test run, my trusty old workstation (with dual Intel Xeon processors at 3.2 GHz) did a benchmark HiPhi solution in 365 seconds with both processors active. (The task took 443 seconds in a single-processor run.) In comparison, the new machine (1.6 GHz Intel Core i7) took only 138 seconds. The run time was reduced by a factor of 2.7! The implication is that you can do almost three times as much number crunching on a compact laptop that they’re practically giving away compared to the workstations of a few years ago.
 Task window: HiPhi on a multicore machine
|
|