initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / finiteVolume / fields / fvPatchFields / basic / generic / genericFvPatchField.C
blob058021f612c4f03552630e23a0d76ec04059c2b8
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "genericFvPatchField.H"
28 #include "fvPatchFieldMapper.H"
30 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
32 template<class Type>
33 Foam::genericFvPatchField<Type>::genericFvPatchField
35     const fvPatch& p,
36     const DimensionedField<Type, volMesh>& iF
39     calculatedFvPatchField<Type>(p, iF)
41     FatalErrorIn
42     (
43         "genericFvPatchField<Type>::genericFvPatchField"
44         "(const fvPatch& p, const DimensionedField<Type, volMesh>& iF)"
45     )   << "Not Implemented\n    "
46         << "Trying to construct an genericFvPatchField on patch "
47         << this->patch().name()
48         << " of field " << this->dimensionedInternalField().name()
49         << abort(FatalError);
53 template<class Type>
54 Foam::genericFvPatchField<Type>::genericFvPatchField
56     const fvPatch& p,
57     const DimensionedField<Type, volMesh>& iF,
58     const dictionary& dict
61     calculatedFvPatchField<Type>(p, iF, dict, false),
62     actualTypeName_(dict.lookup("type")),
63     dict_(dict)
65     if (!dict.found("value"))
66     {
67         FatalIOErrorIn
68         (
69             "genericFvPatchField<Type>::genericFvPatchField"
70             "(const fvPatch&, const Field<Type>&, const dictionary&)",
71             dict
72         )   << "\n    Cannot find 'value' entry"
73             << " on patch " << this->patch().name()
74             << " of field " << this->dimensionedInternalField().name()
75             << " in file " << this->dimensionedInternalField().objectPath()
76             << nl
77             << "    which is required to set the"
78                " values of the generic patch field." << nl
79             << "    (Actual type " << actualTypeName_ << ")" << nl
80             << "\n    Please add the 'value' entry to the write function "
81                "of the user-defined boundary-condition\n"
82                "    or link the boundary-condition into libfoamUtil.so"
83             << exit(FatalIOError);
84     }
86     for
87     (
88         dictionary::const_iterator iter = dict_.begin();
89         iter != dict_.end();
90         ++iter
91     )
92     {
93         if (iter().keyword() != "type" && iter().keyword() != "value")
94         {
95             if
96             (
97                 iter().isStream()
98              && iter().stream().size()
99             )
100             {
101                 ITstream& is = iter().stream();
103                 // Read first token
104                 token firstToken(is);
106                 if
107                 (
108                     firstToken.isWord()
109                  && firstToken.wordToken() == "nonuniform"
110                 )
111                 {
112                     token fieldToken(is);
114                     if (!fieldToken.isCompound())
115                     {
116                         if
117                         (
118                             fieldToken.isLabel()
119                          && fieldToken.labelToken() == 0
120                         )
121                         {
122                             scalarFields_.insert
123                             (
124                                 iter().keyword(),
125                                 new scalarField(0)
126                             );
127                         }
128                         else
129                         {
130                             FatalIOErrorIn
131                             (
132                                 "genericFvPatchField<Type>::genericFvPatchField"
133                                 "(const fvPatch&, const Field<Type>&, "
134                                 "const dictionary&)",
135                                 dict
136                             )   << "\n    token following 'nonuniform' "
137                                   "is not a compound"
138                                 << "\n    on patch " << this->patch().name()
139                                 << " of field "
140                                 << this->dimensionedInternalField().name()
141                                 << " in file "
142                                 << this->dimensionedInternalField().objectPath()
143                             << exit(FatalIOError);
144                         }
145                     }
146                     else if
147                     (
148                         fieldToken.compoundToken().type()
149                      == token::Compound<List<scalar> >::typeName
150                     )
151                     {
152                         scalarField* fPtr = new scalarField;
153                         fPtr->transfer
154                         (
155                             dynamicCast<token::Compound<List<scalar> > >
156                             (
157                                 fieldToken.transferCompoundToken()
158                             )
159                         );
161                         if (fPtr->size() != this->size())
162                         {
163                             FatalIOErrorIn
164                             (
165                                 "genericFvPatchField<Type>::genericFvPatchField"
166                                 "(const fvPatch&, const Field<Type>&, "
167                                 "const dictionary&)",
168                                 dict
169                             )   << "\n    size of field " << iter().keyword()
170                                 << " (" << fPtr->size() << ')'
171                                 << " is not the same size as the patch ("
172                                 << this->size() << ')'
173                                 << "\n    on patch " << this->patch().name()
174                                 << " of field "
175                                 << this->dimensionedInternalField().name()
176                                 << " in file "
177                                 << this->dimensionedInternalField().objectPath()
178                                 << exit(FatalIOError);
179                         }
181                         scalarFields_.insert(iter().keyword(), fPtr);
182                     }
183                     else if
184                     (
185                         fieldToken.compoundToken().type()
186                      == token::Compound<List<vector> >::typeName
187                     )
188                     {
189                         vectorField* fPtr = new vectorField;
190                         fPtr->transfer
191                         (
192                             dynamicCast<token::Compound<List<vector> > >
193                             (
194                                 fieldToken.transferCompoundToken()
195                             )
196                         );
198                         if (fPtr->size() != this->size())
199                         {
200                             FatalIOErrorIn
201                             (
202                                 "genericFvPatchField<Type>::genericFvPatchField"
203                                 "(const fvPatch&, const Field<Type>&, "
204                                 "const dictionary&)",
205                                 dict
206                             )   << "\n    size of field " << iter().keyword()
207                                 << " (" << fPtr->size() << ')'
208                                 << " is not the same size as the patch ("
209                                 << this->size() << ')'
210                                 << "\n    on patch " << this->patch().name()
211                                 << " of field "
212                                 << this->dimensionedInternalField().name()
213                                 << " in file "
214                                 << this->dimensionedInternalField().objectPath()
215                                 << exit(FatalIOError);
216                         }
218                         vectorFields_.insert(iter().keyword(), fPtr);
219                     }
220                     else if
221                     (
222                         fieldToken.compoundToken().type()
223                      == token::Compound<List<sphericalTensor> >::typeName
224                     )
225                     {
226                         sphericalTensorField* fPtr = new sphericalTensorField;
227                         fPtr->transfer
228                         (
229                             dynamicCast
230                             <
231                                 token::Compound<List<sphericalTensor> >
232                             >
233                             (
234                                 fieldToken.transferCompoundToken()
235                             )
236                         );
238                         if (fPtr->size() != this->size())
239                         {
240                             FatalIOErrorIn
241                             (
242                                 "genericFvPatchField<Type>::genericFvPatchField"
243                                 "(const fvPatch&, const Field<Type>&, "
244                                 "const dictionary&)",
245                                 dict
246                             )   << "\n    size of field " << iter().keyword()
247                                 << " (" << fPtr->size() << ')'
248                                 << " is not the same size as the patch ("
249                                 << this->size() << ')'
250                                 << "\n    on patch " << this->patch().name()
251                                 << " of field "
252                                 << this->dimensionedInternalField().name()
253                                 << " in file "
254                                 << this->dimensionedInternalField().objectPath()
255                                 << exit(FatalIOError);
256                         }
258                         sphericalTensorFields_.insert(iter().keyword(), fPtr);
259                     }
260                     else if
261                     (
262                         fieldToken.compoundToken().type()
263                      == token::Compound<List<symmTensor> >::typeName
264                     )
265                     {
266                         symmTensorField* fPtr = new symmTensorField;
267                         fPtr->transfer
268                         (
269                             dynamicCast
270                             <
271                                 token::Compound<List<symmTensor> >
272                             >
273                             (
274                                 fieldToken.transferCompoundToken()
275                             )
276                         );
278                         if (fPtr->size() != this->size())
279                         {
280                             FatalIOErrorIn
281                             (
282                                 "genericFvPatchField<Type>::genericFvPatchField"
283                                 "(const fvPatch&, const Field<Type>&, "
284                                 "const dictionary&)",
285                                 dict
286                             )   << "\n    size of field " << iter().keyword()
287                                 << " (" << fPtr->size() << ')'
288                                 << " is not the same size as the patch ("
289                                 << this->size() << ')'
290                                 << "\n    on patch " << this->patch().name()
291                                 << " of field "
292                                 << this->dimensionedInternalField().name()
293                                 << " in file "
294                                 << this->dimensionedInternalField().objectPath()
295                                 << exit(FatalIOError);
296                         }
298                         symmTensorFields_.insert(iter().keyword(), fPtr);
299                     }
300                     else if
301                     (
302                         fieldToken.compoundToken().type()
303                      == token::Compound<List<tensor> >::typeName
304                     )
305                     {
306                         tensorField* fPtr = new tensorField;
307                         fPtr->transfer
308                         (
309                             dynamicCast<token::Compound<List<tensor> > >
310                             (
311                                 fieldToken.transferCompoundToken()
312                             )
313                         );
315                         if (fPtr->size() != this->size())
316                         {
317                             FatalIOErrorIn
318                             (
319                                 "genericFvPatchField<Type>::genericFvPatchField"
320                                 "(const fvPatch&, const Field<Type>&, "
321                                 "const dictionary&)",
322                                 dict
323                             )   << "\n    size of field " << iter().keyword()
324                                 << " (" << fPtr->size() << ')'
325                                 << " is not the same size as the patch ("
326                                 << this->size() << ')'
327                                 << "\n    on patch " << this->patch().name()
328                                 << " of field "
329                                 << this->dimensionedInternalField().name()
330                                 << " in file "
331                                 << this->dimensionedInternalField().objectPath()
332                                 << exit(FatalIOError);
333                         }
335                         tensorFields_.insert(iter().keyword(), fPtr);
336                     }
337                     else
338                     {
339                         FatalIOErrorIn
340                         (
341                             "genericFvPatchField<Type>::genericFvPatchField"
342                             "(const fvPatch&, const Field<Type>&, "
343                             "const dictionary&)",
344                             dict
345                         )   << "\n    compound " << fieldToken.compoundToken()
346                             << " not supported"
347                             << "\n    on patch " << this->patch().name()
348                             << " of field "
349                             << this->dimensionedInternalField().name()
350                             << " in file "
351                             << this->dimensionedInternalField().objectPath()
352                             << exit(FatalIOError);
353                     }
354                 }
355                 else if
356                 (
357                     firstToken.isWord()
358                  && firstToken.wordToken() == "uniform"
359                 )
360                 {
361                     token fieldToken(is);
363                     if (!fieldToken.isPunctuation())
364                     {
365                         scalarFields_.insert
366                         (
367                             iter().keyword(),
368                             new scalarField
369                             (
370                                 this->size(),
371                                 fieldToken.scalarToken()
372                             )
373                         );
374                     }
375                     else
376                     {
377                         // Read as scalarList.
378                         is.putBack(fieldToken);
380                         scalarList l(is);
382                         if (l.size() == vector::nComponents)
383                         {
384                             vector vs(l[0], l[1], l[2]);
386                             vectorFields_.insert
387                             (
388                                 iter().keyword(),
389                                 new vectorField(this->size(), vs)
390                             );
391                         }
392                         else if (l.size() == sphericalTensor::nComponents)
393                         {
394                             sphericalTensor vs(l[0]);
396                             sphericalTensorFields_.insert
397                             (
398                                 iter().keyword(),
399                                 new sphericalTensorField(this->size(), vs)
400                             );
401                         }
402                         else if (l.size() == symmTensor::nComponents)
403                         {
404                             symmTensor vs(l[0], l[1], l[2], l[3], l[4], l[5]);
406                             symmTensorFields_.insert
407                             (
408                                 iter().keyword(),
409                                 new symmTensorField(this->size(), vs)
410                             );
411                         }
412                         else if (l.size() == tensor::nComponents)
413                         {
414                             tensor vs
415                             (
416                                 l[0], l[1], l[2],
417                                 l[3], l[4], l[5],
418                                 l[6], l[7], l[8]
419                             );
421                             tensorFields_.insert
422                             (
423                                 iter().keyword(),
424                                 new tensorField(this->size(), vs)
425                             );
426                         }
427                         else
428                         {
429                             FatalIOErrorIn
430                             (
431                                 "genericFvPatchField<Type>::genericFvPatchField"
432                                 "(const fvPatch&, const Field<Type>&, "
433                                 "const dictionary&)",
434                                 dict
435                             )   << "\n    unrecognised native type " << l
436                                 << "\n    on patch " << this->patch().name()
437                                 << " of field "
438                                 << this->dimensionedInternalField().name()
439                                 << " in file "
440                                 << this->dimensionedInternalField().objectPath()
441                                 << exit(FatalIOError);
442                         }
443                     }
444                 }
445             }
446         }
447     }
451 template<class Type>
452 Foam::genericFvPatchField<Type>::genericFvPatchField
454     const genericFvPatchField<Type>& ptf,
455     const fvPatch& p,
456     const DimensionedField<Type, volMesh>& iF,
457     const fvPatchFieldMapper& mapper
460     calculatedFvPatchField<Type>(ptf, p, iF, mapper),
461     actualTypeName_(ptf.actualTypeName_),
462     dict_(ptf.dict_)
464     for
465     (
466         HashPtrTable<scalarField>::const_iterator iter =
467             ptf.scalarFields_.begin();
468         iter != ptf.scalarFields_.end();
469         ++iter
470     )
471     {
472         scalarFields_.insert(iter.key(), new scalarField(*iter(), mapper));
473     }
475     for
476     (
477         HashPtrTable<vectorField>::const_iterator iter =
478             ptf.vectorFields_.begin();
479         iter != ptf.vectorFields_.end();
480         ++iter
481     )
482     {
483         vectorFields_.insert(iter.key(), new vectorField(*iter(), mapper));
484     }
486     for
487     (
488         HashPtrTable<sphericalTensorField>::const_iterator iter =
489             ptf.sphericalTensorFields_.begin();
490         iter != ptf.sphericalTensorFields_.end();
491         ++iter
492     )
493     {
494         sphericalTensorFields_.insert
495         (
496             iter.key(),
497             new sphericalTensorField(*iter(), mapper)
498         );
499     }
501     for
502     (
503         HashPtrTable<symmTensorField>::const_iterator iter =
504             ptf.symmTensorFields_.begin();
505         iter != ptf.symmTensorFields_.end();
506         ++iter
507     )
508     {
509         symmTensorFields_.insert
510         (
511             iter.key(),
512             new symmTensorField(*iter(), mapper)
513         );
514     }
516     for
517     (
518         HashPtrTable<tensorField>::const_iterator iter =
519             ptf.tensorFields_.begin();
520         iter != ptf.tensorFields_.end();
521         ++iter
522     )
523     {
524         tensorFields_.insert(iter.key(), new tensorField(*iter(), mapper));
525     }
529 template<class Type>
530 Foam::genericFvPatchField<Type>::genericFvPatchField
532     const genericFvPatchField<Type>& ptf
535     calculatedFvPatchField<Type>(ptf),
536     actualTypeName_(ptf.actualTypeName_),
537     dict_(ptf.dict_),
538     scalarFields_(ptf.scalarFields_),
539     vectorFields_(ptf.vectorFields_),
540     sphericalTensorFields_(ptf.sphericalTensorFields_),
541     symmTensorFields_(ptf.symmTensorFields_),
542     tensorFields_(ptf.tensorFields_)
546 template<class Type>
547 Foam::genericFvPatchField<Type>::genericFvPatchField
549     const genericFvPatchField<Type>& ptf,
550     const DimensionedField<Type, volMesh>& iF
553     calculatedFvPatchField<Type>(ptf, iF),
554     actualTypeName_(ptf.actualTypeName_),
555     dict_(ptf.dict_),
556     scalarFields_(ptf.scalarFields_),
557     vectorFields_(ptf.vectorFields_),
558     sphericalTensorFields_(ptf.sphericalTensorFields_),
559     symmTensorFields_(ptf.symmTensorFields_),
560     tensorFields_(ptf.tensorFields_)
564 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
566 template<class Type>
567 void Foam::genericFvPatchField<Type>::autoMap
569     const fvPatchFieldMapper& m
572     calculatedFvPatchField<Type>::autoMap(m);
574     for
575     (
576         HashPtrTable<scalarField>::iterator iter = scalarFields_.begin();
577         iter != scalarFields_.end();
578         ++iter
579     )
580     {
581         iter()->autoMap(m);
582     }
584     for
585     (
586         HashPtrTable<vectorField>::iterator iter = vectorFields_.begin();
587         iter != vectorFields_.end();
588         ++iter
589     )
590     {
591         iter()->autoMap(m);
592     }
594     for
595     (
596         HashPtrTable<sphericalTensorField>::iterator iter =
597             sphericalTensorFields_.begin();
598         iter != sphericalTensorFields_.end();
599         ++iter
600     )
601     {
602         iter()->autoMap(m);
603     }
605     for
606     (
607         HashPtrTable<symmTensorField>::iterator iter =
608             symmTensorFields_.begin();
609         iter != symmTensorFields_.end();
610         ++iter
611     )
612     {
613         iter()->autoMap(m);
614     }
616     for
617     (
618         HashPtrTable<tensorField>::iterator iter = tensorFields_.begin();
619         iter != tensorFields_.end();
620         ++iter
621     )
622     {
623         iter()->autoMap(m);
624     }
628 template<class Type>
629 void Foam::genericFvPatchField<Type>::rmap
631     const fvPatchField<Type>& ptf,
632     const labelList& addr
635     calculatedFvPatchField<Type>::rmap(ptf, addr);
637     const genericFvPatchField<Type>& dptf =
638         refCast<const genericFvPatchField<Type> >(ptf);
640     for
641     (
642         HashPtrTable<scalarField>::iterator iter = scalarFields_.begin();
643         iter != scalarFields_.end();
644         ++iter
645     )
646     {
647         HashPtrTable<scalarField>::const_iterator dptfIter =
648             dptf.scalarFields_.find(iter.key());
650         if (dptfIter != dptf.scalarFields_.end())
651         {
652             iter()->rmap(*dptfIter(), addr);
653         }
654     }
656     for
657     (
658         HashPtrTable<vectorField>::iterator iter = vectorFields_.begin();
659         iter != vectorFields_.end();
660         ++iter
661     )
662     {
663         HashPtrTable<vectorField>::const_iterator dptfIter =
664             dptf.vectorFields_.find(iter.key());
666         if (dptfIter != dptf.vectorFields_.end())
667         {
668             iter()->rmap(*dptfIter(), addr);
669         }
670     }
672     for
673     (
674         HashPtrTable<sphericalTensorField>::iterator iter =
675             sphericalTensorFields_.begin();
676         iter != sphericalTensorFields_.end();
677         ++iter
678     )
679     {
680         HashPtrTable<sphericalTensorField>::const_iterator dptfIter =
681             dptf.sphericalTensorFields_.find(iter.key());
683         if (dptfIter != dptf.sphericalTensorFields_.end())
684         {
685             iter()->rmap(*dptfIter(), addr);
686         }
687     }
689     for
690     (
691         HashPtrTable<symmTensorField>::iterator iter =
692             symmTensorFields_.begin();
693         iter != symmTensorFields_.end();
694         ++iter
695     )
696     {
697         HashPtrTable<symmTensorField>::const_iterator dptfIter =
698             dptf.symmTensorFields_.find(iter.key());
700         if (dptfIter != dptf.symmTensorFields_.end())
701         {
702             iter()->rmap(*dptfIter(), addr);
703         }
704     }
706     for
707     (
708         HashPtrTable<tensorField>::iterator iter = tensorFields_.begin();
709         iter != tensorFields_.end();
710         ++iter
711     )
712     {
713         HashPtrTable<tensorField>::const_iterator dptfIter =
714             dptf.tensorFields_.find(iter.key());
716         if (dptfIter != dptf.tensorFields_.end())
717         {
718             iter()->rmap(*dptfIter(), addr);
719         }
720     }
724 template<class Type>
725 Foam::tmp<Foam::Field<Type> >
726 Foam::genericFvPatchField<Type>::valueInternalCoeffs
728     const tmp<scalarField>&
729 ) const
731     FatalErrorIn
732     (
733         "genericFvPatchField<Type>::"
734         "valueInternalCoeffs(const tmp<scalarField>&) const"
735     )   << "\n    "
736            "valueInternalCoeffs cannot be called for a genericFvPatchField"
737            " (actual type " << actualTypeName_ << ")"
738         << "\n    on patch " << this->patch().name()
739         << " of field " << this->dimensionedInternalField().name()
740         << " in file " << this->dimensionedInternalField().objectPath()
741         << "\n    You are probably trying to solve for a field with a "
742            "generic boundary condition."
743         << exit(FatalError);
745     return *this;
749 template<class Type>
750 Foam::tmp<Foam::Field<Type> >
751 Foam::genericFvPatchField<Type>::valueBoundaryCoeffs
753     const tmp<scalarField>&
754 ) const
756     FatalErrorIn
757     (
758         "genericFvPatchField<Type>::"
759         "valueBoundaryCoeffs(const tmp<scalarField>&) const"
760     )   << "\n    "
761            "valueBoundaryCoeffs cannot be called for a genericFvPatchField"
762            " (actual type " << actualTypeName_ << ")"
763         << "\n    on patch " << this->patch().name()
764         << " of field " << this->dimensionedInternalField().name()
765         << " in file " << this->dimensionedInternalField().objectPath()
766         << "\n    You are probably trying to solve for a field with a "
767            "generic boundary condition."
768         << exit(FatalError);
770     return *this;
774 template<class Type>
775 Foam::tmp<Foam::Field<Type> >
776 Foam::genericFvPatchField<Type>::gradientInternalCoeffs() const
778     FatalErrorIn
779     (
780         "genericFvPatchField<Type>::"
781         "gradientInternalCoeffs() const"
782     )   << "\n    "
783            "gradientInternalCoeffs cannot be called for a genericFvPatchField"
784            " (actual type " << actualTypeName_ << ")"
785         << "\n    on patch " << this->patch().name()
786         << " of field " << this->dimensionedInternalField().name()
787         << " in file " << this->dimensionedInternalField().objectPath()
788         << "\n    You are probably trying to solve for a field with a "
789            "generic boundary condition."
790         << exit(FatalError);
792     return *this;
795 template<class Type>
796 Foam::tmp<Foam::Field<Type> >
797 Foam::genericFvPatchField<Type>::gradientBoundaryCoeffs() const
799     FatalErrorIn
800     (
801         "genericFvPatchField<Type>::"
802         "gradientBoundaryCoeffs() const"
803     )   << "\n    "
804            "gradientBoundaryCoeffs cannot be called for a genericFvPatchField"
805            " (actual type " << actualTypeName_ << ")"
806         << "\n    on patch " << this->patch().name()
807         << " of field " << this->dimensionedInternalField().name()
808         << " in file " << this->dimensionedInternalField().objectPath()
809         << "\n    You are probably trying to solve for a field with a "
810            "generic boundary condition."
811         << exit(FatalError);
813     return *this;
817 template<class Type>
818 void Foam::genericFvPatchField<Type>::write(Ostream& os) const
820     os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl;
822     for
823     (
824         dictionary::const_iterator iter = dict_.begin();
825         iter != dict_.end();
826         ++iter
827     )
828     {
829         if (iter().keyword() != "type" && iter().keyword() != "value")
830         {
831             if
832             (
833                 iter().isStream()
834              && iter().stream().size()
835              && iter().stream()[0].isWord()
836              && iter().stream()[0].wordToken() == "nonuniform"
837             )
838             {
839                 if (scalarFields_.found(iter().keyword()))
840                 {
841                     scalarFields_.find(iter().keyword())()
842                         ->writeEntry(iter().keyword(), os);
843                 }
844                 else if (vectorFields_.found(iter().keyword()))
845                 {
846                     vectorFields_.find(iter().keyword())()
847                         ->writeEntry(iter().keyword(), os);
848                 }
849                 else if (sphericalTensorFields_.found(iter().keyword()))
850                 {
851                     sphericalTensorFields_.find(iter().keyword())()
852                         ->writeEntry(iter().keyword(), os);
853                 }
854                 else if (symmTensorFields_.found(iter().keyword()))
855                 {
856                     symmTensorFields_.find(iter().keyword())()
857                         ->writeEntry(iter().keyword(), os);
858                 }
859                 else if (tensorFields_.found(iter().keyword()))
860                 {
861                     tensorFields_.find(iter().keyword())()
862                         ->writeEntry(iter().keyword(), os);
863                 }
864             }
865             else
866             {
867                iter().write(os);
868             }
869         }
870     }
872     this->writeEntry("value", os);
876 // ************************************************************************* //