Merge branch 'master' of develop.openfoam.com:Development/OpenFOAM-plus

This commit is contained in:
sergio
2019-04-08 09:09:46 -07:00
164 changed files with 666 additions and 54019 deletions

View File

@ -0,0 +1,71 @@
<!--
*** Please read this first! ***
Before opening a new issue, make sure to search for keywords in the issues
filtered by the "bug" label and check to see if it has already been reported
-->
<!--
All text between these markers are comments and will not be present in the
report
-->
### Summary
<!-- Summarize the bug encountered concisely -->
### Steps to reproduce
<!-- How one can reproduce the issue - this is very important -->
### Example case
<!--
If possible, please create a SMALL example and attach it to your report
If you are using an older version of OpenFOAM this will also determine
whether the bug has been fixed in a more recent version
-->
### What is the current *bug* behaviour?
<!-- What actually happens -->
### What is the expected *correct* behavior?
<!-- What you should see instead -->
### Relevant logs and/or images
<!--
Paste any relevant logs - please use code blocks (```) to format console
output, logs, and code as it's very hard to read otherwise.
-->
### Environment information
<!--
Providing details of your set-up can help us identify any issues, e.g.
OpenFOAM version : v1806|v1812|v1906 etc
Operating system : ubuntu|openSUSE|centos etc
Hardware info : any info that may help?
Compiler : gcc|intel|clang etc
-->
OpenFOAM version :
Operating system :
Compiler :
### Possible fixes
<!--
If you can, link to the line of code that might be responsible for the
problem
-->
/label ~bug

View File

@ -0,0 +1,31 @@
### Functionality to add/problem to solve
(Brief scope)
### Target audience
(Who will benefit from the changes?)
(What type of cases?)
### Proposal
(How are we going to solve the problem?)
### What does success look like, and how can we measure that?
(What are the success factors and acceptance criteria? e.g. test cases, error margins)
### Links / references
(Links to literature, supporting information)
### Funding
(Does the functionality already exist/is sponsorship available?)
/label ~feature

View File

@ -0,0 +1,20 @@
### Summary
(Summarize the changes concisely)
### Resolved bugs (If applicable)
(Links to issues)
### Details of new models (If applicable)
(New options, user inputs etc)
(Images are nice :))
### Risks
(Possible regressions?)
(Changes to user inputs?)

View File

@ -1,2 +1,2 @@
api=1812
patch=0
patch=190403

View File

@ -1,15 +1,22 @@
Info<< "Mean pressure:" << p.weightedAverage(mesh.V()).value() << endl;
Info<< "Mean temperature:" << thermo.T().weightedAverage(mesh.V()).value()
<< endl;
Info<< "Mean u':"
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< endl;
{
const scalar meanP = p.weightedAverage(mesh.V()).value();
const scalar meanT = thermo.T().weightedAverage(mesh.V()).value();
const scalar meanUp =
(sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value();
const scalar meanB = b.weightedAverage(mesh.V()).value();
logSummaryFile()
<< runTime.theta() << tab
<< p.weightedAverage(mesh.V()).value() << tab
<< thermo.T().weightedAverage(mesh.V()).value() << tab
<< (sqrt((2.0/3.0)*turbulence->k()))().weightedAverage(mesh.V()).value()
<< tab
<< 1 - b.weightedAverage(mesh.V()).value()
<< endl;
Info<< "Mean pressure:" << meanP << nl
<< "Mean temperature:" << meanT << nl
<< "Mean u':" << meanUp << endl;
if (Pstream::master())
{
logSummaryFile()
<< runTime.theta() << tab
<< meanP << tab
<< meanT << tab
<< meanUp << tab
<< 1 - meanB
<< endl;
}
}

View File

@ -0,0 +1,19 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1812 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object testDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
_FOAM_API $FOAM_API;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,3 +0,0 @@
udr_checker.c
EXE = $(FOAM_USER_APPBIN)/ensightFoamReader-udr_checker

View File

@ -1,5 +0,0 @@
EXE_INC = \
-DUSERD_API_203
EXE_LIBS = \
-luserd-foam

View File

@ -1,116 +0,0 @@
udr_checker
-----------
udr_checker.c is a routine that can be used to debug EnSight User-defined
readers. It exists because of the difficulty of debugging dynamic shared
libraries when you don't have the source for the calling program (EnSight).
If udr_checker.c is compiled and linked with your reader source code (including
access to any libraries needed, and the global_extern.h file), it will exercise
most options of you reader, giving feedback as it goes. The resulting
executable can be debugged using your favorite debugger. And if you have
memory/bounds checking software (such as purify), you can (and should) run it
with this executable to make sure that you are not overwriting things. Readers
that bash memory will cause problems when run with EnSight!
You will note that the Makefile provided with the readers in the EnSight
distribution have a "checker" object. If you do a "make checker" instead of
just a "make", the "checker"executable will be produced. You may need to
modify these makefiles slightly if the locations of your reader files are
different than the normal.
--------------------------------------
Once the "checker" executable exists, you can run the checker program by simply
invoking it:
> checker
And you will be prompted for the type of information that you provide in the
EnSight Data Reader dialog, namely:
The path
filename_1
[filename_2] Only if your reader uses two fields
swapbytes flag
<toggle flags> Only if your reader implements extra GUI
<pulldown flags> one flag value per line
<field contents> one field string per line
There are certain command line options that you can use to control some aspects
of the checker program. One of the more useful is the ability to provide the
input just described in a file. This is done in this fashion:
> checker -p <playfile>
And <playfile> would be a simple ascii file with 3 [0r 4] lines:
line 1: the path
line 2: filename_1
line 3: [filename_2] (if two_fields is TRUE)
line 3 or 4: 0 or 1, for swapbytes (0 is FALSE, 1 is TRUE)
remaining lines 0 or 1 for toggle disable enabled
one line for each toggle
0 - num_pulldown_values for pulldown choice
one line for each pulldown
strings
one line for each field
example playfile for an EnSight Gold reader casefile (entitled cube.play)
could look something like the following: (Note: two_fields is FALSE)
-------------------
/usr/local/bin/data/ens
cube.case
0
And you would invoke checker as:
> checker -p check.play
Another example playfile
with swapbytes 0,
two enabled toggles,
three pulldowns with the value 0 chosen
and a single field "sample field value"
could look something like the following::
----------------------
/mydirectory/subdir/
myfile
0
1
1
0
0
0
sample field value
Other command line arguments are:
---------------------------------
-server_number For checking server number routines. If you use this
option, you will be prompted for the total number of
servers and the current server number. These will then be
used in the calls to the server number routines.
-gts # For specifying the geometry timestep to test. The default
is step 0.
The # is the (zero based) time step to read for geometry.
-vts # For specifying the variable timestep to test. The default
is step 0.
The # is the (zero based) time step to read for variables.
Testing optional routines using #defines
-----------------------------------------
For optional routines, such as the extra_gui, or var_extract_gui routines, you
must uncomment the proper #define in udr_checker.c
Currently the ones available are:
#define _EGS for extra gui routines
#define _VES for var extract gui routines

View File

@ -1,91 +0,0 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM 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 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# ensightFoamReaderTest
#
# Description
# start ensightFoamReader-udr_checker
#
#------------------------------------------------------------------------------
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION]
options:
-case dir specify alternative case directory
* start ensightFoamReader-udr_checker
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-case)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
cd "$2" 2>/dev/null || usage "directory does not exist: '$2'"
shift 2
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# check existence of essential files
for check in system/controlDict system/fvSchemes system/fvSolution
do
[ -s "$check" ] || usage "file does not exist: '$check'"
done
# export values that might be needed
export FOAM_CASE=$PWD
export FOAM_CASENAME=${PWD##*/}
pathName=${PWD%/*}
playFile=/tmp/ensightFoamReader.$$
trap "rm -f $playFile 2>/dev/null; exit 0" EXIT TERM INT
cat << PLAY_FILE > $playFile
$pathName
$FOAM_CASENAME
0
PLAY_FILE
echo "ensightFoamReader-udr_checker -p $playFile"
ensightFoamReader-udr_checker -p $playFile
#------------------------------------------------------------------------------

View File

@ -1 +0,0 @@
../../utilities/postProcessing/graphics/ensightFoamReader/global_extern.h

View File

@ -1 +0,0 @@
../../utilities/postProcessing/graphics/ensightFoamReader/global_extern_proto.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
udr_checker-80.c

View File

@ -1,8 +1,8 @@
// Read time index from */uniform/time, but treat 0 and constant specially
// or simply increment from the '-index' option if it was supplied
label timeIndex = 0;
label timeIndex = 0;
{
if (optIndex)
{
timeIndex = indexingNumber++;
@ -37,7 +37,4 @@
continue;
}
}
Info<< nl << "Time [" << timeIndex << "] = " << runTime.timeName() << nl;
// end-of-file
}

View File

@ -94,7 +94,7 @@ if (doLagrangian)
);
Info<< " Lagrangian: "
<< runTime.relativePath(writer.output()) << nl;
<< args.relativePath(writer.output()) << nl;
writer.writeTimeValue(mesh.time().value());
writer.writeGeometry();

View File

@ -107,7 +107,7 @@ Description
);
Info<< " Surface : "
<< runTime.relativePath(writer.output()) << nl;
<< args.relativePath(writer.output()) << nl;
writer.writeTimeValue(timeValue);
@ -211,7 +211,7 @@ Description
);
Info<< " FaceZone : "
<< runTime.relativePath(writer.output()) << nl;
<< args.relativePath(writer.output()) << nl;
writer.beginFile(fz.name());

View File

@ -42,7 +42,7 @@ if (faceSetName.size())
);
Info<< " faceSet : "
<< runTime.relativePath(outputName) << nl;
<< args.relativePath(outputName) << nl;
vtk::writeFaceSet
(
@ -70,7 +70,7 @@ if (pointSetName.size())
);
Info<< " pointSet : "
<< runTime.relativePath(outputName) << nl;
<< args.relativePath(outputName) << nl;
vtk::writePointSet
(

View File

@ -113,7 +113,7 @@ Description
);
Info<< " Internal : "
<< runTime.relativePath(internalWriter->output()) << nl;
<< args.relativePath(internalWriter->output()) << nl;
internalWriter->writeTimeValue(mesh.time().value());
internalWriter->writeGeometry();
@ -163,7 +163,7 @@ Description
);
Info<< " Boundaries: "
<< runTime.relativePath(writer->output()) << nl;
<< args.relativePath(writer->output()) << nl;
writer->writeTimeValue(timeValue);
writer->writeGeometry();
@ -229,7 +229,7 @@ Description
);
Info<< " Boundary : "
<< runTime.relativePath(writer->output()) << nl;
<< args.relativePath(writer->output()) << nl;
writer->writeTimeValue(timeValue);
writer->writeGeometry();

View File

@ -575,7 +575,7 @@ int main(int argc, char *argv[])
fvMeshSubsetProxy::subsetType cellSubsetType = fvMeshSubsetProxy::NONE;
string vtkName = runTime.globalCaseName();
string vtkName = args.globalCaseName();
if (regionNames.size() == 1)
{
@ -628,7 +628,7 @@ int main(int argc, char *argv[])
// Sub-directory for output
const word vtkDirName = args.opt<word>("name", "VTK");
const fileName outputDir(runTime.globalPath()/vtkDirName);
const fileName outputDir(args.globalPath()/vtkDirName);
if (Pstream::master())
{
@ -650,7 +650,7 @@ int main(int argc, char *argv[])
if (args.found("overwrite") && isDir(regionDir))
{
Info<< "Removing old directory "
<< runTime.relativePath(regionDir)
<< args.relativePath(regionDir)
<< nl << endl;
rmDir(regionDir);
}

View File

@ -30,6 +30,7 @@ License
#include "areaFaMesh.H"
#include "faMesh.H"
#include "fvMesh.H"
#include "foamVersion.H"
#include "Time.H"
#include "patchZones.H"
#include "IOobjectList.H"
@ -314,6 +315,9 @@ Foam::vtkPVFoam::vtkPVFoam
fullCasePath = cwd();
}
// OPENFOAM API
setEnv("FOAM_API", std::to_string(foamVersion::api), true);
// The name of the executable, unless already present in the environment
setEnv("FOAM_EXECUTABLE", "paraview", false);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017-2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,6 +29,7 @@ License
// OpenFOAM includes
#include "blockMesh.H"
#include "blockMeshTools.H"
#include "foamVersion.H"
#include "Time.H"
#include "patchZones.H"
#include "StringStream.H"
@ -206,6 +207,9 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
fullCasePath = cwd();
}
// OPENFOAM API
setEnv("FOAM_API", std::to_string(foamVersion::api), true);
// The name of the executable, unless already present in the environment
setEnv("FOAM_EXECUTABLE", "paraview", false);

View File

@ -1,9 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#------------------------------------------------------------------------------
wmake $targetType
#------------------------------------------------------------------------------

View File

@ -1,3 +0,0 @@
libuserd.C
LIB = $(FOAM_LIBBIN)/libuserd-foam

View File

@ -1,14 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/browser/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
LIB_LIBS = \
-lOpenFOAM \
-lfiniteVolume \
-lmeshTools \
-lgenericPatchFields \
-llagrangian \
$(PROJECT_LIBS)

View File

@ -1,361 +0,0 @@
README_1.0_to_2.0
=================
This document exists to help those who already have a working user defined
reader (using the 1.0 API) to change it into the 2.0 API format - if desired.
Note that you do not have to update your (1.0 API) user defined reader if it
is already working fine for you.
You should consider it if:
- efficieny gains are needed or
- you need access to complex variables or
- you need access to tensor variables or
- you need multiple timeset capability or
- you want to provide your own "border" elements (as opposed to EnSight's
computation of them)
As an indication of the differences that might be realized in efficency,
consider the following comparison on an unstructured model consisting of:
1,639,058 nodes
7,079,211 elements 240530 tria3
3984 quad4
5927663 tetra4
653 pyramid5
906381 penta6
12 parts
The same model was represented in EnSight6 and EnSight Gold format.
EnSight6 format into: EnSight Gold format into:
------------------------------------ -------------------------
EnSight7.1 |Ensight7.2 |Ensight 7.1 |EnSight7.2 |Ensight7.2
internal |internal |userd reader |internal |userd reader
reader |reader |(API 1.0) |reader |(API 2.0)
| | | |
Time | Mem |Time | Mem |Time | Mem |Time | Mem |Time | Mem
(sec)| (Mb) |(sec)| (Mb) |(sec)| (Mb) |(sec)| (Mb) |(sec)| (Mb)
----------- |----------- |----------- |----------- |-----------
@ part 4.3 27.6 | 3.5 28.4 | 4.0 27.6 | 3.3 8.8 | 3.3 8.9
loader | | | |
| | | |
after 14.0 243.4 |12.8 244.3 |49.8 475.8 | 6.0 211.5 | 6.2 211.6
loading all | | | |
12 parts | | | |
(non-visual) | | | |
| | | |
after 16.8 263.2 |16.0 264.2 |52.8 490.7 | 9.1 236.2 | 9.5 236.2
activate of | | | |
a vector. | | | |
^ ^
/|\ /|\
| |
| |
| |
Compare these two!
Significant is the inefficiency of the 1.0 API, and the fact that the
2.0 API has the same improved efficiency (both in speed and memory) as
the gold internal reader!
Note: Structured data will not show much difference between the two API's,
but it was more efficient initially.
=========================================================
A note on philosophical differences between the two API's:
=========================================================
API 1.0 deals with:
-------------------
-> global coordinate array & corresponding
-> global node id array
-> global nodal variables
-> for each part:
-> local element connectivities (grouped by type) & corresponding
-> local element ids
-> local elemental variables
The element connectivities, within parts, reference the global coordinate
array. If node ids are provided, the element connectivities have to be in
terms of the node ids. If node ids are not provided, the connectivities are in
terms of the (one-based) index number of each node in the global coordinate
array. Thus, node ids are more than labels - they are a part of the
connectivity referencing scheme. Element ids are purely labels.
This API was originally setup to try to make the interface to other codes as
straightforward as possible. Efficiency was not the major consideration.
EnSight must do a fair amount of work to get data provided in the manner
described above into the form that it uses internally. There is mapping that
has to be setup and maintained between the global arrays and the local part
arrays so that updating over time can be accomplished efficiently. There is
hashing that is required in order to deal efficently with node ids.
All of this leads to a considerable amount of temporary memory and processing,
in order to get a model read into EnSight.
API 2.0 deals with:
-------------------
-> for each part:
-> part coordinates & corresponding
-> part node ids
-> part nodal variables
-> part element connectivities (grouped by type) & corresponding
-> part element ids
-> part elemental variables
API 2.0 requires that the coordinates and corresponding nodal variables be
provided per part. This eliminates the global to local mapping with all its
associated temporary memory and processing time. The connectivity of the
elements in each part reference the node indicies of its own (one-based) part
coordinate array. The connectivity of the elements do not reference the nodes
according to node ids. Node ids (and element ids for that matter) are purely
labels for screen display and for query operations within EnSight. This
eliminates the need for node id hashing as a model is read.
The 2.0 API has been created for those needing more efficiency - both in terms
of memory use and speed. The increased efficiency is possible because data is
requested in a manner which more closely represents the way that EnSight
stores and manipulates information internally. The new API requests size
information and allocates the actual internal structures and arrays
accordingly. Pointers to these arrays are passed directly to you in the
routines which gather data, thus eliminating a considerable amount of
temporary memory (and allocation time) that is needed in the old
API. Depending on what you must do to get your data into the form required,
the memory savings and the speed improvement when loading models can be quite
significant!!
Additionally, the ability to handle tensor and complex variables has been
added to the new API, and support for multiple timesets is provided.
------------------------------------------------
So, with that said, if you determine that you want to convert your existing
reader to the new API format, The following may be helpful.
====================
First the Good News! The following routines are identical in both API's!!
==================== ----------------------------------------------------
USERD_bkup
USERD_get_block_coords_by_component
USERD_get_block_iblanking
USERD_get_changing_geometry_status
USERD_get_dataset_query_file_info
USERD_get_element_label_status
USERD_get_name_of_reader
USERD_get_node_label_status
USERD_get_number_of_files_in_dataset
USERD_get_number_of_model_parts
USERD_get_number_of_variables
USERD_set_filenames
USERD_stop_part_building
========================
Second, pretty Good News! The following routines have minor changes,
======================== namely a slight name change and the addition
of arguments related to complex data, constant
(Note, the name changes type, or self contained parts vs global coords.
are needed so both
API's can exist together) The arguments must be added, but depending on
your situation, many might simply be place
holders.
-------------------------------------------------------------------------------
-----------------------------------------------------
A) Changes related to imaginary flag for complex data
=====================================================
If you don't deal with complex variables, simply add
this flag to your argument list and ignore its value.
-----------------------------------------------------
API 1.0 API 2.0
------- -------
USERD_get_constant_value USERD_get_constant_val
( (
int which var int which_var,
int imag_data
) )
USERD_get_description_lines USERD_get_descrip_lines
( (
int which_type, int which_type,
int which_var, int which_var,
int imag_data,
char line1[Z_BUFL], char line1[Z_BUFL],
char line2[Z_BUFL] char line2[Z_BUFL]
) )
USERD_get_variable_value_at_specific USERD_get_var_value_at_specific
( (
int which_var, int which_var,
int which_node_or_elem, int which_node_or_elem,
int which_part, int which_part,
int which_elem_type, int which_elem_type,
int time_step, int time_step,
float values[3] float values[3],
int imag_data
) )
---------------------------------------------------------
B) Changes related to complex data info, and constant type
(and some of the multiple timeset support)
=========================================================
If you don't deal with complex variables, simply add the
arguments for var_complex, var_ifilename, and var_freq
and assign var_complex to be FALSE.
The argument var_contran needs to be added, and set
appropriately if you have constant variables, to indicate
if the constant variable is fixed for all time or varies
over time.
The argument var_timeset needs to be added, and set
appropriately.
---------------------------------------------------------
API 1.0 API 2.0
------- -------
USERD_get_variable_info USERD_get_gold_variable_info
( (
char **var_description, char **var_description,
char **var_filename, char **var_filename,
int *var_type, int *var_type,
int *var_classify int *var_classify,
int *var_complex,
char **var_ifilename,
float *var_freq,
int *var_contran,
int *var_timeset
) )
------------------------------------------------------
C) Changes related to self contained part coordinates
======================================================
The number_of_nodes argument needs to be added and
set for each part. This one is critical for you to do.
------------------------------------------------------
API 1.0 API 2.0
------- -------
USERD_get_part_build_info USERD_get_gold_part_build_info
( (
int *part_numbers, int *part_types,
int *part_types, int *part_types,
char *part_description[Z_BUFL], char *part_description[Z_BUFL],
int *number_of_nodes,
int *number_of_elements[Z_MAXTYPE], int *number_of_elements[Z_MAXTYPE],
int *ijk_dimensions[3], int *ijk_dimensions[3],
int *iblanking_options[6] int *iblanking_options[6]
) )
------------------------------------------------------
D) Changes related to multiple timeset support
======================================================
The timeset_number argument needs to be added for the
following three routines.
The multiple timeset support also includes the change
in B) above for USERD_get_gold_variable_info and the
last three new routines in the third section of this
readme file.
------------------------------------------------------
API 1.0 API 2.0
------- -------
USERD_get_number_of_time_steps USERD_get_num_of_time_steps
( (
void int timeset_number
) )
USERD_get_solution_times USERD_get_sol_times
( (
int timeset_number,
float *solution_times float *solution_times
) )
USERD_set_time_step USERD_set_time_set_and_step
( (
int timeset_number,
int time_step int time_step
) )
------------------------------------------------------
E) Changes related to global_extern.h
======================================================
Be sure to include the updated global_extern.h file that comes
with the EnSight 7.2 release (not the one from previous releases).
=================================================================
Third, deleted and new routines. (Here is where the work lies)
Several old routines are gone. You will have to create the new
routines that replace them. I think you will find in most cases
that your old routines will form the basis of the new routines,
and that it isn't too difficult to provide the information in
the new way.
The detailed specifications for these new routines can be found
in README_USERD_2.0 (or the headers in libuserd.c of the
dummy_gold or ensight_gold readers).
=================================================================
API 1.0 API 2.0
------- -------
These routines: replaced by the single routine:
--------------------------- -------------------------------
USERD_get_block_scalar_values USERD_get_var_by_component
USERD_get_block_vector_values_by_component
USERD_get_scalar_values
USERD_get_vector_values
These global coordinate routines: replaced by part coord routines:
--------------------------------- --------------------------------
USERD_get_global_coords USERD_get_part_coords
USERD_get_global_node_ids USERD_get_part_node_ids
USERD_get_number_of_global_nodes
These part connectivity routines: replaced by part by type routines:
--------------------------------- ----------------------------------
USERD_get_element_connectivities_for_part USERD_get_part_elements_by_type
USERD_get_element_ids_for_part USERD_get_part_element_ids_by_type
These are New Routines
----------------------
(Can be a dummy) -> USERD_exit_routine
(Can be a dummy) -> USERD_get_model_extents
(Required) -> USERD_get_reader_version
multiple timeset releated:
(Required) -> USERD_get_number_timesets
(Required) -> USERD_get_timeset_description
(Required) -> USERD_get_geom_timeset_number
border provided by the reader option:
(Required) -> USERD_get_border_availability
(Can be a dummy) -> USERD_get_border_elements_by_type
transient model allocation efficency:
(Can be a dummy) -> USERD_get_maxsize_info
Possible use with Server-of-Servers:
(Can be a dummy) -> USERD_set_server_number

View File

@ -1,2 +0,0 @@
#define DO_READER
#define USERD_API_203

View File

@ -1,14 +0,0 @@
//======================================================================
// backup is not implemented
//======================================================================
int USERD_bkup
(
FILE *archive_file,
int backup_type)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_bkup" << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,11 +0,0 @@
void USERD_exit_routine
(
void
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_exit_routine" << endl
<< flush;
#endif
}

View File

@ -1,17 +0,0 @@
// Not used
int USERD_get_border_availability
(
int part_number,
int number_of_elements[Z_MAXTYPE]
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_border_availability for part_number "
<< part_number << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,19 +0,0 @@
// Not called if USERD_border_availability returns Z_ERR
int USERD_get_border_elements_by_type
(
int part_number,
int element_type,
int **conn_array,
short *parent_element_type,
int *parnet_element_type
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_border_elements_by_type" << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,10 +0,0 @@
//======================================================================
int USERD_get_changing_geometry_status(void)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_changing_geometry_status" << endl << flush;
#endif
// Choose the most general option
return Z_CHANGE_CONN;
}

View File

@ -1,15 +0,0 @@
//======================================================================
// Not in use
//======================================================================
float USERD_get_constant_val
(
int which_var,
int imag_data
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_constant_val" << endl << flush;
#endif
return 0.0;
}

View File

@ -1,8 +0,0 @@
//======================================================================
// NOT SUPPORTED... yet, if ever!
//======================================================================
int USERD_get_dataset_query_file_info(Z_QFILES *qfiles)
{
// just return OK
return Z_OK;
}

View File

@ -1,31 +0,0 @@
//======================================================================
int USERD_get_descrip_lines
(
int which_type,
int which_var,
int imag_data,
char line1[Z_BUFL],
char line2[Z_BUFL]
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_descrip_lines" << endl
<< flush;
#endif
if (which_type == Z_GEOM)
{
strncpy(line1, meshName, Z_BUFL);
strncpy(line2, "", Z_BUFL);
}
else
{
strncpy(line1, "WHERE IS THIS LINE USED I WONDER???", Z_BUFL);
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_descrip_lines" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,10 +0,0 @@
//======================================================================
// if TRUE: set in USERD_get_element_ids_for_part
//======================================================================
int USERD_get_element_label_status(void)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_element_label_status" << endl << flush;
#endif
return TRUE;
}

View File

@ -1,14 +0,0 @@
int USERD_get_geom_timeset_number
(
void
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_geom_timeset_number" << endl
<< flush;
#endif
Geom_timeset_number = 1;
return Geom_timeset_number;
}

View File

@ -1,153 +0,0 @@
//======================================================================
// this is based on the current time step.
//======================================================================
int USERD_get_gold_part_build_info
(
int *part_numbers,
int *part_types,
char *part_descriptions[Z_BUFL],
int *number_of_nodes,
int *number_of_elements[Z_MAXTYPE],
int *ijk_dimensions[3],
int *iblanking_options[6]
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_gold_part_build_info" << endl << flush;
#endif
const cellShapeList& cellShapes = meshPtr->cellShapes();
const cellList& cells = meshPtr->cells();
label nCells = cells.size();
// all parts are unstructured
for (label n = 0; n<Numparts_available; n++)
{
part_numbers[n] = n + 1;
part_types[n] = Z_UNSTRUCTURED;
}
strncpy(part_descriptions[0], meshName, Z_BUFL);
for (label i=0; i<nPatches; i++)
{
word patchName(meshPtr->boundary()[i].name());
strncpy(part_descriptions[i+1], patchName.c_str(), Z_BUFL);
}
label nHex08 = 0;
label nPen06 = 0;
label nPyr05 = 0;
label nTet04 = 0;
label nFaced = 0;
for (label n=0; n<nCells; n++)
{
label nFacesInCell = cells[n].size();
labelList points = cellShapes[n];
if ((nFacesInCell == 6) && (points.size() == 8))
{
nHex08++;
}
else if ((nFacesInCell == 4) && (points.size() == 4))
{
nTet04++;
}
else if (nFacesInCell == 5)
{
if (points.size() == 6)
{
nPen06++;
}
else if (points.size() == 5)
{
nPyr05++;
}
else
{
nFaced++;
}
}
else
{
nFaced++;
}
}
for (label n=0; n < Z_MAXTYPE; n++)
{
for (label i=0; i<Numparts_available; i++)
{
number_of_elements[i][n] = 0;
}
}
number_of_elements[0][Z_TET04] = nTet04;
number_of_elements[0][Z_PYR05] = nPyr05;
number_of_elements[0][Z_HEX08] = nHex08;
number_of_elements[0][Z_PEN06] = nPen06;
number_of_elements[0][Z_NFACED] = nFaced;
/*
Info<< "nTet04 = " << nTet04 << endl;
Info<< "nPyr05 = " << nPyr05 << endl;
Info<< "nHex08 = " << nHex08 << endl;
Info<< "nPen06 = " << nPen06 << endl;
Info<< "nFaced = " << nFaced << endl;
*/
number_of_nodes[0] = meshPtr->nPoints();
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
for (label i=0; i<nPatches; i++)
{
label nTri03 = 0;
label nQuad04 = 0;
label nPoly = 0;
forAll(bMesh[i], n)
{
label nPoints = bMesh[i][n].size();
if (nPoints == 3)
{
nTri03++;
}
else if (nPoints == 4)
{
nQuad04++;
}
else
{
nPoly++;
}
}
number_of_elements[i+1][Z_TRI03] = nTri03;
number_of_elements[i+1][Z_QUA04] = nQuad04;
number_of_elements[i+1][Z_NSIDED] = nPoly;
number_of_nodes[i+1] = bMesh[i].points().size();
}
if (Numparts_available > nPatches+1)
{
strncpy
(
part_descriptions[nPatches+1],
cloud::prefix.c_str(),
Z_BUFL
);
number_of_elements[nPatches+1][Z_POINT] = sprayPtr->size();
number_of_nodes[nPatches+1] = sprayPtr->size();
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_gold_part_build_info" << endl << flush;
#endif
return Z_OK;
}

View File

@ -1,120 +0,0 @@
//======================================================================
// variable 1 - var[0] , i.e variables are zero based
//======================================================================
int USERD_get_gold_variable_info
(
char **var_description,
char **var_filename,
int *var_type,
int *var_classify,
int *var_complex,
char **var_ifilename,
float *var_freq,
int *var_contran,
int *var_timeset
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_gold_variable_info" << endl
<< flush;
#endif
label offset = Num_variables - nSprayVariables;
// scalars first ...
for (label n=0; n<offset; n++)
{
if (isScalar[var2field[n]])
{
var_type[n] = Z_SCALAR;
var_classify[n] = Z_PER_ELEM;
var_complex[n] = FALSE;
var_timeset[n] = 1;
strncpy
(
var_description[n],
fieldNames[var2field[n]].c_str(),
Z_BUFL
);
}
}
// ... and then vectors
for (label n=0; n<offset; n++)
{
if (isVector[var2field[n]])
{
var_type[n] = Z_VECTOR;
var_classify[n] = Z_PER_ELEM;
var_complex[n] = FALSE;
var_timeset[n] = 1;
strncpy
(
var_description[n],
fieldNames[var2field[n]].c_str(),
Z_BUFL
);
}
}
// ... and tensors (NB! all tensors are treated as asymmetric)
for (label n=0; n<offset; n++)
{
if (isTensor[var2field[n]])
{
var_type[n] = Z_TENSOR9;
var_classify[n] = Z_PER_ELEM;
var_complex[n] = FALSE;
var_timeset[n] = 1;
strncpy
(
var_description[n],
fieldNames[var2field[n]].c_str(),
Z_BUFL
);
}
}
if (Numparts_available > nPatches+1)
{
label Ns = lagrangianScalarNames.size();
for (label n=0; n<Ns; n++)
{
var_type[offset + n] = Z_SCALAR;
var_classify[offset + n] = Z_PER_ELEM;
var_complex[offset + n] = FALSE;
var_timeset[offset + n] = 1;
word name = parcelPrepend + lagrangianScalarNames[n];
strncpy
(
var_description[offset + n],
name.c_str(),
Z_BUFL
);
}
forAll(lagrangianVectorNames, n)
{
var_type[offset + Ns + n] = Z_VECTOR;
var_classify[offset + Ns + n] = Z_PER_ELEM;
var_complex[offset + Ns + n] = FALSE;
var_timeset[offset + Ns + n] = 1;
word name = parcelPrepend + lagrangianVectorNames[n];
strncpy
(
var_description[offset + Ns + n],
name.c_str(),
Z_BUFL
);
}
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_gold_variable_info" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,14 +0,0 @@
int USERD_get_matf_set_info
(
int *mat_set_ids,
char **mat_set_name
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_matf_set_info" << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,15 +0,0 @@
int USERD_get_matf_var_info
(
int set_index,
int *mat_ids,
char **mat_desc
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_matf_var_info" << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,102 +0,0 @@
int USERD_get_maxsize_info
(
int *max_number_of_nodes,
int *max_number_of_elements[Z_MAXTYPE],
int *max_ijk_dimensions[3]
)
{
return Z_ERR;
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_maxsize_info" << endl;
#endif
label maxNPoints = 0;
label maxNParcels = 0;
label nPen06Max = 0;
label nHex08Max = 0;
label nPyr05Max = 0;
label nTet04Max = 0;
Info<< "Checking all time steps for EnSight memory allocation purpose. "
<< "This can take some time." << endl;
for (label timeI=1; timeI < timeDirs.size(); ++timeI)
{
label nPen06 = 0;
label nHex08 = 0;
label nPyr05 = 0;
label nTet04 = 0;
runTimePtr->setTime(timeDirs[timeI], timeI);
Info<< "Checking time = " << runTimePtr->timeName() << endl;
const cellShapeList& cells = meshPtr->cellShapes();
const label nPoints = meshPtr->nPoints();
const label nCells = cells.size();
maxNPoints = max(maxNPoints, nPoints);
for (label n=0; n<nCells;n++)
{
label nFaces = cells[n].nFaces();
const labelList& points = cells[n];
if ((nFaces == 6) && (points.size() == 8))
{
nHex08++;
}
else if ((nFaces == 5) && (points.size() == 6))
{
nPen06++;
}
else if ((nFaces == 5) && (points.size() == 5))
{
nPyr05++;
}
else if ((nFaces == 4) && (points.size() == 4))
{
nTet04++;
}
}
nPen06Max = max(nPen06Max, nPen06);
nHex08Max = max(nHex08Max, nHex08);
nPyr05Max = max(nPyr05Max, nPyr05);
nTet04Max = max(nTet04Max, nTet04);
if (Numparts_available > 1)
{
// Get the maximum number of spray parcels
// and store it
Cloud<passiveParticle> lagrangian(*meshPtr, cloud::defaultName);
if (lagrangian.size() > nMaxParcels)
{
nMaxParcels = lagrangian.size();
}
}
}
max_number_of_nodes[0] = maxNPoints;
max_number_of_elements[0][Z_HEX08] = nHex08Max;
max_number_of_elements[0][Z_PEN06] = nPen06Max;
max_number_of_elements[0][Z_PYR05] = nPyr05Max;
max_number_of_elements[0][Z_TET04] = nTet04Max;
if (Numparts_available > 1)
{
max_number_of_nodes[1] = maxNParcels;
max_number_of_elements[1][Z_POINT] = maxNParcels;
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_maxsize_info" << endl;
#endif
return Z_OK;
}

View File

@ -1,15 +0,0 @@
// Not used. Let EnSight do the job.
int USERD_get_model_extents
(
float extents[6]
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_model_extents" << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,18 +0,0 @@
//======================================================================
// Setting name in the gui, and specifying one or two input fields
//======================================================================
int USERD_get_name_of_reader
(
char reader_name[Z_MAX_USERD_NAME],
int *two_fields
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_name_of_reader" << endl << flush;
#endif
strncpy(reader_name, readerName, Z_MAX_USERD_NAME);
*two_fields = FALSE;
return Z_OK;
}

View File

@ -1,79 +0,0 @@
int USERD_get_nfaced_conn
(
int part_number,
int *nfaced_conn_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_nfaced_conn"
<< ", part_number = " << part_number
<< endl
<< flush;
#endif
if (part_number == 1)
{
label nPoint = 0;
const cellShapeList& cellShapes = meshPtr->cellShapes();
const cellList& cells = meshPtr->cells();
const faceList& faces = meshPtr->faces();
label nCells = cellShapes.size();
for (label n=0; n<nCells; n++)
{
label nFacesInCell = cells[n].size();
labelList points = cellShapes[n];
if ((nFacesInCell == 6) && (points.size() == 8))
{}
else if ((nFacesInCell == 4) && (points.size() == 4))
{}
else if (nFacesInCell == 5)
{
if (points.size() == 6)
{}
else if (points.size() == 5)
{}
else
{
for (label i=0; i<nFacesInCell; i++)
{
label facei = cells[n][i];
label nPoints = faces[facei].size();
for (label j=0; j<nPoints; j++)
{
nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
}
}
}
}
else
{
for (label i=0; i<nFacesInCell; i++)
{
label facei = cells[n][i];
label nPoints = faces[facei].size();
for (label j=0; j<nPoints; j++)
{
nfaced_conn_array[nPoint++] = faces[facei][j] + 1;
}
}
}
}
}
else if (part_number < nPatches+2)
{
}
else
{
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Exiting: USERD_get_nfaced_conn" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,74 +0,0 @@
int USERD_get_nfaced_nodes_per_face
(
int part_number,
int *nfaced_npf_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_nfaced_nodes_per_face"
<< ", part_number = " << part_number
<< endl
<< flush;
#endif
if (part_number == 1)
{
const cellShapeList& cellShapes = meshPtr->cellShapes();
const cellList& cells = meshPtr->cells();
const faceList& faces = meshPtr->faces();
label nCells = cellShapes.size();
label nFaced = 0;
for (label n=0; n<nCells; n++)
{
label nFacesInCell = cells[n].size();
labelList points = cellShapes[n];
label nPoints = points.size();
if ((nFacesInCell == 6) && (nPoints == 8))
{}
else if ((nFacesInCell == 4) && (nPoints == 4))
{}
else if (nFacesInCell == 5)
{
if (nPoints == 6)
{}
else if (nPoints == 5)
{}
else
{
for (label i=0; i<nFacesInCell; i++)
{
label facei = cells[n][i];
label nFacePoints = faces[facei].size();
nfaced_npf_array[nFaced++] = nFacePoints;
}
}
}
else
{
for (label i=0; i<nFacesInCell; i++)
{
label facei = cells[n][i];
label nFacePoints = faces[facei].size();
nfaced_npf_array[nFaced++] = nFacePoints;
}
}
}
}
else if (part_number < nPatches+2)
{
return Z_ERR;
}
else
{
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Exiting: USERD_get_nfaced_nodes_per_face" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,11 +0,0 @@
//======================================================================
// if TRUE: set in USERD_get_global_node_ids
//======================================================================
int USERD_get_node_label_status(void)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_node_label_status" << endl << flush;
#endif
return TRUE;
}

View File

@ -1,49 +0,0 @@
int USERD_get_nsided_conn
(
int part_number,
int *nsided_conn_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_nsided_conn"
<< ", part_number = " << part_number
<< endl
<< flush;
#endif
if (part_number == 1)
{
Info<< "************* EEEEEEEEERRRRRRRRRRRRRRRRRR *************** "
<< endl << flush;
}
else if (part_number < nPatches+2)
{
//const cellList& cells = meshPtr->cells();
//const faceList& faces = meshPtr->faces();
label patchi = part_number - 2;
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
label np = 0;
forAll(bMesh[patchi], facei)
{
label nPoints = bMesh[patchi][facei].size();
if ((nPoints != 3) && (nPoints != 4))
{
for (label i=0; i<nPoints; i++)
{
nsided_conn_array[np++] = bMesh[patchi][facei][i] + 1;
}
}
}
}
else if (part_number == nPatches+2)
{
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Exiting: USERD_get_nsided_conn" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,15 +0,0 @@
//======================================================================
// don't use multiple time sets...NN
//======================================================================
int USERD_get_num_of_time_steps
(
int timeset_number
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_num_of_time_steps" << endl
<< flush;
#endif
return Num_time_steps;
}

View File

@ -1,13 +0,0 @@
//======================================================================
//
//======================================================================
int USERD_get_number_of_files_in_dataset(void)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_number_of_files_in_dataset" << endl << flush;
#endif
// use 1 insted of 0 which gives an un-necessary warning.
Num_dataset_files = 1;
return Num_dataset_files;
}

View File

@ -1,14 +0,0 @@
int USERD_get_number_of_material_sets
(
void
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_number_of_material_sets" << endl
<< flush;
#endif
// No materials
return 0;
}

View File

@ -1,14 +0,0 @@
int USERD_get_number_of_materials
(
int set_index
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_number_of_materials" << endl
<< flush;
#endif
// No materials
return 0;
}

View File

@ -1,9 +0,0 @@
int USERD_get_number_of_model_parts(void)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_number_of_model_parts" << endl << flush;
#endif
return Numparts_available;
}

View File

@ -1,9 +0,0 @@
//======================================================================
int USERD_get_number_of_variables(void)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_number_of_variables" << endl << flush;
#endif
return Num_variables;
}

View File

@ -1,13 +0,0 @@
int USERD_get_number_of_timesets
(
void
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_number_of_timesets" << endl
<< flush;
#endif
Num_timesets = 1;
return Num_timesets;
}

View File

@ -1,64 +0,0 @@
// Note: coord_array is 1-based.
int USERD_get_part_coords
(
int part_number,
float **coord_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_part_coords" << endl <<
"part_number = " << part_number << endl << flush;
#endif
if (part_number == 1)
{
const vectorField& points = meshPtr->points();
label nPoints = points.size();
for (label indx=0; indx<nPoints; indx++)
{
coord_array[0][indx+1] = float(points[indx].x());
coord_array[1][indx+1] = float(points[indx].y());
coord_array[2][indx+1] = float(points[indx].z());
}
}
else if (part_number < nPatches+2)
{
label patchi = part_number-2;
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
const vectorField& points = bMesh[patchi].points();
label nPoints = points.size();
for (label indx=0; indx<nPoints; indx++)
{
coord_array[0][indx+1] = float(points[indx].x());
coord_array[1][indx+1] = float(points[indx].y());
coord_array[2][indx+1] = float(points[indx].z());
}
}
else if (part_number == nPatches+2)
{
label indx = 1;
forAllConstIter(Cloud<passiveParticle>, *sprayPtr, iter)
{
coord_array[0][indx] = float(iter().position().x());
coord_array[1][indx] = float(iter().position().y());
coord_array[2][indx] = float(iter().position().z());
indx++;
}
}
else
{
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_part_coords" << endl << flush;
#endif
return Z_OK;
}

View File

@ -1,162 +0,0 @@
int USERD_get_part_element_ids_by_type
(
int part_number,
int element_type,
int *elemid_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_part_element_ids_by_type" << endl
<< "part_number = " << part_number << endl
<< "element_type = " << element_type << endl << flush;
#endif
if (part_number == 1)
{
const cellShapeList& cellShapes = meshPtr->cellShapes();
const cellList& cells = meshPtr->cells();
label nCells = cells.size();
label nPen06 = 0;
label nHex08 = 0;
label nPyr05 = 0;
label nTet04 = 0;
label nFaced = 0;
if (element_type == Z_HEX08)
{
for (label n=0; n<nCells; n++)
{
label nFaces = cells[n].size();
labelList points = cellShapes[n];
if ((nFaces == 6) && (points.size() == 8))
{
elemid_array[nHex08++] = n + 1;
}
}
}
else if (element_type == Z_PEN06)
{
for (label n=0; n<nCells; n++)
{
label nFaces = cells[n].size();
labelList points = cellShapes[n];
if ((nFaces == 5) && (points.size() == 6))
{
elemid_array[nPen06++] = n + 1;
}
}
}
else if (element_type == Z_PYR05)
{
for (label n=0; n<nCells; n++)
{
label nFaces = cells[n].size();
labelList points = cellShapes[n];
if ((nFaces == 5) && (points.size() == 5))
{
elemid_array[nPyr05++] = n + 1;
}
}
}
else if (element_type == Z_TET04)
{
for (label n=0; n<nCells; n++)
{
label nFaces = cells[n].size();
labelList points = cellShapes[n];
if ((nFaces == 4) && (points.size() == 4))
{
elemid_array[nTet04++] = n + 1;
}
}
}
else if (element_type == Z_NFACED)
{
for (label n=0; n<nCells; n++)
{
label nFaces = cells[n].size();
labelList points = cellShapes[n];
if ((nFaces == 6) && (points.size() == 8))
{}
else if ((nFaces == 5) && (points.size() == 6))
{}
else if ((nFaces == 5) && (points.size() == 5))
{}
else if ((nFaces == 4) && (points.size() == 4))
{}
else
{
elemid_array[nFaced++] = n + 1;
}
}
}
}
else if (part_number < nPatches+2)
{
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
label patchi = part_number - 2;
label nTri03 = 0;
label nQuad04 = 0;
label nPoly = 0;
if (element_type == Z_TRI03)
{
forAll(bMesh[patchi], facei)
{
if (bMesh[patchi][facei].size() == 3)
{
elemid_array[nTri03++] = facei + 1;
}
}
}
else if (element_type == Z_QUA04)
{
forAll(bMesh[patchi], facei)
{
if (bMesh[patchi][facei].size() == 4)
{
elemid_array[nQuad04++] = facei + 1;
}
}
}
else if (element_type == Z_NSIDED)
{
forAll(bMesh[patchi], facei)
{
label nPoints = bMesh[patchi][facei].size();
if ((nPoints != 3) && (nPoints != 4))
{
elemid_array[nPoly++] = facei + 1;
}
}
}
}
else if (part_number == nPatches+2)
{
forAll(*sprayPtr, n)
{
elemid_array[n] = n + 1;
}
}
else
{
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_part_element_ids_by_type" << endl << flush;
#endif
return Z_OK;
}

View File

@ -1,252 +0,0 @@
int USERD_get_part_elements_by_type
(
int part_number,
int element_type,
int **conn_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_part_elements_by_type" << nl
<< "part_number = " << part_number << nl
<< "element_type = " << element_type;
if (element_type == Z_HEX08)
{
Info<< " Z_HEX08";
}
else if (element_type == Z_PEN06)
{
Info<< " Z_PEN06";
}
else if (element_type == Z_PYR05)
{
Info<< " Z_PYR05";
}
else if (element_type == Z_TET04)
{
Info<< " Z_TET04";
}
else if (element_type == Z_TRI03)
{
Info<< " Z_TRI03";
}
else if (element_type == Z_QUA04)
{
Info<< " Z_QUA04";
}
else if (element_type == Z_NFACED)
{
Info<< " Z_NFACED";
}
else if (element_type == Z_NSIDED)
{
Info<< " Z_NSIDED";
}
else
{
Info<< " unknown";
}
Info<< endl << flush;
#endif
if (part_number == 1)
{
const cellShapeList& cellShapes = meshPtr->cellShapes();
//================================
// hexahedron
//================================
if (element_type == Z_HEX08)
{
const cellModel& hex = cellModel::ref(cellModel::HEX);
label nHex08 = 0;
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
if (cellModel == hex)
{
forAll(cellShape, ip)
{
conn_array[nHex08][ip] = cellShape[ip] + 1;
}
nHex08++;
}
}
}
//================================
// pentahedron
//================================
else if (element_type == Z_PEN06)
{
const cellModel& prism = cellModel::ref(cellModel::PRISM);
label nPen06 = 0;
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
if (cellModel == prism)
{
forAll(cellShape, ip)
{
conn_array[nPen06][ip] = cellShape[ip] + 1;
}
nPen06++;
}
}
}
//================================
// pyramid
//================================
else if (element_type == Z_PYR05)
{
const cellModel& pyr = cellModel::ref(cellModel::PYR);
label nPyr05 = 0;
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
if (cellModel == pyr)
{
forAll(cellShape, ip)
{
conn_array[nPyr05][ip] = cellShape[ip] + 1;
}
nPyr05++;
}
}
}
//================================
// tetrahedron
//================================
else if (element_type == Z_TET04)
{
const cellModel& tet = cellModel::ref(cellModel::TET);
label nTet04 = 0;
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
if (cellModel == tet)
{
forAll(cellShape, ip)
{
conn_array[nTet04][ip] = cellShape[ip] + 1;
}
nTet04++;
}
}
}
//================================
// polyhedra
//================================
else
{
label nCells = cellShapes.size();
label nFaced = 0;
const cellList cells = meshPtr->cells();
for (label n=0; n<nCells; n++)
{
label nFacesInCell = cells[n].size();
labelList points = cellShapes[n];
if ((nFacesInCell == 6) && (points.size() == 8))
{}
else if ((nFacesInCell == 4) && (points.size() == 4))
{}
else if (nFacesInCell == 5)
{
if (points.size() == 6)
{}
else if (points.size() == 5)
{}
else
{
conn_array[nFaced++][0] = nFacesInCell;
}
}
else
{
conn_array[nFaced++][0] = nFacesInCell;
}
}
}
}
else if (part_number < nPatches+2)
{
label patchi = part_number - 2;
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
label nTri03 = 0;
label nQuad04 = 0;
if (element_type == Z_TRI03)
{
forAll(bMesh[patchi], n)
{
label nPoints = bMesh[patchi][n].size();
if (nPoints == 3)
{
for (label i=0; i<nPoints; i++)
{
label ip = bMesh[patchi][n][i];
conn_array[nTri03][i] = ip + 1;
}
nTri03++;
}
}
}
else if (element_type == Z_QUA04)
{
forAll(bMesh[patchi], n)
{
label nPoints = bMesh[patchi][n].size();
if (nPoints == 4)
{
for (label i=0; i<nPoints; i++)
{
label ip = bMesh[patchi][n][i];
conn_array[nQuad04][i] = ip + 1;
}
nQuad04++;
}
}
}
else if (element_type == Z_NSIDED)
{
label nPoly = 0;
forAll(bMesh[patchi], n)
{
label nPoints = bMesh[patchi][n].size();
if ((nPoints != 3) && (nPoints != 4))
{
conn_array[nPoly++][0] = nPoints;
}
}
}
}
else if (part_number == nPatches+2)
{
forAll(*sprayPtr, n)
{
conn_array[n][0] = n + 1;
}
}
else
{
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_part_elements_by_type" << endl;
#endif
return Z_OK;
}

View File

@ -1,56 +0,0 @@
int USERD_get_part_node_ids
(
int part_number,
int *nodeid_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_part_node_ids" << endl
<< "part_number = " << part_number << endl
<< flush;
#endif
if (part_number == 1)
{
for (label indx=0; indx<Num_global_nodes; indx++)
{
nodeid_array[indx] = indx + 1;
}
}
else if (part_number < nPatches+2)
{
label patchi = part_number-2;
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
const vectorField& points = bMesh[patchi].points();
label nPoints = points.size();
for (label indx=0; indx<nPoints; indx++)
{
nodeid_array[indx] = indx + 1;
}
}
else if (part_number == nPatches+2)
{
label indx = 0;
forAllConstIter(Cloud<passiveParticle>, *sprayPtr, iter)
{
nodeid_array[indx] = indx + 1;
indx++;
}
}
else
{
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_part_node_ids" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,27 +0,0 @@
int USERD_get_reader_release
(
char release_number[Z_MAX_USERD_NAME]
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_reader_release" << endl;
#endif
strncpy
(
release_number,
#if OPENFOAM
("OpenFOAM-" + std::to_string(OPENFOAM)).c_str(),
#else
"OpenFOAM-unknown",
#endif
Z_MAX_USERD_NAME
);
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_reader_release" << endl;
#endif
return Z_OK;
}

View File

@ -1,18 +0,0 @@
int USERD_get_reader_version
(
char version_number[Z_MAX_USERD_NAME]
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_reader_version" << endl;
#endif
strncpy(version_number, readerVersion, Z_MAX_USERD_NAME);
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_reader_version" << endl;
#endif
return Z_OK;
}

View File

@ -1,43 +0,0 @@
//======================================================================
// Negative values of the time is not allowed in EnSight.
// So for engines, where the time is CAD's we need to correct
// this so that all CAD's are positive. NN
//======================================================================
int USERD_get_sol_times
(
int timeset_number,
float *solution_times
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_sol_times\n" << timeDirs << endl;
#endif
for (label n=0; n<Num_time_steps;n++)
{
solution_times[n] = timeDirs[n+1].value();
}
if (timeDirs[1].value() < 0)
{
scalar addCAD = 360.0;
while (timeDirs[1].value() + addCAD < 0.0)
{
addCAD += 360.0;
}
for (label n=0; n<Num_time_steps;n++)
{
solution_times[n] += addCAD;
Info<< "Time[" << n << "] = " << timeDirs[n+1].value()
<< " was corrected to " << solution_times[n] << endl;
}
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_sol_times" << endl;
#endif
return Z_OK;
}

View File

@ -1,26 +0,0 @@
int USERD_get_timeset_description
(
int timeset_number,
char timeset_description[Z_BUFL]
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_timeset_description" << endl;
#endif
if (timeDirs[1].value() < 0)
{
strncpy(timeset_description, "CAD", Z_BUFL);
}
else
{
strncpy(timeset_description, "seconds", Z_BUFL);
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_timeset_description" << endl;
#endif
return Z_OK;
}

View File

@ -1,103 +0,0 @@
int USERD_get_var_by_component
(
int which_variable,
int which_part,
int var_type,
int which_type,
int imag_data,
int component,
float *var_array
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_var_by_component" << endl
<< "which_variable = " << which_variable << endl
<< "which_part = " << which_part << endl
<< "var_type = " << var_type << endl
<< "which_type = " << which_type << endl
<< "component = " << component << endl
<< flush;
#endif
label nVar = which_variable - 1;
Time& runTime = *runTimePtr;
fvMesh& mesh = *meshPtr;
const cellShapeList& cells = mesh.cellShapes();
label nCells = cells.size();
if (var_type == Z_SCALAR)
{
if (which_part == 1)
{
#include "getFieldScalar.H"
}
else if (which_part < nPatches+2)
{
#include "getPatchFieldScalar.H"
}
else if (which_part == nPatches+2)
{
#include "getLagrangianScalar.H"
}
else
{
return Z_ERR;
}
}
else if (var_type == Z_VECTOR)
{
if (which_part == 1)
{
#include "getFieldVector.H"
}
else if (which_part < nPatches+2)
{
#include "getPatchFieldVector.H"
}
else if (which_part == nPatches+2)
{
#include "getLagrangianVector.H"
}
else
{
return Z_ERR;
}
}
else if (var_type == Z_TENSOR9)
{
// all tensor are treated as asymmetric tensors here
if (which_part == 1)
{
#include "getFieldTensor.H"
}
else if (which_part < nPatches+2)
{
#include "getPatchFieldTensor.H"
}
else if (which_part == nPatches+2)
{
return Z_UNDEF;
}
else
{
return Z_ERR;
}
}
else
{
return Z_UNDEF;
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_var_by_component" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,70 +0,0 @@
//======================================================================
int USERD_get_var_value_at_specific
(
int which_var,
int which_node_or_elem,
int which_part,
int which_elem_type,
int time_step,
float values[3],
int imag_data
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_get_var_value_at_specific" << endl
<< flush;
#endif
// Not sure if it is 0 or 1 based
label nNode = which_node_or_elem;
label nVar = which_var - 1;
fvMesh& mesh = *meshPtr;
if (nVar < Num_variables - nSprayVariables)
{
Time& runTime = *runTimePtr;
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (isScalar[nVar])
{
volScalarField scalarField(fieldObject,mesh);
values[0] = scalarField[nNode];
}
else if (isVector[nVar])
{
volVectorField vectorField(fieldObject,mesh);
values[0] = vectorField[nNode].x();
values[1] = vectorField[nNode].y();
values[2] = vectorField[nNode].z();
}
else
{
Info<< "ERROR in USERD_get_variable_value_at_specific. "
<< "No available variable???"
<< endl;
return Z_ERR;
}
}
else
{
Info<< "This functionality is not implemented yet."
<< endl;
return Z_ERR;
}
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_get_var_value_at_specific" << endl
<< flush;
#endif
return Z_OK;
}

View File

@ -1,18 +0,0 @@
int USERD_load_matf_data
(
int set_index,
int part_id,
int wtyp,
int mat_type,
int *ids_list,
float *val_list
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_load_matf_data" << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,222 +0,0 @@
//======================================================================
// Setting filenames
//======================================================================
int USERD_set_filenames
(
char filename_1[],
char filename_2[],
char the_path[],
int swapbytes
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_set_filenames" << endl << flush;
#endif
char tmp[100];
label lRoot = strlen(the_path);
label lCase = strlen(filename_1);
bool cleared = false;
while (!cleared)
{
lRoot = strlen(the_path);
lCase = strlen(filename_1);
// remove the last '/' from rootDir
if (the_path[lRoot-1] == '/')
{
the_path[lRoot-1] = '\0';
}
else
{
cleared = true;
}
}
rootDir = the_path;
// the path is pre-pended to filename_1
// 1 is the 'Geometry' : 2 the 'Result' which is null here
// since two_field is FALSE
for (label i=0; i<lCase-lRoot;i++)
{
tmp[i] = filename_1[i+1+lRoot];
}
caseDir = tmp;
if (!isDir(rootDir/caseDir))
{
Info<< rootDir/caseDir << " is not a valid directory."
<< endl;
return Z_ERR;
}
// construct the global pointers to the database and mesh
delete meshPtr;
delete runTimePtr;
runTimePtr = new Time
(
Time::controlDictName,
rootDir,
caseDir
);
Time& runTime = *runTimePtr;
meshPtr = new fvMesh
(
IOobject
(
fvMesh::defaultRegion,
runTime.timeName(),
runTime
)
);
// set the available number of time-steps
timeDirs = Foam::Time::findTimes(rootDir/caseDir);
Num_time_steps = timeDirs.size() - 1;
nPatches = meshPtr->boundaryMesh().size();
// set the number of fields and store their names
// a valid field must exist for all time-steps
runTime.setTime(timeDirs.last(), timeDirs.size()-1);
IOobjectList objects(*meshPtr, runTime.timeName());
fieldNames = objects.names();
// because of the spray being a 'field' ...
// get the availabe number of variables and
// check for type (scalar/vector/tensor)
label nVar = 0;
wordList scalars = objects.names(scalarName);
forAll(fieldNames, n)
{
bool isitScalar = false;
forAll(scalars,i)
{
if (fieldNames[n] == scalars[i])
{
isitScalar = true;
var2field[nVar++] = n;
}
}
isScalar[n] = isitScalar;
}
wordList vectors = objects.names(vectorName);
forAll(fieldNames, n)
{
bool isitVector = false;
forAll(vectors,i)
{
if (fieldNames[n] == vectors[i])
{
isitVector = true;
var2field[nVar++] = n;
}
}
isVector[n] = isitVector;
}
wordList tensors = objects.names(tensorName);
forAll(fieldNames, n)
{
bool isitTensor = false;
forAll(tensors,i)
{
if (fieldNames[n] == tensors[i])
{
isitTensor = true;
var2field[nVar++] = n;
}
}
isTensor[n] = isitTensor;
}
bool lagrangianNamesFound = false;
label n = 0;
while (!lagrangianNamesFound && n < Num_time_steps)
{
runTime.setTime(timeDirs[n+1], n+1);
Cloud<passiveParticle> lagrangian(*meshPtr, cloud::defaultName);
n++;
if (lagrangian.size())
{
lagrangianNamesFound = true;
}
}
IOobject positionsHeader
(
"positions",
runTime.timeName(),
cloud::prefix,
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
);
IOobject coordinatesHeader
(
"coordinates",
runTime.timeName(),
cloud::prefix,
runTime,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
);
if
(
positionsHeader.typeHeaderOk<Cloud<passiveParticle>>(false)
|| coordinatesHeader.typeHeaderOk<Cloud<passiveParticle>>(false)
)
{
Info<< "[Found lagrangian]" << endl;
delete sprayPtr;
sprayPtr = new Cloud<passiveParticle>(*meshPtr, cloud::defaultName);
IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix);
lagrangianScalarNames = objects.names(sprayScalarFieldName);
lagrangianVectorNames = objects.names(sprayVectorFieldName);
isSpray[fieldNames.size()] = true;
nSprayVariables += lagrangianScalarNames.size();
nSprayVariables += lagrangianVectorNames.size();
Num_unstructured_parts++;
}
Current_time_step = Num_time_steps;
runTime.setTime(timeDirs[Current_time_step], Current_time_step);
Num_variables = nVar + nSprayVariables;
Numparts_available =
Num_unstructured_parts + Num_structured_parts + nPatches;
#ifdef ENSIGHTDEBUG
Info<< "Leaving: USERD_set_filenames" << endl << flush;
#endif
return Z_OK;
}

View File

@ -1,12 +0,0 @@
void USERD_set_server_number
(
int cur_serv,
int tot_serv
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_set_server_number" << endl
<< flush;
#endif
}

View File

@ -1,55 +0,0 @@
//======================================================================
void USERD_set_time_set_and_step
(
int timeset_number,
int time_step
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_set_time_set_and_step" << endl << flush;
#endif
// update the global pointers and variables
// to the current time-step
// at exit time_step < 0
if (time_step >= 0)
{
Time& runTime = *runTimePtr;
Current_time_step = time_step;
// add 1, since the first timestep is 'constant'
if (time_step == 0)
{
runTime.setTime
(
timeDirs[Current_time_step],
Current_time_step
);
}
else
{
runTime.setTime
(
timeDirs[Current_time_step + 1],
Current_time_step + 1
);
}
meshPtr->readUpdate();
if (time_step == 0)
{
runTime.setTime
(
timeDirs[Current_time_step + 1],
Current_time_step + 1
);
}
if (Numparts_available > nPatches+1)
{
delete sprayPtr;
sprayPtr = new Cloud<passiveParticle>(*meshPtr, cloud::defaultName);
}
}
}

View File

@ -1,17 +0,0 @@
int USERD_size_matf_data
(
int set_index,
int part_id,
int wtyp,
int mat_type,
int *matf_size
)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_size_matf_data" << endl
<< flush;
#endif
return Z_ERR;
}

View File

@ -1,8 +0,0 @@
// Not in use
void USERD_stop_part_building(void)
{
#ifdef ENSIGHTDEBUG
Info<< "Entering: USERD_stop_part_building" << endl << flush;
#endif
}

View File

@ -1,61 +0,0 @@
int USERD_get_block_vector_values_by_component
(
int block_number,
int which_vector,
int which_component,
float *vector_array
)
{
return(Z_OK);
}
int USERD_get_block_coords_by_component
(
int block_number,
int which_component,
float *coord_array
)
{
return(Z_OK);
}
int USERD_get_block_iblanking
(
int block_number,
int *iblank_array
)
{
return(Z_OK);
}
int USERD_get_block_scalar_values
(
int block_number,
int which_scalar,
float *scalar_array
)
{
return(Z_OK);
}
int USERD_get_ghosts_in_model_flag( void )
{
return(Z_OK);
}
int USERD_get_ghosts_in_block_flag
(
int block_number
)
{
return(Z_OK);
}
int USERD_get_block_ghost_flags
(
int block_number,
int *ghost_flags
)
{
return(Z_OK);
}

View File

@ -1,141 +0,0 @@
if (nVar >= Num_variables - nSprayVariables)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::NO_READ
);
if (!fieldObjectPtr.typeHeaderOk<volScalarField>(true))
{
return Z_UNDEF;
}
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
volScalarField scalarField
(
fieldObject,
mesh
);
const cellShapeList& cellShapes = meshPtr->cellShapes();
// hexa's
if (which_type == Z_HEX08)
{
const cellModel& hex = cellModel::ref(cellModel::HEX);
//const cellModel& wedge = cellModel::ref(cellModel::WEDGE);
label counter = 1;
for (label celli=0; celli<nCells; celli++)
{
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
if (cellModel == hex) // || (cellModel == wedge))
{
var_array[counter++] = scalarField[celli];
}
}
}
// penta's
if (which_type == Z_PEN06)
{
const cellModel& prism = cellModel::ref(cellModel::PRISM);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == prism)
{
var_array[counter++] = scalarField[n];
}
}
}
// pyramids's
if (which_type == Z_PYR05)
{
const cellModel& pyr = cellModel::ref(cellModel::PYR);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == pyr)
{
var_array[counter++] = scalarField[n];
}
}
}
// tet's
if (which_type == Z_TET04)
{
const cellModel& tet = cellModel::ref(cellModel::TET);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == tet)
{
var_array[counter++] = scalarField[n];
}
}
}
if (which_type == Z_NFACED)
{
const cellList& cells = meshPtr->cells();
label counter = 1;
for (label n=0; n<nCells; n++)
{
const labelList& points = cellShapes[n];
label nFacesInCell = cells[n].size();
if ((nFacesInCell == 6) && (points.size() == 8))
{}
else if ((nFacesInCell == 4) && (points.size() == 4))
{}
else if (nFacesInCell == 5)
{
if (points.size() == 6)
{}
else if (points.size() == 5)
{}
else
{
var_array[counter++] = scalarField[n];
}
}
else
{
var_array[counter++] = scalarField[n];
}
}
}

View File

@ -1,142 +0,0 @@
if (nVar >= Num_variables - nSprayVariables)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::NO_READ
);
if (!fieldObjectPtr.typeHeaderOk<volTensorField>(true))
{
return Z_UNDEF;
}
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
volTensorField tf
(
fieldObject,
mesh
);
const cellShapeList& cellShapes = meshPtr->cellShapes();
// hexa's
if (which_type == Z_HEX08)
{
const cellModel& hex = cellModel::ref(cellModel::HEX);
//const cellModel& wedge = cellModel::ref(cellModel::WEDGE);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == hex) // || (cellModel == wedge))
{
#include "tensorConversion.H"
}
}
}
// penta's
if (which_type == Z_PEN06)
{
const cellModel& prism = cellModel::ref(cellModel::PRISM);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == prism)
{
#include "tensorConversion.H"
}
}
}
// pyramids's
if (which_type == Z_PYR05)
{
const cellModel& pyr = cellModel::ref(cellModel::PYR);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == pyr)
{
#include "tensorConversion.H"
}
}
}
// penta's
if (which_type == Z_TET04)
{
const cellModel& tet = cellModel::ref(cellModel::TET);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == tet)
{
#include "tensorConversion.H"
}
}
}
if (which_type == Z_NFACED)
{
const cellList& cells = meshPtr->cells();
label counter = 1;
for (label n=0; n<nCells; n++)
{
const labelList& points = cellShapes[n];
label nFacesInCell = cells[n].size();
if ((nFacesInCell == 6) && (points.size() == 8))
{}
else if ((nFacesInCell == 4) && (points.size() == 4))
{}
else if (nFacesInCell == 5)
{
if (points.size() == 6)
{}
else if (points.size() == 5)
{}
else
{
#include "tensorConversion.H"
}
}
else
{
#include "tensorConversion.H"
}
}
}

View File

@ -1,141 +0,0 @@
if (nVar >= Num_variables - nSprayVariables)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::NO_READ
);
if (!fieldObjectPtr.typeHeaderOk<volVectorField>(true))
{
return Z_UNDEF;
}
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
volVectorField vectorField
(
fieldObject,
mesh
);
const cellShapeList& cellShapes = meshPtr->cellShapes();
// hexa's
if (which_type == Z_HEX08)
{
const cellModel& hex = cellModel::ref(cellModel::HEX);
//const cellModel& wedge = cellModel::ref(cellModel::WEDGE);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == hex) // || (cellModel == wedge))
{
var_array[counter++] = vectorField[n][component];
}
}
}
// penta's
if (which_type == Z_PEN06)
{
const cellModel& prism = cellModel::ref(cellModel::PRISM);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == prism)
{
var_array[counter++] = vectorField[n][component];
}
}
}
// pyramids's
if (which_type == Z_PYR05)
{
const cellModel& pyr = cellModel::ref(cellModel::PYR);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == pyr)
{
var_array[counter++] = vectorField[n][component];
}
}
}
// tet's
if (which_type == Z_TET04)
{
const cellModel& tet = cellModel::ref(cellModel::TET);
label counter = 1;
for (label n=0; n<nCells; n++)
{
const cellShape& cellShape = cellShapes[n];
const cellModel& cellModel = cellShape.model();
if (cellModel == tet)
{
var_array[counter++] = vectorField[n][component];
}
}
}
if (which_type == Z_NFACED)
{
const cellList& cells = meshPtr->cells();
label counter = 1;
for (label n=0; n<nCells; n++)
{
const labelList& points = cellShapes[n];
label nFacesInCell = cells[n].size();
if ((nFacesInCell == 6) && (points.size() == 8))
{}
else if ((nFacesInCell == 4) && (points.size() == 4))
{}
else if (nFacesInCell == 5)
{
if (points.size() == 6)
{}
else if (points.size() == 5)
{}
else
{
var_array[counter++] = vectorField[n][component];
}
}
else
{
var_array[counter++] = vectorField[n][component];
}
}
}

View File

@ -1,34 +0,0 @@
// Not sure if this is necessary anymore
nVar -= Num_variables - nSprayVariables;
if (nVar >= 0)
{
word name = lagrangianScalarNames[nVar];
IOField<scalar> s
(
IOobject
(
name,
runTime.timeName(),
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
if (s.size())
{
forAll(s, n)
{
var_array[n+1] = s[n];
}
}
}
else
{
// Info<< "getLagrangianScalar: nVar = " << nVar << endl;
return Z_UNDEF;
}

View File

@ -1,46 +0,0 @@
// Not sure if this is necessary anymore
nVar -= Num_variables - nSprayVariables + lagrangianScalarNames.size();
if (nVar >= 0)
{
word name = lagrangianVectorNames[nVar];
IOField<vector> v
(
IOobject
(
name,
runTime.timeName(),
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
if (v.size())
{
forAll(v, n)
{
if (component == 0)
{
var_array[n+1] = v[n].x();
}
else if (component == 1)
{
var_array[n+1] = v[n].y();
}
else if (component == 2)
{
var_array[n+1] = v[n].z();
}
}
}
}
else
{
// Info<< "getLagrangianVector: nVar = " << nVar << endl;
return Z_UNDEF;
}

View File

@ -1,76 +0,0 @@
label patchi = which_part - 2;
if (nVar >= Num_variables - nSprayVariables)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::NO_READ
);
if (!fieldObjectPtr.typeHeaderOk<volScalarField>(true))
{
return Z_UNDEF;
}
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
volScalarField sf
(
fieldObject,
mesh
);
const scalarField& sfb = sf.boundaryField()[patchi];
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
if (which_type == Z_TRI03)
{
label counter = 1;
forAll(sfb, facei)
{
label nPoints = bMesh[patchi][facei].size();
if (nPoints == 3)
{
var_array[counter++] = sfb[facei];
}
}
}
if (which_type == Z_QUA04)
{
label counter = 1;
forAll(sfb, facei)
{
label nPoints = bMesh[patchi][facei].size();
if (nPoints == 4)
{
var_array[counter++] = sfb[facei];
}
}
}
if (which_type == Z_NSIDED)
{
label counter = 1;
forAll(sfb, facei)
{
label nPoints = bMesh[patchi][facei].size();
if (nPoints != 3 && nPoints != 4)
{
var_array[counter++] = sfb[facei];
}
}
}

View File

@ -1,76 +0,0 @@
label patchi = which_part - 2;
if (nVar >= Num_variables - nSprayVariables)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::NO_READ
);
if (!fieldObjectPtr.typeHeaderOk<volTensorField>(true))
{
return Z_UNDEF;
}
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
volTensorField sf
(
fieldObject,
mesh
);
const tensorField& tf = sf.boundaryField()[patchi];
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
if (which_type == Z_TRI03)
{
label counter = 1;
forAll(tf, n)
{
label nPoints = bMesh[patchi][n].size();
if (nPoints == 3)
{
#include "tensorConversion.H"
}
}
}
if (which_type == Z_QUA04)
{
label counter = 1;
forAll(tf, n)
{
label nPoints = bMesh[patchi][n].size();
if (nPoints == 4)
{
#include "tensorConversion.H"
}
}
}
if (which_type == Z_NSIDED)
{
label counter = 1;
forAll(tf, n)
{
label nPoints = bMesh[patchi][n].size();
if ((nPoints != 3) && (nPoints != 4))
{
#include "tensorConversion.H"
}
}
}

View File

@ -1,76 +0,0 @@
label patchi = which_part - 2;
if (nVar >= Num_variables - nSprayVariables)
{
return Z_UNDEF;
}
IOobject fieldObjectPtr
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::NO_READ
);
if (!fieldObjectPtr.typeHeaderOk<volVectorField>(true))
{
return Z_UNDEF;
}
IOobject fieldObject
(
fieldNames[var2field[nVar]],
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
volVectorField sf
(
fieldObject,
mesh
);
const vectorField& sfb = sf.boundaryField()[patchi];
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
if (which_type == Z_TRI03)
{
label counter = 1;
forAll(sfb, facei)
{
label nPoints = bMesh[patchi][facei].size();
if (nPoints == 3)
{
var_array[counter++] = sfb[facei][component];
}
}
}
if (which_type == Z_QUA04)
{
label counter = 1;
forAll(sfb, facei)
{
label nPoints = bMesh[patchi][facei].size();
if (nPoints == 4)
{
var_array[counter++] = sfb[facei][component];
}
}
}
if (which_type == Z_NSIDED)
{
label counter = 1;
forAll(sfb, facei)
{
label nPoints = bMesh[patchi][facei].size();
if ((nPoints != 3) && (nPoints != 4))
{
var_array[counter++] = sfb[facei][component];
}
}
}

View File

@ -1,53 +0,0 @@
//======================================================================
// Global variables
const int maxNames = 1000;
// define the name to be displayed in the window.
static char readerName[] = "OpenFOAM";
static char meshName[] = "cells";
static char readerVersion[] = "2.03";
// everything is one part in OpenFOAM, except the spray
static int Num_unstructured_parts = 1;
static int Num_structured_parts = 0;
static int Numparts_available = 1;
static int nPatches = 0;
static int Num_timesets = 1;
static int Geom_timeset_number = 1;
static int Num_time_steps = 1;
static int Num_global_nodes = 0;
static int Num_variables = 0;
static int Num_dataset_files = 0;
static int Current_time_step = 0;
static label nSprayVariables = 0;
static label nMaxParcels = 0;
static bool isScalar[maxNames];
static bool isVector[maxNames];
static bool isTensor[maxNames];
static bool isSpray[maxNames];
static word scalarName = "volScalarField";
static word vectorName = "volVectorField";
static word tensorName = "volTensorField";
static word sprayScalarFieldName = "scalarField";
static word sprayVectorFieldName = "vectorField";
static word sprayTensorFieldName = "tensorField";
static word parcelPrepend = "parcel_";
static word pointPrepend = "point_";
static fileName rootDir;
static fileName caseDir;
static instantList timeDirs;
static List<word> fieldNames;
static List<word> lagrangianScalarNames;
static List<word> lagrangianVectorNames;
static label var2field[maxNames];
static Time *runTimePtr = 0;
static fvMesh *meshPtr = 0;
static Cloud<passiveParticle> *sprayPtr = 0;

View File

@ -1,412 +0,0 @@
/*--------------------------------------------------------------*/
/* Header file for EnSight External Reader DSO Library Routines */
/*--------------------------------------------------------------*/
/* *************************************************************
* Copyright 1998 Computational Engineering International, Inc.
* All Rights Reserved.
*
* Restricted Rights Legend
*
* Use, duplication, or disclosure of this
* software and its documentation by the
* Government is subject to restrictions as
* set forth in subdivision [(b)(3)(ii)] of
* the Rights in Technical Data and Computer
* Software clause at 52.227-7013.
* *************************************************************
*/
#ifndef GLOBAL_EXTERN_H
#define GLOBAL_EXTERN_H
#ifdef __cplusplus
extern "C" {
#endif
/*--------------------------------
* Set the reader version define
* (only one can be set at a time)
*--------------------------------*/
#if 0
#define USERD_API_100
#define USERD_API_200
#define USERD_API_201
#define USERD_API_202
#define USERD_API_203
#define USERD_API_204
#define USERD_API_205
#define USERD_API_206
#define USERD_API_207
#define USERD_API_208
#define USERD_API_209
#define USERD_API_210
#endif
/*---------------------------------------*/
/* True/False and Error conditions, etc. */
/*---------------------------------------*/
#define Z_ERR (-1) /*Error return value.*/
#define Z_OK (1) /*Success return value.*/
#define Z_UNDEF (2) /*Undefined return value.*/
#define Z_NOT_IMPLEMENTED (3) /*Routine not implemented*/
/*(currently only checked for */
/* get_var_value_at_specific */
/* routine)*/
#ifndef TRUE
# define TRUE (1)
# define FALSE (0)
#endif
#define Z_BUFL (80) /* Typical string length */
#define Z_COMPX (0) /* x component */
#define Z_COMPY (1) /* y component */
#define Z_COMPZ (2) /* z component */
#define Z_STATIC (0) /* static geometry */
#define Z_CHANGE_COORDS (1) /* coordinate changing only */
#define Z_CHANGE_CONN (2) /* conectivity changing */
#define Z_GEOM (0) /* Geometry type */
#define Z_VARI (1) /* Variable type */
#define Z_SAVE_ARCHIVE (0) /* Save archive */
#define Z_REST_ARCHIVE (1) /* Restore archive */
#define Z_MAX_USERD_NAME (20) /* max length of reader name */
#define Z_PER_NODE (4) /* At Nodes Variable classif. */
#define Z_PER_ELEM (1) /* At Elements Variable classif.*/
#define Z_MAX_SETS (300)
#define Z_MX_MATERIALS (60)
#define Z_MXVARIABLEDESC 20 /*Interface Variables Max Name.*/
/* Useful macros for handling IEEE floats */
#define FLT_SGN_MASK 0x80000000U
#define FLT_EXP_MASK 0x7F800000U
#define FLT_MAN_MASK 0x007FFFFFU
#define FLT_EXP_BIAS 127
#define FLT_EXP_SHIFT 23
#define FLT_IS_FINITE(v) \
(((*((unsigned int*)&(v))) & FLT_EXP_MASK) != FLT_EXP_MASK)
#define FLT_IS_NAN(v) \
((((*((unsigned int*)&(v))) & FLT_EXP_MASK) == FLT_EXP_MASK) && \
((((*((unsigned int*)&(v))) & FLT_MAN_MASK) != 0U)
#define FLT_IS_INF(v) \
((((*((unsigned int*)&(v))) & FLT_EXP_MASK) == FLT_EXP_MASK) && \
((((*((unsigned int*)&(v))) & FLT_MAN_MASK) == 0U)
#ifndef GLOBALDEFS_H
/*-----------------------------------*/
/* Unstructured coordinate structure */
/*-----------------------------------*/
typedef struct {
float xyz[3];
}CRD;
/*-----------------------------------*/
/* Unstructured double coordinate structure */
/*-----------------------------------*/
typedef struct {
double xyz[3];
}DBLCRD;
#endif
/*----------------*/
/* Variable Types */
/*----------------*/
enum z_var_type
{
Z_CONSTANT,
Z_SCALAR,
Z_VECTOR,
Z_TENSOR,
Z_TENSOR9,
MAX_Z_VAR_TYPES
};
/*-------------------
* Vector Glyph enums
*-------------------*/
enum vg_time {
VG_STATIC,
VG_TRANSIENT,
VG_UNDEF,
VG_NEAREST,
VG_INTERPOLATE
};
enum vg_type {
VG_FORCE,
VG_MOMENT
};
/*---------------
* Element Types
*---------------
* If you mess with these, you must also
* change the get_z_maxtype
* to_z_elem_type
* to_int_elem_type routines
* in userd_read.c
*----------------------------------------*/
#if (defined USERD_API_100 || defined USERD_API_200)
enum z_elem_types {
Z_POINT, /* 00: 1 node point element */
Z_BAR02, /* 01: 2 node bar */
Z_BAR03, /* 02: 3 node bar */
Z_TRI03, /* 03: 3 node triangle */
Z_TRI06, /* 04: 6 node triangle */
Z_QUA04, /* 05: 4 node quad */
Z_QUA08, /* 06: 8 node quad */
Z_TET04, /* 07: 4 node tetrahedron */
Z_TET10, /* 08: 10 node tetrahedron */
Z_PYR05, /* 09: 5 node pyramid */
Z_PYR13, /* 10: 13 node pyramid */
Z_PEN06, /* 11: 6 node pentahedron */
Z_PEN15, /* 12: 15 node pentahedron */
Z_HEX08, /* 13: 8 node hexahedron */
Z_HEX20, /* 14: 20 node hexahedron */
Z_MAXTYPE
};
#elif defined USERD_API_201
enum z_elem_types {
Z_POINT, /* 00: 1 node point element */
Z_G_POINT, /* 01: 1 node point element (ghost call) */
Z_BAR02, /* 02: 2 node bar */
Z_G_BAR02, /* 03: 2 node bar (ghost cell) */
Z_BAR03, /* 04: 3 node bar */
Z_G_BAR03, /* 05: 3 node bar (ghost cell) */
Z_TRI03, /* 06: 3 node triangle */
Z_G_TRI03, /* 07: 3 node triangle (ghost cell) */
Z_TRI06, /* 08: 6 node triangle */
Z_G_TRI06, /* 09: 6 node triangle (ghost cell) */
Z_QUA04, /* 10: 4 node quad */
Z_G_QUA04, /* 11: 4 node quad (ghost cell) */
Z_QUA08, /* 12: 8 node quad */
Z_G_QUA08, /* 13: 8 node quad (ghost cell) */
Z_TET04, /* 14: 4 node tetrahedron */
Z_G_TET04, /* 15: 4 node tetrahedron (ghost cell) */
Z_TET10, /* 16: 10 node tetrahedron */
Z_G_TET10, /* 17: 10 node tetrahedron (ghost cell) */
Z_PYR05, /* 18: 5 node pyramid */
Z_G_PYR05, /* 19: 5 node pyramid (ghost cell) */
Z_PYR13, /* 20: 13 node pyramid */
Z_G_PYR13, /* 21: 13 node pyramid (ghost cell) */
Z_PEN06, /* 22: 6 node pentahedron */
Z_G_PEN06, /* 23: 6 node pentahedron (ghost cell) */
Z_PEN15, /* 24: 15 node pentahedron */
Z_G_PEN15, /* 25: 15 node pentahedron (ghost cell) */
Z_HEX08, /* 26: 8 node hexahedron */
Z_G_HEX08, /* 27: 8 node hexahedron (ghost cell) */
Z_HEX20, /* 28: 20 node hexahedron */
Z_G_HEX20, /* 29: 20 node hexahedron (ghost cell) */
Z_MAXTYPE
};
#else
enum z_elem_types {
Z_POINT, /* 00: 1 node point element */
Z_G_POINT, /* 01: 1 node point element (ghost call) */
Z_BAR02, /* 02: 2 node bar */
Z_G_BAR02, /* 03: 2 node bar (ghost cell) */
Z_BAR03, /* 04: 3 node bar */
Z_G_BAR03, /* 05: 3 node bar (ghost cell) */
Z_TRI03, /* 06: 3 node triangle */
Z_G_TRI03, /* 07: 3 node triangle (ghost cell) */
Z_TRI06, /* 08: 6 node triangle */
Z_G_TRI06, /* 09: 6 node triangle (ghost cell) */
Z_QUA04, /* 10: 4 node quad */
Z_G_QUA04, /* 11: 4 node quad (ghost cell) */
Z_QUA08, /* 12: 8 node quad */
Z_G_QUA08, /* 13: 8 node quad (ghost cell) */
Z_TET04, /* 14: 4 node tetrahedron */
Z_G_TET04, /* 15: 4 node tetrahedron (ghost cell) */
Z_TET10, /* 16: 10 node tetrahedron */
Z_G_TET10, /* 17: 10 node tetrahedron (ghost cell) */
Z_PYR05, /* 18: 5 node pyramid */
Z_G_PYR05, /* 19: 5 node pyramid (ghost cell) */
Z_PYR13, /* 20: 13 node pyramid */
Z_G_PYR13, /* 21: 13 node pyramid (ghost cell) */
Z_PEN06, /* 22: 6 node pentahedron */
Z_G_PEN06, /* 23: 6 node pentahedron (ghost cell) */
Z_PEN15, /* 24: 15 node pentahedron */
Z_G_PEN15, /* 25: 15 node pentahedron (ghost cell) */
Z_HEX08, /* 26: 8 node hexahedron */
Z_G_HEX08, /* 27: 8 node hexahedron (ghost cell) */
Z_HEX20, /* 28: 20 node hexahedron */
Z_G_HEX20, /* 29: 20 node hexahedron (ghost cell) */
Z_NSIDED, /* 30: n node polygon */
Z_G_NSIDED, /* 31: n node polygon (ghost cell) */
Z_NFACED, /* 32: n faced polyhedron */
Z_G_NFACED, /* 33: n faced polyhedron (ghost cell) */
Z_MAXTYPE
};
#endif
enum z_node_ids_opt
{
Z_NO_NODE_IDS,
Z_ASSIGN_NODE_IDS,
Z_GIVEN_NODE_IDS
};
enum z_element_ids_opt
{
Z_NO_ELEMENT_IDS,
Z_ASSIGN_ELEMENT_IDS,
Z_GIVEN_ELEMENT_IDS
};
/*-------------------------------*/
/* Unstructured/Structured types */
/*-------------------------------*/
enum z_structured_defs
{
Z_UNSTRUCTURED, /* for unstructured part */
Z_STRUCTURED, /* for structured (non-iblanked) part */
Z_IBLANKED, /* for structured iblanked part */
Z_MAXMESHTYPES
};
/*----------------------------*/
/* Structured Iblanking types */
/*----------------------------*/
enum z_iblank_domain
{
Z_EXT, /* Exterior */
Z_INT, /* Interior */
Z_BND, /* Boundary */
Z_INTBND, /* Internal boundary/baffle */
Z_SYM, /* Symmetry surface */
Z_NO_OF_IBLANK_DOMAIN_ITEMS
};
/*-----------------------------------*/
/* Dataset Query file info Structure */
/*-----------------------------------*/
#define Z_MAXFILENP 255 /* Max file name and path.*/
#define Z_MAXTIMLEN 40 /* Max time str length */
#define Z_BUFLEN 82 /* Allocated length of the f_desc strings */
typedef struct {
char name[Z_MAXFILENP];
long sizeb;
char timemod[Z_MAXTIMLEN];
int num_d_lines;
char **f_desc;
} Z_QFILES;
/*-------------------------------------------
* Mixed Material enum
*
* (Must be comparable to material_file_index
* in mat_defs.h of EnSight server)
*--------------------------------------------*/
enum z_material_file_index
{
Z_MAT_INDEX,
Z_MIX_INDEX,
Z_MIX_VALUE,
Z_SPE_VALUE,
Z_NUM_MAT_FILES
};
/*-------------------------------------------
* Material type enum
*
* (Must be comparable to matset_via_file_type
* in mat_defs.h of EnSight server)
*--------------------------------------------*/
enum z_matset_via_file_type
{
Z_MISET_VIA_SPARSE_MIX, /* Original method prior to 07Feb07:mel*/
Z_MISET_VIA_ESCAL_VARS, /* Materials via element scalar variables*/
Z_MISET_VIA_MAX_FTYPES
};
/* ---------------------------------------
* Extra GUI size stuff
* _EGS
* This is the maximum number of
* Extra GUI items that you are
* allowed of each type.
*
* Don't change these values!
* ------------------------------------- */
#define Z_MAX_NUM_GUI_PULL_ITEMS 20 /* max num GUI pulldowns */
#define Z_LEN_GUI_PULL_STR 80 /* max length of GUI pulldown string */
#define Z_LEN_GUI_FIELD_STR 256 /* max length of field string */
#define Z_LEN_GUI_TITLE_STR 40 /* max length of title string */
/* ---------------------------------------
* Extra data function defines (for "target")
*
* Don't change these values!
* ------------------------------------- */
#define DATA_TARGET_NONE 0
#define DATA_TARGET_SERVER 1
#define DATA_TARGET_SOS 2
#define DATA_TARGET_CLIENT 3
#define DATA_TARGET_PYTHON 0x10000000
#define DATA_TARGET_CMDLANG 0x20000000
#define DATA_TARGET_UNDEF_VAL 0x40000000
#define DATA_TARGET_OTHER 0x00000000
#define DATA_TARGET_MASK 0x0000000f
/* ---------------------------------------
* Failed elemenet enums
* --------------------------------------- */
enum z_element_failure_criteria
{
Z_ELE_FAILED_NONE,
Z_ELE_FAILED_GREATER,
Z_ELE_FAILED_LESS,
Z_ELE_FAILED_EQUAL,
Z_ELE_FAILED_NOT_EQUAL,
Z_ELE_FAILED_MANY
};
enum z_element_failure_logic
{
Z_ELE_FAILED_LOGIC_NONE,
Z_ELE_FAILED_LOGIC_AND,
Z_ELE_FAILED_LOGIC_OR,
Z_ELE_FAILED_LOGIC_MANY
};
/*----------------------------------------------------------
* We include the prototype header file
*----------------------------------------------------------*/
#include "global_extern_proto.h"
/* ---------------------
* export the file pointer if windows
* because windows can't open a file in the
* server and pass the FILE * pointer properly.
* --------------------- */
#ifdef WIN32
typedef struct _USERD_globals_struct {
char arch_filename[256];
unsigned long arch_fileptr;
} _USERD_globals;
#endif
#ifdef __cplusplus
}
#endif
/*--------------------------------------------------------------------*/
#endif /*GLOBAL_EXTERN_H*/

View File

@ -1,734 +0,0 @@
/*--------------------------------------------------------------*/
/* Prototype Header file for EnSight External Reader */
/* DSO Library Routines */
/* */
/* intended to be included from global_extern.h only */
/*--------------------------------------------------------------*/
/* *************************************************************
* Copyright 1998 Computational Engineering International, Inc.
* All Rights Reserved.
*
* Restricted Rights Legend
*
* Use, duplication, or disclosure of this
* software and its documentation by the
* Government is subject to restrictions as
* set forth in subdivision [(b)(3)(ii)] of
* the Rights in Technical Data and Computer
* Software clause at 52.227-7013.
* *************************************************************
*/
#ifndef GLOBAL_EXTERN_PROTO_H
#define GLOBAL_EXTERN_PROTO_H
#include <stdio.h>
#ifdef WIN32
#define W32IMPORT __declspec( dllimport )
#define W32EXPORT __declspec( dllexport )
#else
#define W32IMPORT extern
#define W32EXPORT extern
#endif
/*----------------------
* Same in All Versions
*----------------------*/
W32EXPORT int
USERD_get_number_of_model_parts( void );
W32EXPORT int
USERD_get_block_coords_by_component(int block_number,
int which_component,
float *coord_array);
W32EXPORT int
USERD_get_block_iblanking(int block_number,
int *iblank_array);
W32EXPORT int
USERD_get_block_scalar_values(int block_number,
int which_scalar,
float *scalar_array);
W32EXPORT int
USERD_get_block_vector_values_by_component(int block_number,
int which_vector,
int which_component,
float *vector_array);
W32EXPORT int
USERD_get_name_of_reader(char reader_name[Z_MAX_USERD_NAME],
int *two_fields);
/*
* This mechanism is used to mark the fact that a given
* reader cannot be unloaded. We set this by default for
* C++ based readers as there are known issues with unloading
* a C++ DLL on certain platforms (Linux).
*/
W32EXPORT int
USERD_reader_unloadable(void);
#ifdef __cplusplus
/*
* Define a macro that defines the cpp function as part of the
* USERD_get_name_of_reader declaration
*/
#ifndef NO_AUTO_UNLOADABLE_CODE
#if defined(LINUX) || defined(SGI)
#define USERD_get_name_of_reader \
USERD_reader_unloadable(void) { return(0); } \
int USERD_get_name_of_reader
#endif
#endif
#endif
W32EXPORT int
USERD_get_reader_descrip(char descrip[Z_MAXFILENP]);
W32EXPORT int
USERD_set_filenames(char filename_1[],
char filename_2[],
char the_path[],
int swapbytes);
W32EXPORT int
USERD_get_number_of_files_in_dataset( void );
W32EXPORT int
USERD_get_dataset_query_file_info(Z_QFILES *qfiles);
W32EXPORT int
USERD_get_changing_geometry_status( void );
W32EXPORT int
USERD_get_node_label_status( void );
W32EXPORT int
USERD_get_element_label_status( void );
W32EXPORT int
USERD_get_number_of_variables( void );
W32EXPORT void
USERD_stop_part_building( void );
W32EXPORT int
USERD_bkup(FILE *archive_file,
int backup_type);
/* -----------------------------------
* Optional routine allows getting data
* from the reader to modify server/client behavior
* ------------------------------------ */
W32EXPORT int
USERD_get_extra_data(int *target,
int *nints, int *nflts, int *nchrs,
int *pints, float *pflts, char *pchrs);
/* ----------------------------
* Extra "Before" GUI stuff available for all versions of API
* Note: this API suite is entirely optional...
* --------------------------- */
W32EXPORT void USERD_get_extra_gui_numbers(
int *num_Toggles,
int *num_pulldowns,
int *num_fields
);
W32EXPORT int USERD_get_extra_gui_defaults(
char **toggle_Title, /* [num_toggles][Z_LEN_GUI_TITLE_STR] */
int *toggle_default_status, /* [num_toggles] */
char **pulldown_Title, /* [num_pulldowns][Z_LEN_GUI_TITLE_STR] */
int *pulldown_number_in_list, /* [num_pulldowns] */
int *pulldown_default_selection, /* [num_pulldowns] */
char ***pulldown_item_strings, /* [num_pulldowns][Z_MAX_NUM_GUI_PULL_ITEMS][Z_LEN_GUI_PULL_STR] */
char **field_Title, /* [num_fields][Z_LEN_GUI_TITLE_STR] */
char **field_user_string /* [num_fields][Z_LEN_GUI_FIELD_STR] */
);
W32EXPORT void USERD_set_extra_gui_data(
int *toggle, /* [num_toggle] */
int *pulldown, /* [num_pulldown] */
char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR] */
);
/* ----------------------------
* Extra "After" GUI stuff available for all versions of API
* Note: this API suite is entirely optional...
* --------------------------- */
W32EXPORT void USERD_get_var_extract_gui_numbers(
int *num_Toggles,
int *num_pulldowns,
int *num_fields
);
W32EXPORT int USERD_get_var_extract_gui_defaults(
char **toggle_Title, /* [num_toggles][Z_LEN_GUI_TITLE_STR] */
int *toggle_default_status, /* [num_toggles] */
char **pulldown_Title, /* [num_pulldowns][Z_LEN_GUI_TITLE_STR] */
int *pulldown_number_in_list, /* [num_pulldowns] */
int *pulldown_default_selection, /* [num_pulldowns] */
char ***pulldown_item_strings, /* [num_pulldowns][Z_MAX_NUM_GUI_PULL_ITEMS][Z_LEN_GUI_PULL_STR] */
char **field_Title, /* [num_fields][Z_LEN_GUI_TITLE_STR] */
char **field_user_string /* [num_fields][Z_LEN_GUI_FIELD_STR] */
);
W32EXPORT void USERD_set_var_extract_gui_data(
int *toggle, /* [num_toggle] */
int *pulldown, /* [num_pulldown] */
char **field_text /* [num_fields][Z_LEN_GUI_FIELD_STR] */ );
/* --------------------
* xy-query data routines
* -------------------- */
W32EXPORT int USERD_get_num_xy_queries(void);
W32EXPORT int USERD_get_xy_query_info(
int query_num,
char *query_name,
char *query_xtitle,
char *query_ytitle,
int *query_num_pairs);
W32EXPORT int USERD_get_xy_query_data(
int query_num,
int num_vals,
float *x_vals,
float *y_vals);
/* This routine added so the reader can know if we are at the "right" side of
* an interval - namely, interpolation between steps is being done in EnSight
* (It can be in any version of EnSight)
*----------------------------------------------------------------------------*/
W32EXPORT void
USERD_set_right_side( void );
/*---------------------------------------------
* Routines that get the geometry in buffers,
* used for Unstructured Auto Distribute
* (Optional)
*---------------------------------------------*/
W32EXPORT int
USERD_get_part_coords_in_buffers(int part_number,
float **coord_array,
int first,
int n_beg,
int n_end,
int buffer_size,
int *num_returned);
W32EXPORT int
USERD_get_part_node_ids_in_buffers(int part_number,
int *nodeid_array,
int first,
int n_beg,
int n_end,
int buffer_size,
int *num_returned);
W32EXPORT int
USERD_get_part_elements_by_type_in_buffers(int part_number,
int element_type,
int **conn_array,
int first,
int e_beg,
int e_end,
int buffer_size,
int *num_returned);
W32EXPORT int
USERD_get_part_element_ids_by_type_in_buffers(int part_number,
int element_type,
int *elemid_array,
int first,
int e_beg,
int e_end,
int buffer_size,
int *num_returned);
W32EXPORT int
USERD_get_var_by_component_in_buffers(int which_variable,
int which_part,
int var_type,
int which_type,
int imag_data,
int component,
float *var_array,
int first,
int ne_beg,
int ne_end,
int buffer_size,
int leftside,
int *num_returned);
W32EXPORT int
USERD_get_nsided_conn_in_buffers(int part_number,
int *num_nodes_per_elem_array,
int *nsided_conn_array,
int first,
int e_beg,
int e_end,
int buffer_size,
int *num_returned);
W32EXPORT int
USERD_get_nfaced_conn_in_buffers(int part_number,
int *nfaced_fpe_arrray,
int *nfaced_npf_arrray,
int *nfaced_conn_array,
int first,
int e_beg,
int e_end,
int buffer_size,
int *num_returned);
/*-----------------------
* For Version 1.000 Only
*-----------------------*/
#if defined USERD_API_100
W32EXPORT int
USERD_get_number_of_global_nodes( void );
W32EXPORT int
USERD_get_global_coords(CRD *coord_array);
W32EXPORT int
USERD_get_global_node_ids(int *nodeid_array);
W32EXPORT int
USERD_get_element_connectivities_for_part(int part_number,
int **conn_array[Z_MAXTYPE]);
W32EXPORT int
USERD_get_element_ids_for_part(int part_number,
int *elemid_array[Z_MAXTYPE]);
W32EXPORT int
USERD_get_vector_values(int which_vector,
int which_part,
int which_type,
float *vector_array);
W32EXPORT int
USERD_get_part_build_info(int *part_id,
int *part_types,
char *part_descriptions[Z_BUFL],
int *number_of_elements[Z_MAXTYPE],
int *ijk_dimensions[3],
int *iblanking_options[6]);
W32EXPORT int
USERD_get_scalar_values(int which_scalar,
int which_part,
int which_type,
float *scalar_array);
W32EXPORT int
USERD_get_variable_info(char **var_description,
char **var_filename,
int *var_type,
int *var_classify);
W32EXPORT int
USERD_get_description_lines(int which_type,
int which_var,
char line1[Z_BUFL],
char line2[Z_BUFL]);
W32EXPORT int
USERD_get_variable_value_at_specific(int which_var,
int which_node_or_elem,
int which_part,
int which_elem_type,
int time_step,
float values[3]);
W32EXPORT float
USERD_get_constant_value(int which_var);
W32EXPORT int
USERD_get_solution_times(float *solution_times);
W32EXPORT void
USERD_set_time_step(int time_step);
W32EXPORT int
USERD_get_number_of_time_steps(void);
#endif
/*----------------------
* New For Version 2.000
*----------------------*/
#if !defined USERD_API_100
W32EXPORT int
USERD_get_part_coords(int part_number,
float **coord_array);
W32EXPORT int
USERD_get_part_node_ids(int part_number,
int *nodeid_array);
W32EXPORT int
USERD_get_part_elements_by_type(int part_number,
int element_type,
int **conn_array);
W32EXPORT int
USERD_get_part_element_ids_by_type(int part_number,
int element_type,
int *elemid_array);
W32EXPORT int
USERD_get_reader_version(char version_number[Z_MAX_USERD_NAME]);
W32EXPORT int
USERD_get_reader_release(char version_number[Z_MAX_USERD_NAME]);
W32EXPORT int
USERD_get_var_by_component(int which_variable,
int which_part,
int var_type,
int which_type,
int complex,
int component,
float *var_array);
W32EXPORT int
USERD_get_maxsize_info(int *max_number_of_nodes,
int *max_number_of_elements[Z_MAXTYPE],
int *max_ijk_dimensions[3]);
W32EXPORT void
USERD_exit_routine( void );
W32EXPORT int
USERD_get_gold_variable_info(char **var_description,
char **var_filename,
int *var_type,
int *var_classify,
int *var_complex,
char **var_ifilename,
float *var_freq,
int *var_contran,
int *var_timeset);
W32EXPORT int
USERD_get_model_extents( float extents[6] );
W32EXPORT int
USERD_get_descrip_lines(int which_type,
int which_var,
int imag_data,
char line1[Z_BUFL],
char line2[Z_BUFL]);
W32EXPORT int
USERD_get_var_value_at_specific(int which_var,
int which_node_or_elem,
int which_part,
int which_elem_type,
int time_step,
float values[3],
int imag_data);
W32EXPORT float
USERD_get_constant_val(int which_var, int imag_data);
W32EXPORT int
USERD_get_geom_timeset_number(void);
W32EXPORT int
USERD_get_number_of_timesets(void);
W32EXPORT int
USERD_get_timeset_description(int timeset_number,
char timeset_description[Z_BUFL]);
W32EXPORT int
USERD_get_sol_times(int timeset_number,
float *solution_times);
W32EXPORT void
USERD_set_time_set_and_step(int timeset_number,
int time_step);
W32EXPORT int
USERD_get_num_of_time_steps(int timeset_number);
W32EXPORT int
USERD_get_border_availability(int part_number,
int number_of_elements[Z_MAXTYPE]);
W32EXPORT int
USERD_get_border_elements_by_type(int part_number,
int element_type,
int **conn_array,
short *parent_element_type,
int *parent_element_num);
W32EXPORT void
USERD_set_server_number(int serv_num,
int tot_servs);
#endif
/*----------------------
* New For Version 2.010
*----------------------*/
#if defined USERD_API_201 || defined USERD_API_202 || defined USERD_API_203 || defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
W32EXPORT int
USERD_get_ghosts_in_model_flag( void );
W32EXPORT int
USERD_get_ghosts_in_block_flag(int block_number);
W32EXPORT int
USERD_get_block_ghost_flags(int block_number,
int *ghost_flags);
#endif
/*--------------------------
* Modified at Version 2.030
*--------------------------*/
#if defined USERD_API_200 || defined USERD_API_201 || defined USERD_API_202
W32EXPORT int
USERD_get_gold_part_build_info(int *part_id,
int *part_types,
char *part_descriptions[Z_BUFL],
int *number_of_nodes,
int *number_of_elements[Z_MAXTYPE],
int *ijk_dimensions[3],
int *iblanking_options[6]);
#endif
#if defined USERD_API_203 || defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
W32EXPORT int
USERD_get_gold_part_build_info(int *part_id,
int *part_types,
char *part_descriptions[Z_BUFL],
int *number_of_nodes,
int *number_of_elements[Z_MAXTYPE],
int *ijk_dimensions[9],
int *iblanking_options[6]);
#endif
/*----------------------
* New For Version 2.030
*----------------------*/
#if defined USERD_API_203 || defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
W32EXPORT int
USERD_get_number_of_material_sets( void );
W32EXPORT int
USERD_get_matf_set_info(int *mat_set_ids,
char **mat_set_name);
W32EXPORT int
USERD_get_number_of_materials( int set_index );
W32EXPORT int
USERD_get_matf_var_info(int set_index,
int *mat_ids,
char **mat_desc);
W32EXPORT int
USERD_size_matf_data(int set_index,
int part_id,
int wtyp,
int mat_type,
int *matf_size );
W32EXPORT int
USERD_load_matf_data( int set_index,
int part_id,
int wtyp,
int mat_type,
int *ids_list,
float *val_list );
W32EXPORT int
USERD_get_nsided_conn( int part_number,
int *nsided_conn_array );
W32EXPORT int
USERD_get_nfaced_nodes_per_face( int part_number,
int *nfaced_npf_array );
W32EXPORT int
USERD_get_nfaced_conn( int part_number,
int *nfaced_conn_array );
#endif
/*----------------------
* New For Version 2.040
*----------------------*/
#if defined USERD_API_204 || defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
W32EXPORT int
USERD_get_uns_failed_params(
char *fail_var_name, /* variable name to be used in failure
must be scalar, per elem */
float *threshold_val1, /* number to compare for failure */
float *threshold_val2, /* number to compare for failure */
int *threshold_operator1, /* Z_GREATER_THAN, Z_LESS_THAN,
Z_EQUAL_TO */
int *threshold_operator2, /* Z_GREATER_THAN, Z_LESS_THAN,
Z_EQUAL_TO */
int *logic_criteria2
);
#endif
/*----------------------
** New For Version 2.050
**----------------------*/
#if defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
W32EXPORT int
USERD_get_number_of_species( int set_index );
W32EXPORT int
USERD_get_matsp_info(int set_index,
int *sp_ids,
char **sp_desc,
int *sppermatcnt,
int *sppermatlis);
W32EXPORT int
USERD_rigidbody_existence( void );
#endif
/*--------------------------------------------
* New at 2.05, but modified for Version 2.080
*-------------------------------------------- */
#if defined USERD_API_205 || defined USERD_API_206 || defined USERD_API_207
W32EXPORT int
USERD_rigidbody_values(int part_number,
float values[10]);
#endif
#if defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
W32EXPORT int
USERD_rigidbody_values(int part_number,
float values[14]);
#endif
/*----------------------
** New For Version 2.060
**----------------------*/
#if defined USERD_API_206 || defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
W32EXPORT int
USERD_get_structured_reader_cinching( void );
W32EXPORT int
USERD_set_block_range_and_stride(int file_pn,
int mini, int maxi, int stepi,
int minj, int maxj, int stepj,
int mink, int maxk, int stepk);
#endif
/*----------------------
** New For Version 2.070
**----------------------*/
#if defined USERD_API_207 || defined USERD_API_208 || defined USERD_API_209 || defined USERD_API_210
/* non-optional functions go here */
#endif
/* This is optional; defaults to 'Set file' and 'Set results' if not
* defined. If 'two_fields' is true, then both labels must have a
* non-NULL string otherwise the defaults will be used.
*/
W32EXPORT void
USERD_set_filename_button_labels(char filename_label_1[Z_MAX_USERD_NAME],
char filename_label_2[Z_MAX_USERD_NAME]);
/* This is optional; defaults to TRUE if not defined. */
W32EXPORT int
USERD_prefer_auto_distribute(void);
/*----------------------
** New For Version 2.090
**----------------------*/
#if defined USERD_API_209 || defined USERD_API_210
/* non-optional functions go here */
#endif
/* These are optional */
W32EXPORT int
USERD_get_vglyph_counts(int *num_vglyph_vectors,
int *num_vglyph_timelines);
W32EXPORT int
USERD_get_vglyph_timeline_info(int vtl,
int *id,
int *numtimes,
int *before,
int *amidst,
int *after);
W32EXPORT int
USERD_get_vglyph_timeline_times(int vtl,
float *times);
W32EXPORT int
USERD_get_vglyph_vector_info(int vg,
int *id,
char *description,
int *type,
int *time_condition,
int *time_line,
int *part,
int *nidloc,
int *eidloc);
W32EXPORT int
USERD_get_vglyph_vector_values(int vg,
float **values);
W32EXPORT int
USERD_get_vglyph_vector_xyzloc(int vg,
float **xyzloc);
/*----------------------
** New For Version 2.100
**----------------------*/
#if defined USERD_API_210
W32EXPORT int
USERD_get_mat_scalars_desc(int set_index,
char **mesv_desc);
#endif
/* These are optional */
W32EXPORT int
USERD_get_matf_set_type(int set_index);
/* special, optional functions */
W32EXPORT void
USERD_reset_routine(void);
/*--------------------------------------------------------------------*/
#endif /*GLOBAL_EXTERN_PROTO_H*/

View File

@ -1,142 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM 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 3 of the License, or
(at your option) any later version.
OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
libuserd-foam
Description
EnSight library module to read OpenFOAM data directly without translation
It can currently handle most cell types.
See also: README_USERD_2.0
24 Sep 2001: NN - Added support for Ensight API 2.0
02 Sep 2002: NN - Added support for ghost cells
14 Mar 2004: NN - Added patches to the parts
\*---------------------------------------------------------------------------*/
#include <cstdio>
#include "fvCFD.H"
#include "IOobjectList.H"
#include "Cloud.H"
#include "passiveParticle.H"
#include "fvMesh.H"
#include "cellModel.H"
#include "globalFoam.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
extern "C"
{
#include "USERD_API.H"
#include "global_extern.h"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// same API as in 1.0
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "USERD_bkup.H"
#include "USERD_get_name_of_reader.H"
#include "USERD_set_filenames.H"
#include "USERD_get_number_of_model_parts.H"
#include "USERD_get_changing_geometry_status.H"
#include "USERD_get_dataset_query_file_info.H"
#include "USERD_get_element_label_status.H"
#include "USERD_get_node_label_status.H"
#include "USERD_get_number_of_files_in_dataset.H"
#include "USERD_get_number_of_variables.H"
#include "USERD_stop_part_building.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// slightly changed with 2.0 from 1.0
// (to handle complex variables - not used by OpenFOAM anyway)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "USERD_get_constant_val.H"
#include "USERD_get_descrip_lines.H"
#include "USERD_get_var_value_at_specific.H"
#include "USERD_get_gold_variable_info.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// critical changes with 2.0 from 1.0
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "USERD_get_gold_part_build_info.H"
#include "USERD_get_num_of_time_steps.H"
#include "USERD_get_sol_times.H"
#include "USERD_set_time_set_and_step.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// new additions with 2.0 from 1.0
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "USERD_get_var_by_component.H"
#include "USERD_get_part_coords.H"
#include "USERD_get_part_node_ids.H"
#include "USERD_get_part_elements_by_type.H"
#include "USERD_get_part_element_ids_by_type.H"
#include "USERD_exit_routine.H"
#include "USERD_get_model_extents.H"
#include "USERD_get_reader_version.H"
#include "USERD_get_reader_release.H"
#include "USERD_get_number_timesets.H"
#include "USERD_get_timeset_description.H"
#include "USERD_get_geom_timeset_number.H"
#include "USERD_get_border_availability.H"
#include "USERD_get_border_elements_by_type.H"
#include "USERD_get_maxsize_info.H"
#include "USERD_set_server_number.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// new additions with 2.03 from 2.02
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "USERD_get_number_of_material_sets.H"
#include "USERD_get_matf_set_info.H"
#include "USERD_get_number_of_materials.H"
#include "USERD_get_matf_var_info.H"
#include "USERD_size_matf_data.H"
#include "USERD_load_matf_data.H"
#include "USERD_get_nsided_conn.H"
#include "USERD_get_nfaced_nodes_per_face.H"
#include "USERD_get_nfaced_conn.H"
//**********************************************************************
//======================================================================
// STRUCTURED DATA STUFF - not used in OpenFOAM
//======================================================================
//**********************************************************************
#include "USERD_structured_data.H"
}
// ************************************************************************ //

View File

@ -1,36 +0,0 @@
if (component == 0)
{
var_array[counter++] = tf[n].xx();
}
else if (component == 1)
{
var_array[counter++] = tf[n].yy();
}
else if (component == 2)
{
var_array[counter++] = tf[n].zz();
}
else if (component == 3)
{
var_array[counter++] = tf[n].xy();
}
else if (component == 4)
{
var_array[counter++] = tf[n].xz();
}
else if (component == 5)
{
var_array[counter++] = tf[n].yz();
}
else if (component == 6)
{
var_array[counter++] = tf[n].yx();
}
else if (component == 7)
{
var_array[counter++] = tf[n].zx();
}
else if (component == 8)
{
var_array[counter++] = tf[n].zy();
}

View File

@ -29,7 +29,7 @@
# Extract data for each time-step from a log file for graphing.
#
# Environment
# WM_PROJECT_API
# FOAM_API
# WM_PROJECT_DIR
# WM_PROJECT_SITE
#
@ -90,9 +90,9 @@ cat <<HELP
The database ($Script.db) will taken from these locations:
.
$userDir/$WM_PROJECT_API/
$userDir/$FOAM_API/
$userDir/
$groupDir/$WM_PROJECT_API/etc/
$groupDir/$FOAM_API/etc/
$groupDir/etc/
$WM_PROJECT_DIR/etc/
$toolsDir

Some files were not shown because too many files have changed in this diff Show More