37 template <
typename GeometryMap,
typename Variable>
38 requires FunctionSpaceType<GeometryMap> && FunctionSpaceType<Variable>
43 typename std::common_type<
typename GeometryMap::value_type,
44 typename Variable::value_type>::type;
54 std::pair<
typename GeometryMap::eval_type,
55 typename GeometryMap::boundary_eval_type>;
59 std::pair<
typename Variable::eval_type,
60 typename Variable::boundary_eval_type>;
81 template <std::size_t... GeometryMapNumCoeffs,
size_t... Is,
82 std::size_t... VariableNumCoeffs,
size_t... Js>
84 std::tuple<std::array<int64_t, GeometryMapNumCoeffs>...>
86 std::index_sequence<Is...>,
87 std::tuple<std::array<int64_t, VariableNumCoeffs>...> variableNumCoeffs,
88 std::index_sequence<Js...>,
103 template <std::
size_t NumCoeffs>
105 std::array<int64_t, NumCoeffs> ncoeffs,
109 template <std::size_t... NumCoeffs>
111 std::tuple<std::array<int64_t, NumCoeffs>...> ncoeffs,
119 template <std::
size_t GeometryMapNumCoeffs, std::
size_t VariableNumCoeffs>
121 std::array<int64_t, GeometryMapNumCoeffs> geometryMapNumCoeffs,
122 std::array<int64_t, VariableNumCoeffs> variableNumCoeffs,
125 std::tuple{variableNumCoeffs}, options) {}
127 template <std::size_t... GeometryMapNumCoeffs,
128 std::size_t... VariableNumCoeffs>
130 std::tuple<std::array<int64_t, GeometryMapNumCoeffs>...>
131 geometryMapNumCoeffs,
132 std::tuple<std::array<int64_t, VariableNumCoeffs>...> variableNumCoeffs,
135 geometryMapNumCoeffs,
136 std::make_index_sequence<sizeof...(GeometryMapNumCoeffs)>{},
138 std::make_index_sequence<
sizeof...(VariableNumCoeffs)>{}, options) {
144 inline const GeometryMap &
G()
const {
return G_; }
148 inline GeometryMap &
G() {
return G_; }
152 inline const Variable &
u()
const {
return u_; }
156 inline Variable &
u() {
return u_; }
165 template <
size_t... Is>
174 ((std::get<Is>(collPts_.first) =
175 G_.template space<Is>().greville(
false)),
179 ((std::get<Is>(collPts_.second) =
G_.template boundary<Is>().greville()),
185 ((std::get<Is>(collPts_.first) =
186 G_.template space<Is>().greville(
true)),
190 ((std::get<Is>(collPts_.second) =
G_.template boundary<Is>().greville()),
196 ((std::get<Is>(collPts_.first) =
197 G_.template space<Is>().clone().uniform_refine().greville(
202 ((std::get<Is>(collPts_.second) =
203 G_.template boundary<Is>().clone().uniform_refine().greville()),
209 ((std::get<Is>(collPts_.first) =
210 G_.template space<Is>().clone().uniform_refine().greville(
215 ((std::get<Is>(collPts_.second) =
216 G_.template boundary<Is>().clone().uniform_refine().greville()),
222 ((std::get<Is>(collPts_.first) =
223 G_.template space<Is>().clone().uniform_refine(2, -1).greville(
228 ((std::get<Is>(collPts_.second) =
G_.template boundary<Is>()
230 .uniform_refine(2, -1)
237 ((std::get<Is>(collPts_.first) =
238 G_.template space<Is>().clone().uniform_refine(2, -1).greville(
243 ((std::get<Is>(collPts_.second) =
G_.template boundary<Is>()
245 .uniform_refine(2, -1)
251 throw std::runtime_error(
"Invalid collocation point specifier");
263 template <
size_t... Is>
265 std::index_sequence<Is...>)
const {
272 ((std::get<Is>(collPts_.first) =
273 u_.template space<Is>().greville(
false)),
277 ((std::get<Is>(collPts_.second) =
u_.template boundary<Is>().greville()),
283 ((std::get<Is>(collPts_.first) =
284 u_.template space<Is>().greville(
true)),
288 ((std::get<Is>(collPts_.second) =
u_.template boundary<Is>().greville()),
294 ((std::get<Is>(collPts_.first) =
295 u_.template space<Is>().clone().uniform_refine().greville(
300 ((std::get<Is>(collPts_.second) =
301 u_.template boundary<Is>().clone().uniform_refine().greville()),
307 ((std::get<Is>(collPts_.first) =
308 u_.template space<Is>().clone().uniform_refine().greville(
313 ((std::get<Is>(collPts_.second) =
314 u_.template boundary<Is>().clone().uniform_refine().greville()),
320 ((std::get<Is>(collPts_.first) =
321 u_.template space<Is>().clone().uniform_refine(2, -1).greville(
326 ((std::get<Is>(collPts_.second) =
u_.template boundary<Is>()
328 .uniform_refine(2, -1)
335 ((std::get<Is>(collPts_.first) =
336 u_.template space<Is>().clone().uniform_refine(2, -1).greville(
341 ((std::get<Is>(collPts_.second) =
u_.template boundary<Is>()
343 .uniform_refine(2, -1)
349 throw std::runtime_error(
"Invalid collocation point specifier");
364 if constexpr (GeometryMap::nspaces() == 1)
369 return {
G_.space().greville(
false),
370 G_.boundary().greville()};
373 return {
G_.space().greville(
true),
374 G_.boundary().greville()};
378 G_.space().clone().uniform_refine().greville(
false),
379 G_.boundary().clone().uniform_refine().greville()};
383 G_.space().clone().uniform_refine().greville(
true),
384 G_.boundary().clone().uniform_refine().greville()};
387 return {
G_.space().clone().uniform_refine(2, -1).greville(
389 G_.boundary().clone().uniform_refine(2, -1).greville()};
392 return {
G_.space().clone().uniform_refine(2, -1).greville(
394 G_.boundary().clone().uniform_refine(2, -1).greville()};
397 throw std::runtime_error(
"Invalid collocation point specifier");
402 collPts, std::make_index_sequence<GeometryMap::nspaces()>{});
412 if constexpr (Variable::nspaces() == 1)
417 return {
u_.space().greville(
false),
418 u_.boundary().greville()};
421 return {
u_.space().greville(
true),
422 u_.boundary().greville()};
426 u_.space().clone().uniform_refine().greville(
false),
427 u_.boundary().clone().uniform_refine().greville()};
431 u_.space().clone().uniform_refine().greville(
true),
432 u_.boundary().clone().uniform_refine().greville()};
435 return {
u_.space().clone().uniform_refine(2, -1).greville(
437 u_.boundary().clone().uniform_refine(2, -1).greville()};
440 return {
u_.space().clone().uniform_refine(2, -1).greville(
442 u_.boundary().clone().uniform_refine(2, -1).greville()};
445 throw std::runtime_error(
"Invalid collocation point specifier");
450 std::make_index_sequence<Variable::nspaces()>{});
457 template <
typename GeometryMap,
typename Variable>
458 requires FunctionSpaceType<GeometryMap> && FunctionSpaceType<Variable>
495 template <std::size_t... GeometryMapNumCoeffs,
size_t... Is,
496 std::size_t... VariableNumCoeffs,
size_t... Js>
498 std::tuple<std::array<int64_t, GeometryMapNumCoeffs>...>
499 geometryMapNumCoeffs,
500 std::index_sequence<Is...>,
501 std::tuple<std::array<int64_t, VariableNumCoeffs>...> variableNumCoeffs,
502 std::index_sequence<Js...>,
505 Base(geometryMapNumCoeffs, variableNumCoeffs, options),
517 template <
size_t NumCoeffs>
518 IgABase(std::array<int64_t, NumCoeffs> ncoeffs,
520 :
IgABase(
std::tuple{ncoeffs},
std::tuple{ncoeffs}, options) {}
522 template <
size_t... NumCoeffs>
523 IgABase(std::tuple<std::array<int64_t, NumCoeffs>...> ncoeffs,
525 :
IgABase(ncoeffs, ncoeffs, options) {}
531 template <std::
size_t GeometryMapNumCoeffs, std::
size_t VariableNumCoeffs>
532 IgABase(std::array<int64_t, GeometryMapNumCoeffs> geometryMapNumCoeffs,
533 std::array<int64_t, VariableNumCoeffs> variableNumCoeffs,
535 :
IgABase(
std::tuple{geometryMapNumCoeffs},
std::tuple{variableNumCoeffs},
538 template <std::size_t... GeometryMapNumCoeffs,
539 std::size_t... VariableNumCoeffs>
541 std::tuple<std::array<int64_t, GeometryMapNumCoeffs>...>
542 geometryMapNumCoeffs,
543 std::tuple<std::array<int64_t, VariableNumCoeffs>...> variableNumCoeffs,
545 :
IgABase(geometryMapNumCoeffs,
546 std::make_index_sequence<sizeof...(GeometryMapNumCoeffs)>{},
548 std::make_index_sequence<
sizeof...(VariableNumCoeffs)>{},
554 inline const Variable &
f()
const {
return f_; }
558 inline Variable &
f() {
return f_; }
568 template <
typename T>
570 std::vector<torch::Tensor> &v) {
572 std::filesystem::path path(location);
574 if (std::filesystem::exists(path)) {
575 if (std::filesystem::is_regular_file(path)) {
577 pugi::xml_document doc;
578 doc.load_file(path.c_str());
579 v.emplace_back(obj.from_xml(doc).as_tensor());
582 }
else if (std::filesystem::is_directory(path)) {
583 for (
const auto &file : std::filesystem::directory_iterator(path)) {
584 if (file.is_regular_file() && file.path().extension() ==
".xml") {
586 pugi::xml_document doc;
587 doc.load_file(file.path().c_str());
588 v.emplace_back(obj.from_xml(doc).as_tensor());
594 throw std::runtime_error(
595 "The path refers to neither a file nor a directory");
597 throw std::runtime_error(
"The path does not exist");
611 public torch::data::Dataset<
613 torch::data::Example<torch::Tensor, torch::data::example::NoTarget>> {
616 std::vector<torch::Tensor>
G_;
619 std::vector<torch::Tensor>
f_;
624 torch::data::Example<torch::Tensor, torch::data::example::NoTarget>;
629 read_from_xml(location, obj, G_);
633 read_from_xml(location, obj, G_);
639 template <
typename T>
641 std::string label =
"") {
642 G_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
645 template <
typename T>
647 std::string label =
"") {
648 G_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
654 template <
typename T>
656 std::string label =
"") {
657 G_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
660 template <
typename T>
662 std::string label =
"") {
663 G_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
670 read_from_xml(location, obj, f_);
674 read_from_xml(location, obj, f_);
680 template <
typename T>
682 std::string label =
"") {
683 f_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
686 template <
typename T>
688 std::string label =
"") {
689 f_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
695 template <
typename T>
697 std::string label =
"") {
698 f_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
701 template <
typename T>
703 std::string label =
"") {
704 f_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
710 template <
typename T,
typename Func>
712 f_.emplace_back(obj.transform(
func).as_tensor());
715 template <
typename T,
typename Func>
717 f_.emplace_back(obj.transform(
func).as_tensor());
724 std::size_t geo_index = index / (f_.empty() ? 1 : f_.size());
725 std::size_t ref_index = index - geo_index * f_.size();
729 return torch::cat({G_.at(geo_index), f_.at(ref_index)});
731 return G_.at(geo_index);
734 return f_.at(ref_index);
736 throw std::runtime_error(
"No geometry maps and reference data");
741 inline torch::optional<std::size_t>
size()
const override {
742 return (G_.empty() ? 1 : G_.size()) * (f_.empty() ? 1 : f_.size());
749 public torch::data::Dataset<IgADataset<true>, torch::data::Example<>> {
752 std::vector<torch::Tensor>
G_;
755 std::vector<torch::Tensor>
f_;
758 std::vector<torch::Tensor>
u_;
764 read_from_xml(location, obj, G_);
768 read_from_xml(location, obj, G_);
774 template <
typename T>
776 std::string label =
"") {
777 G_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
780 template <
typename T>
782 std::string label =
"") {
783 G_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
789 template <
typename T>
791 std::string label =
"") {
792 G_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
795 template <
typename T>
797 std::string label =
"") {
798 G_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
805 read_from_xml(location, obj, f_);
809 read_from_xml(location, obj, f_);
815 template <
typename T>
817 std::string label =
"") {
818 f_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
821 template <
typename T>
823 std::string label =
"") {
824 f_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
830 template <
typename T>
832 std::string label =
"") {
833 f_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
836 template <
typename T>
838 std::string label =
"") {
839 f_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
845 template <
typename T,
typename Func>
847 f_.emplace_back(obj.transform(
func).as_tensor());
850 template <
typename T,
typename Func>
852 f_.emplace_back(obj.transform(
func).as_tensor());
858 template <
typename T>
void add_solution(T &obj, std::string location) {
859 read_from_xml(location, obj, u_);
862 template <
typename T>
void add_solution(T &&obj, std::string location) {
863 read_from_xml(location, obj, u_);
869 template <
typename T>
871 std::string label =
"") {
872 u_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
875 template <
typename T>
877 std::string label =
"") {
878 u_.emplace_back(obj.from_xml(doc.child(
"xml"),
id, label).as_tensor());
884 template <
typename T>
886 std::string label =
"") {
887 u_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
890 template <
typename T>
892 std::string label =
"") {
893 u_.emplace_back(obj.from_xml(root,
id, label).as_tensor());
898 inline torch::data::Example<>
get(std::size_t index)
override {
900 std::size_t geo_index = index / (f_.empty() ? 1 : f_.size());
901 std::size_t ref_index = index - geo_index * f_.size();
905 return {torch::cat({G_.at(geo_index), f_.at(ref_index)}), u_.at(index)};
907 return {G_.at(geo_index), u_.at(index)};
910 return {f_.at(ref_index), u_.at(index)};
912 throw std::runtime_error(
"No geometry maps and reference data");
917 inline torch::optional<std::size_t>
size()
const override {
918 return (G_.empty() ? 1 : G_.size()) * (f_.empty() ? 1 : f_.size());
IgA base class.
Definition igabase.hpp:459
Variable f_
Spline representation of the reference data.
Definition igabase.hpp:490
IgABase(std::array< int64_t, NumCoeffs > ncoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (same for geometry map and variables)
Definition igabase.hpp:518
const Variable & f() const
Returns a constant reference to the spline representation of the reference data.
Definition igabase.hpp:554
IgABase(std::tuple< std::array< int64_t, GeometryMapNumCoeffs >... > geometryMapNumCoeffs, std::tuple< std::array< int64_t, VariableNumCoeffs >... > variableNumCoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (different for geometry map and variables)
Definition igabase.hpp:540
IgABase(std::array< int64_t, GeometryMapNumCoeffs > geometryMapNumCoeffs, std::array< int64_t, VariableNumCoeffs > variableNumCoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (different for geometry map and variables)
Definition igabase.hpp:532
IgABaseNoRefData< GeometryMap, Variable > Base
Base type.
Definition igabase.hpp:462
Variable & f()
Returns a non-constant reference to the spline representation of the reference data.
Definition igabase.hpp:558
Variable variable_type
Type of the variable function space(s)
Definition igabase.hpp:471
typename Base::value_type value_type
Value type.
Definition igabase.hpp:465
IgABase(std::tuple< std::array< int64_t, GeometryMapNumCoeffs >... > geometryMapNumCoeffs, std::index_sequence< Is... >, std::tuple< std::array< int64_t, VariableNumCoeffs >... > variableNumCoeffs, std::index_sequence< Js... >, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (different for Geometry and Variable types)
Definition igabase.hpp:497
typename Base::variable_collPts_type variable_collPts_type
Type of the variable collocation points.
Definition igabase.hpp:477
IgABase(iganet::Options< value_type > options=iganet::Options< value_type >{})
Default constructor.
Definition igabase.hpp:510
IgABase(std::tuple< std::array< int64_t, NumCoeffs >... > ncoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (same for geometry map and variables)
Definition igabase.hpp:523
GeometryMap geometryMap_type
Type of the geometry map function space(s)
Definition igabase.hpp:468
static bool constexpr has_GeometryMap
Indicates whether this class provides a geometry map.
Definition igabase.hpp:480
typename Base::geometryMap_collPts_type geometryMap_collPts_type
Type of the geometry map collocation points.
Definition igabase.hpp:474
static bool constexpr has_Solution
Indicates whether this class provides a solution.
Definition igabase.hpp:486
static bool constexpr has_RefData
Indicates whether this class provides a reference solution.
Definition igabase.hpp:483
IgA base class (no reference data)
Definition igabase.hpp:39
virtual variable_collPts_type variable_collPts(enum collPts collPts) const
Returns the variable collocation points.
Definition igabase.hpp:411
IgABaseNoRefData(std::tuple< std::array< int64_t, GeometryMapNumCoeffs >... > geometryMapNumCoeffs, std::tuple< std::array< int64_t, VariableNumCoeffs >... > variableNumCoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (different for geometry map and variables)
Definition igabase.hpp:129
virtual geometryMap_collPts_type geometryMap_collPts(enum collPts collPts) const
Returns the geometry map collocation points.
Definition igabase.hpp:363
GeometryMap geometryMap_type
Type of the geometry map function space(s)
Definition igabase.hpp:47
geometryMap_collPts_type geometryMap_collPts(enum collPts collPts, std::index_sequence< Is... >) const
Returns the geometry map collocation points.
Definition igabase.hpp:167
typename std::common_type< typename GeometryMap::value_type, typename Variable::value_type >::type value_type
Value type.
Definition igabase.hpp:44
IgABaseNoRefData(std::tuple< std::array< int64_t, NumCoeffs >... > ncoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (same for geometry map and variables)
Definition igabase.hpp:110
std::pair< typename Variable::eval_type, typename Variable::boundary_eval_type > variable_collPts_type
Type of the variable collocation points.
Definition igabase.hpp:60
const Variable & u() const
Returns a constant reference to the spline representation of the solution.
Definition igabase.hpp:152
IgABaseNoRefData(std::array< int64_t, GeometryMapNumCoeffs > geometryMapNumCoeffs, std::array< int64_t, VariableNumCoeffs > variableNumCoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (different for geometry map and variables)
Definition igabase.hpp:120
Variable variable_type
Type of the variable function space(s)
Definition igabase.hpp:50
IgABaseNoRefData(iganet::Options< value_type > options=iganet::Options< value_type >{})
Default constructor.
Definition igabase.hpp:96
IgABaseNoRefData(std::array< int64_t, NumCoeffs > ncoeffs, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (same for geometry map and variables)
Definition igabase.hpp:104
static bool constexpr has_GeometryMap
Indicates whether this class provides a geometry map.
Definition igabase.hpp:63
static bool constexpr has_RefData
Indicates whether this class provides reference data.
Definition igabase.hpp:66
variable_collPts_type variable_collPts(enum collPts collPts, std::index_sequence< Is... >) const
Returns the variable collocation points.
Definition igabase.hpp:264
GeometryMap G_
Spline representation of the geometry map.
Definition igabase.hpp:73
IgABaseNoRefData(std::tuple< std::array< int64_t, GeometryMapNumCoeffs >... > geometryMapNumCoeffs, std::index_sequence< Is... >, std::tuple< std::array< int64_t, VariableNumCoeffs >... > variableNumCoeffs, std::index_sequence< Js... >, iganet::Options< value_type > options=iganet::Options< value_type >{})
Constructor: number of spline coefficients (different for Geometry and Variable types)
Definition igabase.hpp:83
Variable u_
Spline representation of the solution.
Definition igabase.hpp:76
static bool constexpr has_Solution
Indicates whether this class provides a solution.
Definition igabase.hpp:69
GeometryMap & G()
Returns a non-constant reference to the spline representation of the geometry map.
Definition igabase.hpp:148
Variable & u()
Returns a non-constant reference to the spline representation of the solution.
Definition igabase.hpp:156
std::pair< typename GeometryMap::eval_type, typename GeometryMap::boundary_eval_type > geometryMap_collPts_type
Type of the geometry map collocation points.
Definition igabase.hpp:55
const GeometryMap & G() const
Returns a constant reference to the spline representation of the geometry map.
Definition igabase.hpp:144
void add_referenceData(T &&obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a reference data set from XML node.
Definition igabase.hpp:702
void add_referenceData(T &&obj, std::string location)
Adds a reference data set from file.
Definition igabase.hpp:673
void add_referenceData(T &obj, Func func)
Adds a reference data set from XML node.
Definition igabase.hpp:711
void add_referenceData(T &obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a reference data set from XML node.
Definition igabase.hpp:696
std::vector< torch::Tensor > G_
Vector of tensors representing the geometry maps.
Definition igabase.hpp:616
std::vector< torch::Tensor > f_
Vector of tensors representing the reference data.
Definition igabase.hpp:619
void add_referenceData(T &obj, std::string location)
Adds a reference data set from file.
Definition igabase.hpp:669
void add_geometryMap(T &&obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a geometry map from XML node.
Definition igabase.hpp:661
void add_geometryMap(T &obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a geometry map from XML object.
Definition igabase.hpp:640
void add_geometryMap(T &&obj, std::string location)
Adds a geometry map from file.
Definition igabase.hpp:632
void add_referenceData(T &&obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a reference data set from XML object.
Definition igabase.hpp:687
void add_geometryMap(T &&obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a geometry map from XML object.
Definition igabase.hpp:646
torch::data::Example< torch::Tensor, torch::data::example::NoTarget > example_type
Example type.
Definition igabase.hpp:624
void add_geometryMap(T &obj, std::string location)
Adds a geometry map from file.
Definition igabase.hpp:628
void add_referenceData(T &&obj, Func func)
Adds a reference data set from XML node.
Definition igabase.hpp:716
example_type get(std::size_t index) override
Returns the data set at location index.
Definition igabase.hpp:722
torch::optional< std::size_t > size() const override
Definition igabase.hpp:741
void add_referenceData(T &obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a reference data set from XML object.
Definition igabase.hpp:681
void add_geometryMap(T &obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a geometry map from XML node.
Definition igabase.hpp:655
torch::optional< std::size_t > size() const override
Definition igabase.hpp:917
std::vector< torch::Tensor > G_
Vector of tensors representing the geometry maps.
Definition igabase.hpp:752
void add_geometryMap(T &&obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a geometry map from XML node.
Definition igabase.hpp:796
void add_geometryMap(T &obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a geometry map from XML object.
Definition igabase.hpp:775
void add_referenceData(T &obj, Func func)
Adds a reference data set from XML node.
Definition igabase.hpp:846
void add_referenceData(T &&obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a reference data set from XML object.
Definition igabase.hpp:822
void add_solution(T &obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a solution from XML object.
Definition igabase.hpp:870
std::vector< torch::Tensor > f_
Vector of tensors representing the reference data.
Definition igabase.hpp:755
void add_referenceData(T &&obj, Func func)
Adds a reference data set from XML node.
Definition igabase.hpp:851
void add_geometryMap(T &&obj, std::string location)
Adds a geometry map from file.
Definition igabase.hpp:767
void add_referenceData(T &&obj, std::string location)
Adds a reference data set from file.
Definition igabase.hpp:808
void add_solution(T &&obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a solution from XML object.
Definition igabase.hpp:876
torch::data::Example get(std::size_t index) override
Returns the data set at location index.
Definition igabase.hpp:898
void add_referenceData(T &obj, std::string location)
Adds a reference data set from file.
Definition igabase.hpp:804
void add_referenceData(T &&obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a reference data set from XML node.
Definition igabase.hpp:837
void add_solution(T &&obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a solution from XML node.
Definition igabase.hpp:891
void add_referenceData(T &obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a reference data set from XML object.
Definition igabase.hpp:816
void add_solution(T &obj, std::string location)
Adds a solution from file.
Definition igabase.hpp:858
void add_solution(T &obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a solution from XML node.
Definition igabase.hpp:885
void add_solution(T &&obj, std::string location)
Adds a solution from file.
Definition igabase.hpp:862
std::vector< torch::Tensor > u_
Vector of tensors representing the solution data.
Definition igabase.hpp:758
void add_geometryMap(T &&obj, const pugi::xml_document &doc, int id=0, std::string label="")
Adds a geometry map from XML object.
Definition igabase.hpp:781
void add_referenceData(T &obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a reference data set from XML node.
Definition igabase.hpp:831
void add_geometryMap(T &obj, std::string location)
Adds a geometry map from file.
Definition igabase.hpp:763
void add_geometryMap(T &obj, const pugi::xml_node &root, int id=0, std::string label="")
Adds a geometry map from XML node.
Definition igabase.hpp:790
IgA dataset base class.
Definition igabase.hpp:565
void read_from_xml(std::string location, T &obj, std::vector< torch::Tensor > &v)
Reads a function space from file.
Definition igabase.hpp:569
The Options class handles the automated determination of dtype from the template argument and the sel...
Definition options.hpp:107
Definition boundary.hpp:22
collPts
Enumerator for the collocation point specifier.
Definition igabase.hpp:22
init
Enumerator for specifying the initialization of B-spline coefficients.
Definition bspline.hpp:55
short int short_t
Definition core.hpp:74
IgA dataset class.
Definition igabase.hpp:606