Nektar++
Loading...
Searching...
No Matches
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{
69
71
73 std::vector<LibUtilities::FieldDefinitionsSharedPtr> m_fielddef;
74 std::vector<std::vector<double>> m_data;
75 std::vector<MultiRegions::ExpListSharedPtr> m_exp;
76
77 std::vector<std::string> m_variables;
78
80
83
85
87
91 int m_nParts = 1;
92 po::variables_map m_vm;
93
96 std::map<std::string, std::vector<std::string>> m_inputfiles;
97
99 std::vector<unsigned int> m_bndRegionsToWrite;
101
103
105
106 FIELD_UTILS_EXPORT void SetUpExp(boost::program_options::variables_map &vm,
107 bool equispaced = false)
108 {
109 if (m_graph && !m_exp.size())
110 {
111 CreateExp(vm, true, equispaced);
112 }
113 else if (m_graph && m_data.size())
114 {
115 CreateExp(vm, false, equispaced);
116 }
117 }
118
119 FIELD_UTILS_EXPORT void CreateExp(boost::program_options::variables_map &vm,
120 bool newExp, bool equispaced = false)
121 {
122
123 bool fldfilegiven = (m_fielddef.size() != 0);
124 if (newExp)
125 {
126 LibUtilities::Timer timerpart;
127 if (m_verbose)
128 {
129 if (m_comm->TreatAsRankZero())
130 {
131 timerpart.Start();
132 }
133 }
134 // check to see if fld file defined so can use in
135 // expansion defintion if required
136
137 bool expFromFld =
138 fldfilegiven && !vm.count("use-session-expansion");
139
140 // load fielddef header if fld file is defined. This gives
141 // precedence to Homogeneous definition in fld file
143 if (expFromFld)
144 {
145 m_numHomogeneousDir = m_fielddef[0]->m_numHomogeneousDir;
146
147 // Set up Expansion information to use mode order from field
148 m_graph->SetExpansionInfo(m_fielddef);
149 }
150 else
151 {
152 if (m_session->DefinesSolverInfo("HOMOGENEOUS"))
153 {
154 std::string HomoStr =
155 m_session->GetSolverInfo("HOMOGENEOUS");
156
157 if ((HomoStr == "HOMOGENEOUS1D") ||
158 (HomoStr == "Homogeneous1D") || (HomoStr == "1D") ||
159 (HomoStr == "Homo1D"))
160 {
162 }
163 if ((HomoStr == "HOMOGENEOUS2D") ||
164 (HomoStr == "Homogeneous2D") || (HomoStr == "2D") ||
165 (HomoStr == "Homo2D"))
166 {
168 }
169 }
170 }
171
172 m_exp.resize(1);
173 // Check if there are any elements to process
174 std::vector<int> IDs;
175 auto domain = m_graph->GetDomain();
176 for (size_t d = 0; d < domain.size(); ++d)
177 {
178 for (auto &compIter : domain[d])
179 {
180 for (auto &x : compIter.second->m_geomVec)
181 {
182 IDs.push_back(x->GetGlobalID());
183 }
184 }
185 }
186 // if Range has been specified it is possible to have a
187 // partition which is empty so check this and return with empty
188 // expansion if no elements present.
189 if (!IDs.size())
190 {
191 m_exp[0] =
193
194 return;
195 }
196
197 // Adjust number of quadrature points
198 int nPointsNew = 0;
199 if (vm.count("output-points"))
200 {
201 nPointsNew = vm["output-points"].as<int>();
202 if (!equispaced)
203 {
204 m_graph->SetExpansionInfoToPointOrder(nPointsNew);
205 }
206 }
207 if (equispaced)
208 {
209 m_graph->SetExpansionInfoToEvenlySpacedPoints(nPointsNew);
210 }
211
212 if (m_verbose)
213 {
214 if (m_comm->TreatAsRankZero())
215 {
216 timerpart.Stop();
217 NekDouble cpuTime = timerpart.TimePerTest(1);
218
219 std::stringstream ss;
220 ss << cpuTime << "s";
221 std::cout << "\t CreateExp setexpansion CPU Time: "
222 << std::setw(8) << std::left << ss.str()
223 << std::endl;
224 timerpart.Start();
225 }
226 }
227 // Override number of planes with value from cmd line
228 if (m_numHomogeneousDir == 1 && vm.count("output-points-hom-z"))
229 {
230 int expdim = m_graph->GetMeshDimension();
231 m_fielddef[0]->m_numModes[expdim] =
232 vm["output-points-hom-z"].as<int>();
233 }
235 if (m_verbose)
236 {
237 if (m_comm->TreatAsRankZero())
238 {
239 timerpart.Stop();
240 NekDouble cpuTime = timerpart.TimePerTest(1);
241
242 std::stringstream ss1;
243
244 ss1 << cpuTime << "s";
245 std::cout << "\t CreateExp set first exp CPU Time: "
246 << std::setw(8) << std::left << ss1.str()
247 << std::endl;
248 }
249 }
250 }
251
252 if (fldfilegiven)
253 {
254 size_t i, nfields, nstrips;
255 m_session->LoadParameter("Strip_Z", nstrips, 1);
256 std::vector<std::string> vars = m_session->GetVariables();
257
258 if (vm.count("use-session-variables"))
259 {
260 m_variables = vars;
261 }
262 nfields = m_variables.size();
263
264 m_exp.resize(nfields * nstrips);
265 // declare other fields;
266 for (size_t s = 0; s < nstrips; ++s) // homogeneous strip varient
267 {
268 for (i = 0; i < nfields; ++i)
269 {
270 if (i < vars.size())
271 {
272 // check to see if field already defined
273 if (!m_exp[s * nfields + i])
274 {
275 m_exp[s * nfields + i] =
277 }
278 }
279 else
280 {
281 if (vars.size())
282 {
283 m_exp[s * nfields + i] =
285 }
286 else
287 {
288 m_exp[s * nfields + i] =
290 }
291 }
292 }
293 }
294
296 }
297 }
298
300 {
301 size_t i, j, nfields, nstrips;
302 m_session->LoadParameter("Strip_Z", nstrips, 1);
303 std::vector<std::string> vars = m_session->GetVariables();
304
305 nfields = m_variables.size();
306
307 // Extract data to coeffs and bwd transform
308 for (size_t s = 0; s < nstrips; ++s) // homogeneous strip varient
309 {
310 for (j = 0; j < nfields; ++j)
311 {
312 for (i = 0; i < m_data.size() / nstrips; ++i)
313 {
314 size_t n = i * nstrips + s;
315 // In case of multiple flds, we might not have a
316 // variable in this m_data[n] -> skip in this case
317 auto it =
318 find(m_fielddef[n]->m_fields.begin(),
319 m_fielddef[n]->m_fields.end(), m_variables[j]);
320 if (it != m_fielddef[n]->m_fields.end())
321 {
322 m_exp[s * nfields + j]->ExtractDataToCoeffs(
323 m_fielddef[n], m_data[n], m_variables[j],
324 m_exp[s * nfields + j]->UpdateCoeffs());
325 }
326 }
327 m_exp[s * nfields + j]->BwdTrans(
328 m_exp[s * nfields + j]->GetCoeffs(),
329 m_exp[s * nfields + j]->UpdatePhys());
330 }
331 }
332
333 // Clear fielddef and data
334 // (they should not be used after running this module)
335 m_fielddef = std::vector<LibUtilities::FieldDefinitionsSharedPtr>();
336 m_data = std::vector<std::vector<NekDouble>>();
337 }
338
340 int NumHomogeneousDir, bool fldfilegiven = false)
341 {
342
344
345 // Set up expansion list
346 int expdim = m_graph->GetMeshDimension();
347 bool dealiasing = false;
348
349 m_session->MatchSolverInfo("USEFFT", "FFTW", m_useFFT, false);
350
351 switch (expdim)
352 {
353 case 1:
354 {
355 ASSERTL0(NumHomogeneousDir <= 2,
356 "Quasi-3D approach is only set up for 1 or 2 "
357 "homogeneous directions");
358
359 if (NumHomogeneousDir == 1)
360 {
362
363 // Define Homogeneous expansion
364 int nplanes;
365 NekDouble ly;
367
368 if (fldfilegiven)
369 {
370 nplanes = m_fielddef[0]->m_numModes[1];
371 ly = m_fielddef[0]->m_homogeneousLengths[0];
372 btype = m_fielddef[0]->m_basis[1];
373 }
374 else
375 {
376 m_session->LoadParameter("HomModesZ", nplanes);
377 m_session->LoadParameter("LY", ly);
379 }
380
381 // Choose points to be at evenly spaced points at
382 // nplanes points
383 const LibUtilities::PointsKey Pkey(
385
386 const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
387
390 {
391 ASSERTL0(false, "ContFieldHomogeneous1D or "
392 "DisContFieldHomogenenous1D has "
393 "not been implemented");
394 }
395
396 Exp2DH1 =
399 dealiasing, m_graph,
401 exp = Exp2DH1;
402 }
403 else if (NumHomogeneousDir == 2)
404 {
406
407 int nylines, nzlines;
408 NekDouble ly, lz;
409 LibUtilities::BasisType btype1, btype2;
410
411 if (fldfilegiven)
412 {
413 nylines = m_fielddef[0]->m_numModes[1];
414 nzlines = m_fielddef[0]->m_numModes[2];
415 ly = m_fielddef[0]->m_homogeneousLengths[0];
416 lz = m_fielddef[0]->m_homogeneousLengths[1];
417 btype1 = m_fielddef[0]->m_basis[1];
418 btype2 = m_fielddef[0]->m_basis[2];
419 }
420 else
421 {
422 m_session->LoadParameter("HomModesY", nylines);
423 m_session->LoadParameter("HomModesZ", nzlines);
424 m_session->LoadParameter("LY", ly);
425 m_session->LoadParameter("LZ", lz);
426 btype1 = LibUtilities::eFourier;
427 btype2 = LibUtilities::eFourier;
428 }
429
430 // Choose points to be at evenly spaced points at
431 // nplanes points
432 const LibUtilities::PointsKey PkeyY(
434 const LibUtilities::BasisKey BkeyY(btype1, nylines, PkeyY);
435
436 const LibUtilities::PointsKey PkeyZ(
438 const LibUtilities::BasisKey BkeyZ(btype2, nzlines, PkeyZ);
439
441 {
442 Exp3DH2 = MemoryManager<
444 AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
445 m_useFFT, dealiasing, m_graph,
446 m_session->GetVariable(0),
448 }
450 {
451 Exp3DH2 = MemoryManager<
453 AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
454 m_useFFT, dealiasing, m_graph,
455 m_session->GetVariable(0),
457 }
458 else
459 {
460 Exp3DH2 = MemoryManager<
462 AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
463 m_useFFT, dealiasing, m_graph,
465 }
466
467 exp = Exp3DH2;
468 }
469 else
470 {
472
474 {
477 m_session, m_graph, m_session->GetVariable(0),
478 true, false, Collections::eNoCollection);
479 }
481 {
484 m_session->GetVariable(0), true,
486 }
487 else
488 {
491 "DefaultVar",
493 }
494
495 exp = Exp1D;
496 }
497 }
498 break;
499 case 2:
500 {
501 ASSERTL0(NumHomogeneousDir <= 1,
502 "NumHomogeneousDir is only set up for 1");
503
504 if (NumHomogeneousDir == 1)
505 {
507
508 // Define Homogeneous expansion
509 int nplanes;
510 NekDouble lz;
514
515 if (fldfilegiven)
516 {
517 nplanes = m_fielddef[0]->m_numModes[2];
518 lz = m_fielddef[0]->m_homogeneousLengths[0];
519 btype = m_fielddef[0]->m_basis[2];
520
522 {
524 m_fielddef[0]->m_basis[2] =
526 if (nplanes <= 2)
527 {
528 nplanes = 4;
529 }
530 }
531 else if (btype == LibUtilities::eFourierHalfModeRe &&
532 nplanes == 1)
533 {
535 }
536 }
537 else
538 {
539 m_session->LoadParameter("HomModesZ", nplanes);
540 m_session->LoadParameter("LZ", lz);
542 }
543 // Choose points to be at evenly spaced points at
544 // nplanes points
545 const LibUtilities::PointsKey Pkey(nplanes, ptype);
546
547 const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
548
550 {
551 Exp3DH1 = MemoryManager<
553 AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
554 dealiasing, m_graph,
555 m_session->GetVariable(0),
557 }
558
560 {
561 Exp3DH1 = MemoryManager<
563 AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
564 dealiasing, m_graph,
565 m_session->GetVariable(0),
567 }
568
569 else
570 {
571 Exp3DH1 = MemoryManager<
573 AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
574 dealiasing, m_graph, "DefaultVar",
576 }
577 exp = Exp3DH1;
578 }
579 else
580 {
582
584 {
587 m_session, m_graph, m_session->GetVariable(0),
588 true, false, Collections::eNoCollection);
589 }
590
592 {
595 m_session->GetVariable(0), true,
597 }
598 else
599 {
602 "DefaultVar",
604 }
605
606 exp = Exp2D;
607 }
608 }
609 break;
610 case 3:
611 {
613
615 {
618 m_session->GetVariable(0), true,
620 }
622 {
625 m_session->GetVariable(0), true,
627 }
628 else
629 {
630 Exp3D =
632 m_session, m_graph, true, "DefaultVar",
634 }
635
636 exp = Exp3D;
637 }
638 break;
639 default:
640 ASSERTL0(false, "Expansion dimension not recognised");
641 break;
642 }
643
644 return exp;
645 };
646
647 /**
648 * @brief Construct a FieldIO object for the file @p filename.
649 *
650 * This routine constructs an appropriate FieldIO object for a filename
651 * through the LibUtilities::FieldIO::GetFileType function to detect the
652 * file format. The result is then cached in Field::m_fld to avoid needing
653 * to repeatedly construct the object.
654 *
655 * @param filename Filename to open.
656 * @return Reader for @p filename.
657 */
659 std::string filename)
660 {
662 std::string fmt = LibUtilities::FieldIO::GetFileType(filename, c);
663
664 auto it = m_fld.find(fmt);
665
666 if (it == m_fld.end())
667 {
670 m_fld[fmt] = fld;
671 return fld;
672 }
673 else
674 {
675 return it->second;
676 }
677 }
678
680 int NumHomogeneousDir, std::string var = "DefaultVar",
681 bool NewField = false)
682 {
683 if (var.compare("DefaultVar") == 0 && m_requireBoundaryExpansion)
684 {
685 if (m_session->GetVariables().size())
686 {
687 var = m_session->GetVariables()[0];
688 }
689 }
691 switch (m_graph->GetMeshDimension())
692 {
693 case 1:
694 {
695 if (NumHomogeneousDir == 1)
696 {
699 "ContFieldHomogeneous1D or "
700 "DisContFieldHomogenenous1D has not been "
701 "implemented");
702
704 std::dynamic_pointer_cast<
706
708 AllocateSharedPtr(*tmp2);
709 }
710 else if (NumHomogeneousDir == 2)
711 {
713 {
715 std::dynamic_pointer_cast<
717 m_exp[0]);
718
719 tmp = MemoryManager<
721 AllocateSharedPtr(*tmp2);
722 }
724 {
726 tmp2 = std::dynamic_pointer_cast<
728 m_exp[0]);
729
730 tmp = MemoryManager<
732 AllocateSharedPtr(*tmp2);
733 }
734 else
735 {
737 std::dynamic_pointer_cast<
739
740 tmp = MemoryManager<
742 AllocateSharedPtr(*tmp2);
743 }
744 }
745 else
746 {
748 {
750 std::dynamic_pointer_cast<MultiRegions::ContField>(
751 m_exp[0]);
752
755 false,
757 }
759 {
761 std::dynamic_pointer_cast<
763
767 }
768 else
769 {
771 std::dynamic_pointer_cast<MultiRegions::ExpList>(
772 m_exp[0]);
773
774 tmp = MemoryManager<
775 MultiRegions::ExpList>::AllocateSharedPtr(*tmp2);
776 }
777 }
778 }
779 break;
780 case 2:
781 {
782 if (NumHomogeneousDir == 1)
783 {
785 {
786 if (NewField)
787 {
788 bool dealiasing = false;
789
790 tmp = MemoryManager<
792 AllocateSharedPtr(m_session,
793 m_exp[0]
794 ->GetHomogeneousBasis()
795 ->GetBasisKey(),
796 m_exp[0]->GetHomoLen(),
797 m_useFFT, dealiasing, m_graph,
798 var,
800 }
801 else
802 {
804 tmp2 = std::dynamic_pointer_cast<
806 m_exp[0]);
807
808 ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
809 tmp = MemoryManager<
811 AllocateSharedPtr(*tmp2, m_graph, var);
812 }
813 }
815 {
816 if (NewField)
817 {
818 bool dealiasing = false;
819
820 tmp = MemoryManager<
822 AllocateSharedPtr(m_session,
823 m_exp[0]
824 ->GetHomogeneousBasis()
825 ->GetBasisKey(),
826 m_exp[0]->GetHomoLen(),
827 m_useFFT, dealiasing, m_graph,
828 var,
830 }
831 else
832 {
834 tmp2 = std::dynamic_pointer_cast<
836 m_exp[0]);
837 ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
838
839 tmp = MemoryManager<
841 AllocateSharedPtr(*tmp2);
842 }
843 }
844 else
845 {
846 if (NewField)
847 {
848 bool dealiasing = false;
849
850 tmp = MemoryManager<
852 AllocateSharedPtr(m_session,
853 m_exp[0]
854 ->GetHomogeneousBasis()
855 ->GetBasisKey(),
856 m_exp[0]->GetHomoLen(),
857 m_useFFT, dealiasing, m_graph,
858 "DefaultVar",
860 }
861 else
862 {
864 std::dynamic_pointer_cast<
866 m_exp[0]);
867 ASSERTL0(tmp2, "Failed to type cast m_exp[0]");
868
869 tmp = MemoryManager<
871 AllocateSharedPtr(*tmp2);
872 }
873 }
874 }
875 else
876 {
878 {
879 if (NewField)
880 {
883 false,
885 }
886 else // call copy constructor
887 {
888
890 std::dynamic_pointer_cast<
892
894 AllocateSharedPtr(*tmp2, m_graph, var);
895 }
896 }
898 {
899 if (NewField)
900 {
903 true,
905 }
906 else // call copy constructor
907 {
909 std::dynamic_pointer_cast<
911
913 AllocateSharedPtr(*tmp2, m_graph, var);
914 }
915 }
916 else
917 {
919 std::dynamic_pointer_cast<MultiRegions::ExpList>(
920 m_exp[0]);
921
922 tmp = MemoryManager<
923 MultiRegions::ExpList>::AllocateSharedPtr(*tmp2);
924 }
925 }
926 }
927 break;
928 case 3:
929 {
931 {
932 if (NewField)
933 {
936 false,
938 }
939 else
940 {
942 std::dynamic_pointer_cast<MultiRegions::ContField>(
943 m_exp[0]);
944
945 tmp = MemoryManager<
946 MultiRegions::ContField>::AllocateSharedPtr(*tmp2,
947 m_graph,
948 var);
949 }
950 }
952 {
953 if (NewField)
954 {
958 }
959 else
960 {
962 std::dynamic_pointer_cast<
964
966 AllocateSharedPtr(*tmp2, m_graph, var);
967 }
968 }
969 else
970 {
972 std::dynamic_pointer_cast<MultiRegions::ExpList>(
973 m_exp[0]);
974
975 tmp =
977 *tmp2);
978 }
979 }
980 break;
981 default:
982 ASSERTL0(false, "Expansion dimension not recognised");
983 break;
984 }
985
986 return tmp;
987 }
988
990 {
994 m_exp.clear();
995 m_fielddef = std::vector<LibUtilities::FieldDefinitionsSharedPtr>();
996 m_data = std::vector<std::vector<NekDouble>>();
997 m_variables.clear();
998 }
999
1002 {
1003 ClearField();
1004
1005 m_exp.resize(exp.size());
1006 m_variables.resize(exp.size());
1007
1008 if (exp.size() == 0)
1009 {
1010 return;
1011 }
1012
1013 m_session = exp[0]->GetSession();
1014 m_graph = exp[0]->GetGraph();
1015 m_comm = m_session->GetComm();
1016
1017 for (int i = 0; i < exp.size(); ++i)
1018 {
1019 m_exp[i] = exp[i];
1020 m_variables[i] = m_session->GetVariable(i);
1021 }
1022 }
1023
1024private:
1025 /// Map to store FieldIO instances. Key is the reader type, value is the
1026 /// FieldIO object.
1027 std::map<std::string, LibUtilities::FieldIOSharedPtr> m_fld;
1028};
1029
1030typedef std::shared_ptr<Field> FieldSharedPtr;
1031} // namespace Nektar::FieldUtils
1032
1033#endif
#define ASSERTL0(condition, msg)
#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:94
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...
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:98
std::shared_ptr< Field > FieldSharedPtr
Definition Field.hpp:1030
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:69
@ 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:65
@ eFourierHalfModeRe
Fourier Modified expansions with just the real part of the first mode .
Definition BasisType.h:67
@ eFourier
Fourier Expansion .
Definition BasisType.h:55
std::shared_ptr< DisContField3DHomogeneous2D > DisContField3DHomogeneous2DSharedPtr
std::shared_ptr< DisContField3DHomogeneous1D > DisContField3DHomogeneous1DSharedPtr
std::shared_ptr< DisContField > DisContFieldSharedPtr
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:295
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition MeshGraph.h:224
FIELD_UTILS_EXPORT void SetupFromExpList(Array< OneD, MultiRegions::ExpListSharedPtr > &exp)
Definition Field.hpp:1000
LibUtilities::CommSharedPtr m_partComm
Definition Field.hpp:90
FIELD_UTILS_EXPORT void ReadFieldDefs()
Definition Field.hpp:299
FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr SetUpFirstExpList(int NumHomogeneousDir, bool fldfilegiven=false)
Definition Field.hpp:339
FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr AppendExpList(int NumHomogeneousDir, std::string var="DefaultVar", bool NewField=false)
Definition Field.hpp:679
FIELD_UTILS_EXPORT ~Field()=default
bool m_declareExpansionAsDisContField
Definition Field.hpp:82
po::variables_map m_vm
Definition Field.hpp:92
SpatialDomains::MeshGraphSharedPtr m_graph
Definition Field.hpp:95
std::vector< std::string > m_variables
Definition Field.hpp:77
std::vector< unsigned int > m_bndRegionsToWrite
Definition Field.hpp:99
LibUtilities::SessionReaderSharedPtr m_session
Definition Field.hpp:94
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:1027
std::map< std::string, std::vector< std::string > > m_inputfiles
Definition Field.hpp:96
FIELD_UTILS_EXPORT Field()
Definition Field.hpp:62
FIELD_UTILS_EXPORT void SetUpExp(boost::program_options::variables_map &vm, bool equispaced=false)
Definition Field.hpp:106
FIELD_UTILS_EXPORT void ClearField()
Definition Field.hpp:989
std::vector< LibUtilities::FieldDefinitionsSharedPtr > m_fielddef
Definition Field.hpp:73
FIELD_UTILS_EXPORT void CreateExp(boost::program_options::variables_map &vm, bool newExp, bool equispaced=false)
Definition Field.hpp:119
LibUtilities::PtsFieldSharedPtr m_fieldPts
Definition Field.hpp:102
std::vector< std::vector< double > > m_data
Definition Field.hpp:74
std::vector< MultiRegions::ExpListSharedPtr > m_exp
Definition Field.hpp:75
LibUtilities::CommSharedPtr m_comm
Definition Field.hpp:88
LibUtilities::CommSharedPtr m_defComm
Definition Field.hpp:89
FIELD_UTILS_EXPORT LibUtilities::FieldIOSharedPtr FieldIOForFile(std::string filename)
Construct a FieldIO object for the file filename.
Definition Field.hpp:658
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap
Definition Field.hpp:104