Nektar++
Field.hpp
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: Field.hpp
4//
5// For more information, please see: http://www.nektar.info/
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Field converter module base classes.
32//
33////////////////////////////////////////////////////////////////////////////////
34
35#ifndef FIELDUTILS_FIELD
36#define FIELDUTILS_FIELD
37
44#include <boost/program_options.hpp>
45#include <iomanip>
46#include <memory>
47
52
53#include "FieldUtilsDeclspec.h"
54
55namespace po = boost::program_options;
56
58{
59
60struct Field
61{
66 m_addNormals(false), m_fieldPts(LibUtilities::NullPtsField)
67 {
68 }
69
71 {
72 if (m_comm)
73 {
74 m_comm->Finalise();
75 }
76 }
78 std::vector<LibUtilities::FieldDefinitionsSharedPtr> m_fielddef;
79 std::vector<std::vector<double>> m_data;
80 std::vector<MultiRegions::ExpListSharedPtr> m_exp;
81
82 std::vector<std::string> m_variables;
83
85
88
90
92
96 int m_nParts = 1;
97 po::variables_map m_vm;
98
101 std::map<std::string, std::vector<std::string>> m_inputfiles;
102
104 std::vector<unsigned int> m_bndRegionsToWrite;
106
108
110
111 FIELD_UTILS_EXPORT void SetUpExp(boost::program_options::variables_map &vm)
112 {
113 if (m_graph && !m_exp.size())
114 {
115 CreateExp(vm, true);
116 }
117 else if (m_graph && m_data.size())
118 {
119 CreateExp(vm, false);
120 }
121 }
122
123 FIELD_UTILS_EXPORT void CreateExp(boost::program_options::variables_map &vm,
124 bool newExp)
125 {
126
127 bool fldfilegiven = (m_fielddef.size() != 0);
128 if (newExp)
129 {
130 LibUtilities::Timer timerpart;
131 if (m_verbose)
132 {
133 if (m_comm->TreatAsRankZero())
134 {
135 timerpart.Start();
136 }
137 }
138 // check to see if fld file defined so can use in
139 // expansion defintion if required
140
141 bool expFromFld =
142 fldfilegiven && !vm.count("use-session-expansion");
143
144 // load fielddef header if fld file is defined. This gives
145 // precedence to Homogeneous definition in fld file
147 if (expFromFld)
148 {
149 m_numHomogeneousDir = m_fielddef[0]->m_numHomogeneousDir;
150
151 // Set up Expansion information to use mode order from field
152 m_graph->SetExpansionInfo(m_fielddef);
153 }
154 else
155 {
156 if (m_session->DefinesSolverInfo("HOMOGENEOUS"))
157 {
158 std::string HomoStr =
159 m_session->GetSolverInfo("HOMOGENEOUS");
160
161 if ((HomoStr == "HOMOGENEOUS1D") ||
162 (HomoStr == "Homogeneous1D") || (HomoStr == "1D") ||
163 (HomoStr == "Homo1D"))
164 {
166 }
167 if ((HomoStr == "HOMOGENEOUS2D") ||
168 (HomoStr == "Homogeneous2D") || (HomoStr == "2D") ||
169 (HomoStr == "Homo2D"))
170 {
172 }
173 }
174 }
175
176 m_exp.resize(1);
177 // Check if there are any elements to process
178 std::vector<int> IDs;
179 auto domain = m_graph->GetDomain();
180 for (size_t d = 0; d < domain.size(); ++d)
181 {
182 for (auto &compIter : domain[d])
183 {
184 for (auto &x : compIter.second->m_geomVec)
185 {
186 IDs.push_back(x->GetGlobalID());
187 }
188 }
189 }
190 // if Range has been specified it is possible to have a
191 // partition which is empty so check this and return with empty
192 // expansion if no elements present.
193 if (!IDs.size())
194 {
195 m_exp[0] =
197
198 return;
199 }
200
201 // Adjust number of quadrature points
202 if (vm.count("output-points"))
203 {
204 int nPointsNew = vm["output-points"].as<int>();
205 m_graph->SetExpansionInfoToPointOrder(nPointsNew);
206 }
207
208 if (m_verbose)
209 {
210 if (m_comm->TreatAsRankZero())
211 {
212 timerpart.Stop();
213 NekDouble cpuTime = timerpart.TimePerTest(1);
214
215 std::stringstream ss;
216 ss << cpuTime << "s";
217 std::cout << "\t CreateExp setexpansion CPU Time: "
218 << std::setw(8) << std::left << ss.str()
219 << std::endl;
220 timerpart.Start();
221 }
222 }
223 // Override number of planes with value from cmd line
224 if (m_numHomogeneousDir == 1 && vm.count("output-points-hom-z"))
225 {
226 int expdim = m_graph->GetMeshDimension();
227 m_fielddef[0]->m_numModes[expdim] =
228 vm["output-points-hom-z"].as<int>();
229 }
231 if (m_verbose)
232 {
233 if (m_comm->TreatAsRankZero())
234 {
235 timerpart.Stop();
236 NekDouble cpuTime = timerpart.TimePerTest(1);
237
238 std::stringstream ss1;
239
240 ss1 << cpuTime << "s";
241 std::cout << "\t CreateExp set first exp CPU Time: "
242 << std::setw(8) << std::left << ss1.str()
243 << std::endl;
244 }
245 }
246 }
247
248 if (fldfilegiven)
249 {
250 size_t i, nfields, nstrips;
251 m_session->LoadParameter("Strip_Z", nstrips, 1);
252 std::vector<std::string> vars = m_session->GetVariables();
253
254 if (vm.count("use-session-variables"))
255 {
256 m_variables = vars;
257 }
258 nfields = m_variables.size();
259
260 m_exp.resize(nfields * nstrips);
261 // declare other fields;
262 for (size_t s = 0; s < nstrips; ++s) // homogeneous strip varient
263 {
264 for (i = 0; i < nfields; ++i)
265 {
266 if (i < vars.size())
267 {
268 // check to see if field already defined
269 if (!m_exp[s * nfields + i])
270 {
271 m_exp[s * nfields + i] =
273 }
274 }
275 else
276 {
277 if (vars.size())
278 {
279 m_exp[s * nfields + i] =
281 }
282 else
283 {
284 m_exp[s * nfields + i] =
286 }
287 }
288 }
289 }
290
292 }
293 }
294
296 {
297 size_t i, j, nfields, nstrips;
298 m_session->LoadParameter("Strip_Z", nstrips, 1);
299 std::vector<std::string> vars = m_session->GetVariables();
300
301 nfields = m_variables.size();
302
303 // Extract data to coeffs and bwd transform
304 for (size_t s = 0; s < nstrips; ++s) // homogeneous strip varient
305 {
306 for (j = 0; j < nfields; ++j)
307 {
308 for (i = 0; i < m_data.size() / nstrips; ++i)
309 {
310 size_t n = i * nstrips + s;
311 // In case of multiple flds, we might not have a
312 // variable in this m_data[n] -> skip in this case
313 auto it =
314 find(m_fielddef[n]->m_fields.begin(),
315 m_fielddef[n]->m_fields.end(), m_variables[j]);
316 if (it != m_fielddef[n]->m_fields.end())
317 {
318 m_exp[s * nfields + j]->ExtractDataToCoeffs(
319 m_fielddef[n], m_data[n], m_variables[j],
320 m_exp[s * nfields + j]->UpdateCoeffs());
321 }
322 }
323 m_exp[s * nfields + j]->BwdTrans(
324 m_exp[s * nfields + j]->GetCoeffs(),
325 m_exp[s * nfields + j]->UpdatePhys());
326 }
327 }
328
329 // Clear fielddef and data
330 // (they should not be used after running this module)
331 m_fielddef = std::vector<LibUtilities::FieldDefinitionsSharedPtr>();
332 m_data = std::vector<std::vector<NekDouble>>();
333 }
334
336 int NumHomogeneousDir, bool fldfilegiven = false)
337 {
338
340
341 // Set up expansion list
342 int expdim = m_graph->GetMeshDimension();
343 bool dealiasing = false;
344
345 m_session->MatchSolverInfo("USEFFT", "FFTW", m_useFFT, false);
346
347 switch (expdim)
348 {
349 case 1:
350 {
351 ASSERTL0(NumHomogeneousDir <= 2,
352 "Quasi-3D approach is only set up for 1 or 2 "
353 "homogeneous directions");
354
355 if (NumHomogeneousDir == 1)
356 {
358
359 // Define Homogeneous expansion
360 int nplanes;
361 NekDouble ly;
363
364 if (fldfilegiven)
365 {
366 nplanes = m_fielddef[0]->m_numModes[1];
367 ly = m_fielddef[0]->m_homogeneousLengths[0];
368 btype = m_fielddef[0]->m_basis[1];
369 }
370 else
371 {
372 m_session->LoadParameter("HomModesZ", nplanes);
373 m_session->LoadParameter("LY", ly);
375 }
376
377 // Choose points to be at evenly spaced points at
378 // nplanes points
379 const LibUtilities::PointsKey Pkey(
381
382 const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
383
386 {
387 ASSERTL0(false, "ContFieldHomogeneous1D or "
388 "DisContFieldHomogenenous1D has "
389 "not been implemented");
390 }
391
392 Exp2DH1 =
395 dealiasing, m_graph,
397 exp = Exp2DH1;
398 }
399 else if (NumHomogeneousDir == 2)
400 {
402
403 int nylines, nzlines;
404 NekDouble ly, lz;
405 LibUtilities::BasisType btype1, btype2;
406
407 if (fldfilegiven)
408 {
409 nylines = m_fielddef[0]->m_numModes[1];
410 nzlines = m_fielddef[0]->m_numModes[2];
411 ly = m_fielddef[0]->m_homogeneousLengths[0];
412 lz = m_fielddef[0]->m_homogeneousLengths[1];
413 btype1 = m_fielddef[0]->m_basis[1];
414 btype2 = m_fielddef[0]->m_basis[2];
415 }
416 else
417 {
418 m_session->LoadParameter("HomModesY", nylines);
419 m_session->LoadParameter("HomModesZ", nzlines);
420 m_session->LoadParameter("LY", ly);
421 m_session->LoadParameter("LZ", lz);
422 btype1 = LibUtilities::eFourier;
423 btype2 = LibUtilities::eFourier;
424 }
425
426 // Choose points to be at evenly spaced points at
427 // nplanes points
428 const LibUtilities::PointsKey PkeyY(
430 const LibUtilities::BasisKey BkeyY(btype1, nylines, PkeyY);
431
432 const LibUtilities::PointsKey PkeyZ(
434 const LibUtilities::BasisKey BkeyZ(btype2, nzlines, PkeyZ);
435
437 {
438 Exp3DH2 = MemoryManager<
440 AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
441 m_useFFT, dealiasing, m_graph,
442 m_session->GetVariable(0),
444 }
446 {
447 Exp3DH2 = MemoryManager<
449 AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
450 m_useFFT, dealiasing, m_graph,
451 m_session->GetVariable(0),
453 }
454 else
455 {
456 Exp3DH2 = MemoryManager<
458 AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
459 m_useFFT, dealiasing, m_graph,
461 }
462
463 exp = Exp3DH2;
464 }
465 else
466 {
468
470 {
473 m_session, m_graph, m_session->GetVariable(0),
474 true, false, Collections::eNoCollection);
475 }
477 {
480 m_session->GetVariable(0), true,
482 }
483 else
484 {
487 "DefaultVar",
489 }
490
491 exp = Exp1D;
492 }
493 }
494 break;
495 case 2:
496 {
497 ASSERTL0(NumHomogeneousDir <= 1,
498 "NumHomogeneousDir is only set up for 1");
499
500 if (NumHomogeneousDir == 1)
501 {
503
504 // Define Homogeneous expansion
505 int nplanes;
506 NekDouble lz;
510
511 if (fldfilegiven)
512 {
513 nplanes = m_fielddef[0]->m_numModes[2];
514 lz = m_fielddef[0]->m_homogeneousLengths[0];
515 btype = m_fielddef[0]->m_basis[2];
516
518 {
520 m_fielddef[0]->m_basis[2] =
522 if (nplanes <= 2)
523 {
524 nplanes = 4;
525 }
526 }
527 else if (btype == LibUtilities::eFourierHalfModeRe &&
528 nplanes == 1)
529 {
531 }
532 }
533 else
534 {
535 m_session->LoadParameter("HomModesZ", nplanes);
536 m_session->LoadParameter("LZ", lz);
538 }
539 // Choose points to be at evenly spaced points at
540 // nplanes points
541 const LibUtilities::PointsKey Pkey(nplanes, ptype);
542
543 const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
544
546 {
547 Exp3DH1 = MemoryManager<
549 AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
550 dealiasing, m_graph,
551 m_session->GetVariable(0),
553 }
554
556 {
557 Exp3DH1 = MemoryManager<
559 AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
560 dealiasing, m_graph,
561 m_session->GetVariable(0),
563 }
564
565 else
566 {
567 Exp3DH1 = MemoryManager<
569 AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
570 dealiasing, m_graph, "DefaultVar",
572 }
573 exp = Exp3DH1;
574 }
575 else
576 {
578
580 {
583 m_session, m_graph, m_session->GetVariable(0),
584 true, false, Collections::eNoCollection);
585 }
586
588 {
591 m_session->GetVariable(0), true,
593 }
594 else
595 {
598 "DefaultVar",
600 }
601
602 exp = Exp2D;
603 }
604 }
605 break;
606 case 3:
607 {
609
611 {
614 m_session->GetVariable(0), true,
616 }
618 {
621 m_session->GetVariable(0), true,
623 }
624 else
625 {
626 Exp3D =
628 m_session, m_graph, true, "DefaultVar",
630 }
631
632 exp = Exp3D;
633 }
634 break;
635 default:
636 ASSERTL0(false, "Expansion dimension not recognised");
637 break;
638 }
639
640 return exp;
641 };
642
643 /**
644 * @brief Construct a FieldIO object for the file @p filename.
645 *
646 * This routine constructs an appropriate FieldIO object for a filename
647 * through the LibUtilities::FieldIO::GetFileType function to detect the
648 * file format. The result is then cached in Field::m_fld to avoid needing
649 * to repeatedly construct the object.
650 *
651 * @param filename Filename to open.
652 * @return Reader for @p filename.
653 */
655 std::string filename)
656 {
658 std::string fmt = LibUtilities::FieldIO::GetFileType(filename, c);
659
660 auto it = m_fld.find(fmt);
661
662 if (it == m_fld.end())
663 {
666 m_fld[fmt] = fld;
667 return fld;
668 }
669 else
670 {
671 return it->second;
672 }
673 }
674
676 int NumHomogeneousDir, std::string var = "DefaultVar",
677 bool NewField = false)
678 {
679 if (var.compare("DefaultVar") == 0 && m_requireBoundaryExpansion)
680 {
681 if (m_session->GetVariables().size())
682 {
683 var = m_session->GetVariables()[0];
684 }
685 }
687 switch (m_graph->GetMeshDimension())
688 {
689 case 1:
690 {
691 if (NumHomogeneousDir == 1)
692 {
695 "ContFieldHomogeneous1D or "
696 "DisContFieldHomogenenous1D has not been "
697 "implemented");
698
700 std::dynamic_pointer_cast<
702
704 AllocateSharedPtr(*tmp2);
705 }
706 else if (NumHomogeneousDir == 2)
707 {
709 {
711 std::dynamic_pointer_cast<
713 m_exp[0]);
714
715 tmp = MemoryManager<
717 AllocateSharedPtr(*tmp2);
718 }
720 {
722 tmp2 = std::dynamic_pointer_cast<
724 m_exp[0]);
725
726 tmp = MemoryManager<
728 AllocateSharedPtr(*tmp2);
729 }
730 else
731 {
733 std::dynamic_pointer_cast<
735
736 tmp = MemoryManager<
738 AllocateSharedPtr(*tmp2);
739 }
740 }
741 else
742 {
744 {
746 std::dynamic_pointer_cast<MultiRegions::ContField>(
747 m_exp[0]);
748
751 false,
753 }
755 {
757 std::dynamic_pointer_cast<
759
763 }
764 else
765 {
767 std::dynamic_pointer_cast<MultiRegions::ExpList>(
768 m_exp[0]);
769
770 tmp = MemoryManager<
771 MultiRegions::ExpList>::AllocateSharedPtr(*tmp2);
772 }
773 }
774 }
775 break;
776 case 2:
777 {
778 if (NumHomogeneousDir == 1)
779 {
781 {
782 if (NewField)
783 {
784 bool dealiasing = false;
785
786 tmp = MemoryManager<
788 AllocateSharedPtr(m_session,
789 m_exp[0]
790 ->GetHomogeneousBasis()
791 ->GetBasisKey(),
792 m_exp[0]->GetHomoLen(),
793 m_useFFT, dealiasing, m_graph,
794 var,
796 }
797 else
798 {
800 tmp2 = std::dynamic_pointer_cast<
802 m_exp[0]);
803
804 ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
805 tmp = MemoryManager<
807 AllocateSharedPtr(*tmp2, m_graph, var);
808 }
809 }
811 {
812 if (NewField)
813 {
814 bool dealiasing = false;
815
816 tmp = MemoryManager<
818 AllocateSharedPtr(m_session,
819 m_exp[0]
820 ->GetHomogeneousBasis()
821 ->GetBasisKey(),
822 m_exp[0]->GetHomoLen(),
823 m_useFFT, dealiasing, m_graph,
824 var,
826 }
827 else
828 {
830 tmp2 = std::dynamic_pointer_cast<
832 m_exp[0]);
833 ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
834
835 tmp = MemoryManager<
837 AllocateSharedPtr(*tmp2);
838 }
839 }
840 else
841 {
842 if (NewField)
843 {
844 bool dealiasing = false;
845
846 tmp = MemoryManager<
848 AllocateSharedPtr(m_session,
849 m_exp[0]
850 ->GetHomogeneousBasis()
851 ->GetBasisKey(),
852 m_exp[0]->GetHomoLen(),
853 m_useFFT, dealiasing, m_graph,
854 "DefaultVar",
856 }
857 else
858 {
860 std::dynamic_pointer_cast<
862 m_exp[0]);
863 ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
864
865 tmp = MemoryManager<
867 AllocateSharedPtr(*tmp2);
868 }
869 }
870 }
871 else
872 {
874 {
875 if (NewField)
876 {
879 false,
881 }
882 else // call copy constructor
883 {
884
886 std::dynamic_pointer_cast<
888
890 AllocateSharedPtr(*tmp2, m_graph, var);
891 }
892 }
894 {
895 if (NewField)
896 {
899 true,
901 }
902 else // call copy constructor
903 {
905 std::dynamic_pointer_cast<
907
909 AllocateSharedPtr(*tmp2, m_graph, var);
910 }
911 }
912 else
913 {
915 std::dynamic_pointer_cast<MultiRegions::ExpList>(
916 m_exp[0]);
917
918 tmp = MemoryManager<
919 MultiRegions::ExpList>::AllocateSharedPtr(*tmp2);
920 }
921 }
922 }
923 break;
924 case 3:
925 {
927 {
928 if (NewField)
929 {
932 false,
934 }
935 else
936 {
938 std::dynamic_pointer_cast<MultiRegions::ContField>(
939 m_exp[0]);
940
941 tmp = MemoryManager<
942 MultiRegions::ContField>::AllocateSharedPtr(*tmp2,
943 m_graph,
944 var);
945 }
946 }
948 {
949 if (NewField)
950 {
954 }
955 else
956 {
958 std::dynamic_pointer_cast<
960
962 AllocateSharedPtr(*tmp2, m_graph, var);
963 }
964 }
965 else
966 {
968 std::dynamic_pointer_cast<MultiRegions::ExpList>(
969 m_exp[0]);
970
971 tmp =
973 *tmp2);
974 }
975 }
976 break;
977 default:
978 ASSERTL0(false, "Expansion dimension not recognised");
979 break;
980 }
981
982 return tmp;
983 }
984
986 {
990 m_exp.clear();
991 m_fielddef = std::vector<LibUtilities::FieldDefinitionsSharedPtr>();
992 m_data = std::vector<std::vector<NekDouble>>();
993 m_variables.clear();
994 }
995
998 {
999 ClearField();
1000
1001 m_exp.resize(exp.size());
1002 m_variables.resize(exp.size());
1003
1004 if (exp.size() == 0)
1005 {
1006 return;
1007 }
1008
1009 m_session = exp[0]->GetSession();
1010 m_graph = exp[0]->GetGraph();
1011 m_comm = m_session->GetComm();
1012
1013 for (int i = 0; i < exp.size(); ++i)
1014 {
1015 m_exp[i] = exp[i];
1016 m_variables[i] = m_session->GetVariable(i);
1017 }
1018 }
1019
1020private:
1021 /// Map to store FieldIO instances. Key is the reader type, value is the
1022 /// FieldIO object.
1023 std::map<std::string, LibUtilities::FieldIOSharedPtr> m_fld;
1024};
1025
1026typedef std::shared_ptr<Field> FieldSharedPtr;
1027} // namespace Nektar::FieldUtils
1028
1029#endif
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define FIELD_UTILS_EXPORT
Describes the specification for a Basis.
Definition: Basis.h:45
static const std::string GetFileType(const std::string &filename, CommSharedPtr comm)
Determine file type of given input file.
Definition: FieldIO.cpp:95
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Defines a specification for a set of points.
Definition: Points.h:50
NekDouble TimePerTest(unsigned int n)
Returns amount of seconds per iteration in a test with n iterations.
Definition: Timer.cpp:65
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
Definition: ContField.h:55
This class is the abstractio n of a global discontinuous two- dimensional spectral/hp element expansi...
Definition: DisContField.h:56
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Abstraction of a one-dimensional multi-elemental expansion which is merely a collection of local expa...
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:99
std::shared_ptr< Field > FieldSharedPtr
Definition: Field.hpp:1026
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition: FieldIO.h:322
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:50
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:184
static PtsFieldSharedPtr NullPtsField
Definition: PtsField.h:185
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
Definition: FieldIO.cpp:70
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:74
@ ePolyEvenlySpaced
1D Evenly-spaced points using Lagrange polynomial
Definition: PointsType.h:73
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55
@ eFourierSingleMode
Fourier ModifiedExpansion with just the first mode .
Definition: BasisType.h:64
@ eFourierHalfModeRe
Fourier Modified expansions with just the real part of the first mode .
Definition: BasisType.h:66
@ eFourier
Fourier Expansion .
Definition: BasisType.h:55
std::shared_ptr< DisContField3DHomogeneous2D > DisContField3DHomogeneous2DSharedPtr
std::shared_ptr< DisContField3DHomogeneous1D > DisContField3DHomogeneous1DSharedPtr
std::shared_ptr< DisContField > DisContFieldSharedPtr
Definition: DisContField.h:346
std::shared_ptr< ContField3DHomogeneous2D > ContField3DHomogeneous2DSharedPtr
std::shared_ptr< ContField3DHomogeneous1D > ContField3DHomogeneous1DSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< ExpList2DHomogeneous1D > ExpList2DHomogeneous1DSharedPtr
Shared pointer to an ExpList2DHomogeneous1D object.
std::shared_ptr< ExpList3DHomogeneous2D > ExpList3DHomogeneous2DSharedPtr
Shared pointer to an ExpList3DHomogeneous2D object.
std::shared_ptr< ExpList3DHomogeneous1D > ExpList3DHomogeneous1DSharedPtr
Shared pointer to an ExpList3DHomogeneous1D object.
std::shared_ptr< ContField > ContFieldSharedPtr
Definition: ContField.h:268
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:475
std::vector< double > d(NPUPPER *NPUPPER)
double NekDouble
FIELD_UTILS_EXPORT void SetupFromExpList(Array< OneD, MultiRegions::ExpListSharedPtr > &exp)
Definition: Field.hpp:996
LibUtilities::CommSharedPtr m_partComm
Definition: Field.hpp:95
FIELD_UTILS_EXPORT void ReadFieldDefs()
Definition: Field.hpp:295
FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr SetUpFirstExpList(int NumHomogeneousDir, bool fldfilegiven=false)
Definition: Field.hpp:335
FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr AppendExpList(int NumHomogeneousDir, std::string var="DefaultVar", bool NewField=false)
Definition: Field.hpp:675
bool m_declareExpansionAsDisContField
Definition: Field.hpp:87
po::variables_map m_vm
Definition: Field.hpp:97
SpatialDomains::MeshGraphSharedPtr m_graph
Definition: Field.hpp:100
std::vector< std::string > m_variables
Definition: Field.hpp:82
std::vector< unsigned int > m_bndRegionsToWrite
Definition: Field.hpp:104
LibUtilities::SessionReaderSharedPtr m_session
Definition: Field.hpp:99
std::map< std::string, LibUtilities::FieldIOSharedPtr > m_fld
Map to store FieldIO instances. Key is the reader type, value is the FieldIO object.
Definition: Field.hpp:1023
std::map< std::string, std::vector< std::string > > m_inputfiles
Definition: Field.hpp:101
FIELD_UTILS_EXPORT Field()
Definition: Field.hpp:62
bool m_declareExpansionAsContField
Definition: Field.hpp:86
FIELD_UTILS_EXPORT void ClearField()
Definition: Field.hpp:985
std::vector< LibUtilities::FieldDefinitionsSharedPtr > m_fielddef
Definition: Field.hpp:78
FIELD_UTILS_EXPORT void SetUpExp(boost::program_options::variables_map &vm)
Definition: Field.hpp:111
LibUtilities::PtsFieldSharedPtr m_fieldPts
Definition: Field.hpp:107
FIELD_UTILS_EXPORT ~Field()
Definition: Field.hpp:70
std::vector< std::vector< double > > m_data
Definition: Field.hpp:79
std::vector< MultiRegions::ExpListSharedPtr > m_exp
Definition: Field.hpp:80
LibUtilities::CommSharedPtr m_comm
Definition: Field.hpp:93
LibUtilities::CommSharedPtr m_defComm
Definition: Field.hpp:94
FIELD_UTILS_EXPORT void CreateExp(boost::program_options::variables_map &vm, bool newExp)
Definition: Field.hpp:123
FIELD_UTILS_EXPORT LibUtilities::FieldIOSharedPtr FieldIOForFile(std::string filename)
Construct a FieldIO object for the file filename.
Definition: Field.hpp:654
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Definition: Field.hpp:109