Skip to content
Snippets Groups Projects
Commit 3ca6679f authored by Xavier Adriaens's avatar Xavier Adriaens
Browse files

Merge branch 'OptiAntho' into 'MultiParameter'

Opti

See merge request !3
parents 742629ca 840b87bc
Branches MultiParameter
No related tags found
1 merge request!3Opti
...@@ -47,13 +47,18 @@ void WaveMultiField<T_Physic>::write(std::string name) const ...@@ -47,13 +47,18 @@ void WaveMultiField<T_Physic>::write(std::string name) const
template<Physic T_Physic> template<Physic T_Physic>
void WaveAuxilaryField<T_Physic>::assignValues(const std::vector< std::complex<double> > &values) void WaveAuxilaryField<T_Physic>::assignValues(const std::vector< std::complex<double> > &values)
{ {
unsigned int i = 0; if(_systemValuesToDofValues.size() == 0) {
for(auto it = _wmf->_field.begin(); it != _wmf->_field.end(); it++) _systemValuesToDofValues.reserve(values.size());
{ for(auto it = _wmf->_field.begin(); it != _wmf->_field.end(); it++)
if(it->first->type() == gmshfem::dofs::Type::Unknown) {
{ if(it->first->type() == gmshfem::dofs::Type::Unknown)
_wmf->_dofValues[_index][i++] = values[it->first->numDof() - 1]; {
} _systemValuesToDofValues.push_back(it->first->numDof() - 1);
}
}
}
for(unsigned int i = 0; i < values.size(); ++i) {
_wmf->_dofValues[_index][i] = values[_systemValuesToDofValues[i]];
} }
} }
......
...@@ -47,8 +47,9 @@ class WaveAuxilaryField : public WaveField<T_Physic> ...@@ -47,8 +47,9 @@ class WaveAuxilaryField : public WaveField<T_Physic>
private: private:
WaveMultiField<T_Physic>* _wmf; WaveMultiField<T_Physic>* _wmf;
unsigned int _index; unsigned int _index;
std::vector< unsigned int > _systemValuesToDofValues;
public: public:
WaveAuxilaryField(std::string name, gmshfem::domain::Domain domain, std::string gmodel, const wave::Discretization<T_Physic>& w_discret): WaveField<T_Physic>(name,domain,gmodel,w_discret), _wmf(nullptr), _index(0) {}; WaveAuxilaryField(std::string name, gmshfem::domain::Domain domain, std::string gmodel, const wave::Discretization<T_Physic>& w_discret): WaveField<T_Physic>(name,domain,gmodel,w_discret), _wmf(nullptr), _index(0), _systemValuesToDofValues() {};
void setField(WaveMultiField<T_Physic>* wmf){_wmf=wmf;}; void setField(WaveMultiField<T_Physic>* wmf){_wmf=wmf;};
void setIndex(unsigned int index){_index=index;}; void setIndex(unsigned int index){_index=index;};
virtual void assignValues(const std::vector< std::complex<double> > &values) override; virtual void assignValues(const std::vector< std::complex<double> > &values) override;
......
...@@ -19,7 +19,7 @@ Data<Physic::acoustic> wave_to_data(const ConfigurationInterface* const config, ...@@ -19,7 +19,7 @@ Data<Physic::acoustic> wave_to_data(const ConfigurationInterface* const config,
{ {
for (unsigned int r = 0; r < config->nr(s); r++) for (unsigned int r = 0; r < config->nr(s); r++)
{ {
PointData<Physic::acoustic> buffer(integrate(1.0*w[s],config->receiver(s,r),"Gauss1")); PointData<Physic::acoustic> buffer(integrate(ScalarFunction< std::complex< double > >(w[s]),config->receiver(s,r),"Gauss1"));
v.value(s,r,buffer); v.value(s,r,buffer);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment