Loading...
Searching...
No Matches
abaqusMeshSet.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2023 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::abaqusMeshSet
28
29Description
30 Generates sample positions from points specified in a file as Abaqus mesh
31 points.
32
33 Example usage:
34
35 \verbatim
36 sets
37 {
38 cone25 // user-specified set name
39 {
40 type abaqusMesh;
41 file "abaqusMesh.inp";
42
43 // Optional entries
44
45 // Scale, e.g. mm to m
46 scale 0.001;
47
48 // Search distance when the sample point is not located in a cell
49 maxDist 0.25;
50
51 ...
52 }
53 }
54 \endverbatim
55
56 For a dictionary specification:
57 \table
58 Property | Description | Required | Default
59 type | abaqusMesh | yes |
60 file | Path to Abaqus file | yes |
61 scale | scale input point positions | no | 1
62 maxDist | Search distance for sample points | no | 1
63 \endtable
64
65SourceFiles
66 abaqusMeshSet.C
67
68\*---------------------------------------------------------------------------*/
69
70#ifndef Foam_abaqusMeshSet_H
71#define Foam_abaqusMeshSet_H
72
73#include "sampledSet.H"
74#include "vectorList.H"
75
76// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77
78namespace Foam
79{
80
81/*---------------------------------------------------------------------------*\
82 Class abaqusMeshSet Declaration
83\*---------------------------------------------------------------------------*/
84
85class abaqusMeshSet
86:
87 public sampledSet
88{
89 // Private data
90
91 //- Scale
92 const scalar scale_;
93
94 //- Sample coordinates
95 vectorList sampleCoords_;
96
97 //- Maximum search distance-squared
98 const scalar maxDistSqr_;
99
100
101 // Private Member Functions
102
103 bool readCoord(ISstream& is, vector& coord) const;
104
105 //- Samples all points in sampleCoords.
106 void calcSamples
107 (
108 DynamicList<point>& samplingPts,
109 DynamicList<label>& samplingCells,
110 DynamicList<label>& samplingFaces,
111 DynamicList<label>& samplingSegments,
112 DynamicList<scalar>& samplingCurveDist
113 ) const;
114
115 //- Uses calcSamples to obtain samples. Copies them into *this.
116 void genSamples();
117
118
119public:
120
121 //- Runtime type information
122 TypeName("abaqusMesh");
123
124
125 // Constructors
126
127 //- Construct from dictionary
129 (
130 const word& name,
131 const polyMesh& mesh,
133 const dictionary& dict
134 );
135
136
137 //- Destructor
138 virtual ~abaqusMeshSet() = default;
139};
140
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144} // End namespace Foam
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148#endif
149
150// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
Generic input stream using a standard (STL) stream.
Definition ISstream.H:54
Generates sample positions from points specified in a file as Abaqus mesh points.
abaqusMeshSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
TypeName("abaqusMesh")
Runtime type information.
virtual ~abaqusMeshSet()=default
Destructor.
const word & name() const noexcept
The coord-set name.
Definition coordSet.H:152
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition meshSearch.H:57
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Holds list of sampling points which is filled at construction time. Various implementations of this b...
Definition sampledSet.H:82
const meshSearch & searchEngine() const noexcept
Definition sampledSet.H:378
sampledSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const coordSet::coordFormat axisType)
Construct from components.
Definition sampledSet.C:405
const polyMesh & mesh() const noexcept
Definition sampledSet.H:373
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< vector > vectorList
List of vector.
Definition vectorList.H:32
Vector< scalar > vector
Definition vector.H:57
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68