diff --git a/src/field/InterfaceField.cpp b/src/field/InterfaceField.cpp index 87f6213b2786a28b696735f44e5775e0ccdc7575..dd90c14bee05b7501555abe6b8329a1309c3ae94 100644 --- a/src/field/InterfaceField.cpp +++ b/src/field/InterfaceField.cpp @@ -73,6 +73,22 @@ namespace gmshddm } } + template< class T_Scalar, gmshfem::field::Form T_Form > + InterfaceField< T_Scalar, T_Form >::InterfaceField(const std::string &name, const domain::Interface &domains, const gmshfem::field::FunctionSpaceOfForm< T_Form > &type,const std::vector<std::vector<unsigned int>> & degree) : + InterfaceFieldInterface< T_Scalar >(name), _fields(domains.numberOfSubdomains()) + { + + if(domains.numberOfSubdomains() > degree.size()) { + throw gmshfem::common::Exception("Wrong size of degree"); + } + for(unsigned int i = 0; i < domains.numberOfSubdomains(); ++i) { + for(auto it = domains[i].begin(); it != domains[i].end(); ++it) { + _fields[i].insert(std::make_pair(it->first, gmshfem::field::Field< T_Scalar, T_Form >(this->_name + "_" + std::to_string(i) + "_" + std::to_string(it->first), it->second, type, degree[i][it->first]))); + + } + } + } + template< class T_Scalar, gmshfem::field::Form T_Form > InterfaceField< T_Scalar, T_Form >::InterfaceField(const InterfaceField< T_Scalar, T_Form > &other) : InterfaceFieldInterface< T_Scalar >(other._name), _fields(other._fields) diff --git a/src/field/InterfaceField.h b/src/field/InterfaceField.h index c728243fbc3f5b4760077e3e4f4a3a226c623090..2817bef29dc1560688fbb5868d67febef7e472d9 100644 --- a/src/field/InterfaceField.h +++ b/src/field/InterfaceField.h @@ -42,6 +42,8 @@ namespace gmshddm InterfaceField(); InterfaceField(const std::string &name, const domain::Interface &domains, const gmshfem::field::FunctionSpaceOfForm< T_Form > &type, const unsigned int degree = 1); InterfaceField(const std::string &name, const domain::Interface &domains, const gmshfem::field::FunctionSpaceOfForm< T_Form > &type, const std::vector<unsigned int> & degree); + + InterfaceField(const std::string &name, const domain::Interface &domains, const gmshfem::field::FunctionSpaceOfForm< T_Form > &type, const std::vector<std::vector<unsigned int>> & degree); InterfaceField(const InterfaceField< T_Scalar, T_Form > &other); InterfaceField(InterfaceField< T_Scalar, T_Form > &&other); ~InterfaceField();