Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
8d2e5df8
Commit
8d2e5df8
authored
Apr 13, 2010
by
mattijs
Browse files
ENH: Allow pointPatchFields derived from constrained pointPatchField types.
parent
089e5939
Changes
13
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/fields/pointPatchFields/basic/basicSymmetry/basicSymmetryPointPatchField.H
View file @
8d2e5df8
...
...
@@ -36,6 +36,7 @@ SourceFiles
#define basicSymmetryPointPatchField_H
#include
"pointPatchField.H"
#include
"symmetryPointPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -120,6 +121,12 @@ public:
// Evaluation functions
//- Return the constraint type this pointPatchField implements
virtual
const
word
&
constraintType
()
const
{
return
symmetryPointPatch
::
typeName
;
}
//- Update the patch field
virtual
void
evaluate
(
...
...
src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.H
View file @
8d2e5df8
...
...
@@ -127,6 +127,14 @@ public:
// Member functions
//- Constraint handling
//- Return the constraint type this pointPatchField implements
virtual
const
word
&
constraintType
()
const
{
return
cyclicPointPatch
::
typeName
;
}
//- Cyclic coupled interface functions
//- Does the patch field perform the transfromation
...
...
src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.H
View file @
8d2e5df8
...
...
@@ -119,6 +119,17 @@ public:
)
);
}
// Member functions
//- Constraint handling
//- Return the constraint type this pointPatchField implements
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
};
...
...
src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.H
View file @
8d2e5df8
...
...
@@ -159,6 +159,15 @@ public:
}
//- Constraint handling
//- Return the constraint type this pointPatchField implements
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
// Evaluation functions
//- Evaluate the patch field
...
...
src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.H
View file @
8d2e5df8
...
...
@@ -122,6 +122,14 @@ public:
// Member functions
//- Constraint handling
//- Return the constraint type this pointPatchField implements
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
// Evaluation functions
//- Update the patch field
...
...
src/OpenFOAM/fields/pointPatchFields/pointPatchField/newPointPatchField.C
View file @
8d2e5df8
...
...
@@ -50,7 +50,7 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
(
"PointPatchField<Type>::New"
"(const word&, const pointPatch&, const Field<Type>&)"
)
<<
"Unknown patch
Typefield
type "
)
<<
"Unknown patch
FieldType
type "
<<
patchFieldType
<<
endl
<<
endl
<<
"Valid patchField types are :"
<<
endl
...
...
@@ -58,16 +58,32 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
<<
exit
(
FatalError
);
}
typename
pointPatchConstructorTable
::
iterator
patchTypeCstrIter
=
pointPatchConstructorTablePtr_
->
find
(
p
.
type
());
autoPtr
<
pointPatchField
<
Type
>
>
pfPtr
(
cstrIter
()(
p
,
iF
));
if
(
p
atchTypeCstrIter
!=
pointPatchConstructorTablePtr_
->
end
())
if
(
p
fPtr
().
constraintType
()
==
p
.
constraintType
())
{
return
autoPtr
<
pointPatchField
<
Type
>
>
(
patchTypeCstrIter
()(
p
,
iF
));
// Compatible (constraint-wise) with the patch type
return
pfPtr
;
}
else
{
return
autoPtr
<
pointPatchField
<
Type
>
>
(
cstrIter
()(
p
,
iF
));
// Use default constraint type
typename
pointPatchConstructorTable
::
iterator
patchTypeCstrIter
=
pointPatchConstructorTablePtr_
->
find
(
p
.
type
());
if
(
patchTypeCstrIter
==
pointPatchConstructorTablePtr_
->
end
())
{
FatalErrorIn
(
"PointPatchField<Type>::New"
"(const word&, const pointPatch&, const Field<Type>&)"
)
<<
"inconsistent patch and patchField types for
\n
"
<<
" patch type "
<<
p
.
type
()
<<
" and patchField type "
<<
patchFieldType
<<
exit
(
FatalError
);
}
return
patchTypeCstrIter
()(
p
,
iF
);
}
}
...
...
@@ -115,34 +131,44 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
}
}
// Construct (but not necesarily returned)
autoPtr
<
pointPatchField
<
Type
>
>
pfPtr
(
cstrIter
()(
p
,
iF
,
dict
));
if
(
!
dict
.
found
(
"patchType"
)
||
word
(
dict
.
lookup
(
"patchType"
))
!=
p
.
type
()
)
{
typename
dictionaryConstructorTable
::
iterator
patchTypeCstrIter
=
dictionaryConstructorTablePtr_
->
find
(
p
.
type
());
if
(
patchTypeCstrIter
!=
dictionaryConstructorTablePtr_
->
end
()
&&
patchTypeCstrIter
()
!=
cstrIter
()
)
if
(
pfPtr
().
constraintType
()
==
p
.
constraintType
())
{
FatalIOErrorIn
(
"PointPatchField<Type>const pointPatch&, "
"const Field<Type>&, const dictionary&)"
,
dict
)
<<
"inconsistent patch and patchField types for
\n
"
<<
" patch type "
<<
p
.
type
()
<<
" and patchField type "
<<
patchFieldType
<<
exit
(
FatalIOError
);
// Compatible (constraint-wise) with the patch type
return
pfPtr
;
}
else
{
// Use default constraint type
typename
dictionaryConstructorTable
::
iterator
patchTypeCstrIter
=
dictionaryConstructorTablePtr_
->
find
(
p
.
type
());
if
(
patchTypeCstrIter
==
pointPatchConstructorTablePtr_
->
end
())
{
FatalIOErrorIn
(
"PointPatchField<Type>const pointPatch&, "
"const Field<Type>&, const dictionary&)"
,
dict
)
<<
"inconsistent patch and patchField types for
\n
"
<<
" patch type "
<<
p
.
type
()
<<
" and patchField type "
<<
patchFieldType
<<
exit
(
FatalIOError
);
}
return
patchTypeCstrIter
()(
p
,
iF
,
dict
);
}
}
return
autoPtr
<
pointPatchField
<
Type
>
>
(
cstrIter
()(
p
,
iF
,
dict
)
)
;
return
cstrIter
()(
p
,
iF
,
dict
);
}
...
...
@@ -185,7 +211,7 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New
<<
exit
(
FatalError
);
}
return
autoPtr
<
pointPatchField
<
Type
>
>
(
cstrIter
()(
ptf
,
p
,
iF
,
pfMapper
)
)
;
return
cstrIter
()(
ptf
,
p
,
iF
,
pfMapper
);
}
...
...
src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H
View file @
8d2e5df8
...
...
@@ -337,9 +337,15 @@ public:
const
Field
<
Type1
>&
pF
)
const
;
//- Return the type of the calculated for of pointPatchField
//- Return the type of the calculated for
m
of pointPatchField
static
const
word
&
calculatedType
();
//- Return the constraint type this pointPatchField implements.
virtual
const
word
&
constraintType
()
const
{
return
word
::
null
;
}
// Mapping functions
...
...
src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclic/cyclicPointPatch.H
View file @
8d2e5df8
...
...
@@ -114,6 +114,12 @@ public:
// Access
//- Return the constraint type this pointPatch implements.
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
//- Return the underlying cyclicPolyPatch
const
cyclicPolyPatch
&
cyclicPatch
()
const
{
...
...
src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/empty/emptyPointPatch.H
View file @
8d2e5df8
...
...
@@ -73,6 +73,12 @@ public:
// Member Functions
//- Return the constraint type this pointPatch implements.
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
//- Accumulate the effect of constraint direction of this patch
virtual
void
applyConstraint
(
...
...
src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/processor/processorPointPatch.H
View file @
8d2e5df8
...
...
@@ -130,6 +130,12 @@ public:
}
}
//- Return the constraint type this pointPatch implements.
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
//- Return processor number
int
myProcNo
()
const
{
...
...
src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetry/symmetryPointPatch.H
View file @
8d2e5df8
...
...
@@ -73,6 +73,12 @@ public:
// Member Functions
//- Return the constraint type this pointPatch implements.
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
//- Accumulate the effect of constraint direction of this patch
virtual
void
applyConstraint
(
...
...
src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/wedge/wedgePointPatch.H
View file @
8d2e5df8
...
...
@@ -73,6 +73,12 @@ public:
// Member Functions
//- Return the constraint type this pointPatch implements.
virtual
const
word
&
constraintType
()
const
{
return
type
();
}
//- Accumulate the effect of constraint direction of this patch
virtual
void
applyConstraint
(
...
...
src/OpenFOAM/meshes/pointMesh/pointPatches/pointPatch/pointPatch.H
View file @
8d2e5df8
...
...
@@ -158,6 +158,12 @@ public:
//- Return point normals
virtual
const
vectorField
&
pointNormals
()
const
=
0
;
//- Return the constraint type this pointPatch implements.
virtual
const
word
&
constraintType
()
const
{
return
word
::
null
;
}
//- Accumulate the effect of constraint direction of this patch
virtual
void
applyConstraint
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment