Skip to content
Snippets Groups Projects
Commit 87547641 authored by ismail badia's avatar ismail badia
Browse files

add a new InterfaceField constructor

parent 87b26906
No related branches found
No related tags found
1 merge request!12Faster ddm solve
...@@ -73,6 +73,22 @@ namespace gmshddm ...@@ -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 > template< class T_Scalar, gmshfem::field::Form T_Form >
InterfaceField< T_Scalar, T_Form >::InterfaceField(const InterfaceField< T_Scalar, T_Form > &other) : InterfaceField< T_Scalar, T_Form >::InterfaceField(const InterfaceField< T_Scalar, T_Form > &other) :
InterfaceFieldInterface< T_Scalar >(other._name), _fields(other._fields) InterfaceFieldInterface< T_Scalar >(other._name), _fields(other._fields)
......
...@@ -42,6 +42,8 @@ namespace gmshddm ...@@ -42,6 +42,8 @@ namespace gmshddm
InterfaceField(); 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 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<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(const InterfaceField< T_Scalar, T_Form > &other);
InterfaceField(InterfaceField< T_Scalar, T_Form > &&other); InterfaceField(InterfaceField< T_Scalar, T_Form > &&other);
~InterfaceField(); ~InterfaceField();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment