gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
PViewFactory.cpp
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #include "PViewFactory.h"
7 #include "GModel.h"
8 #include "fullMatrix.h"
9 #include "PView.h"
10 #include <vector>
11 
12 PViewFactory::PViewFactory(std::string name, std::string type, GModel *model,
13  int timeStep, int dim)
14  : _name(name), _type(type), _dim(dim), _timeStep(timeStep), _model(model)
15 {
16 }
17 
19 {
20  std::vector<double> &vv = _values[id];
21  vv.resize(val.size1() * val.size2());
22  int k = 0;
23  for(int i = 0; i < val.size1(); i++) {
24  for(int j = 0; j < val.size2(); j++) { vv[k++] = val(i, j); }
25  }
26 }
27 
29 {
30  return new PView(_name, _type, _model, _values, _timeStep, _dim);
31 }
PView
Definition: PView.h:27
PView.h
PViewFactory::_timeStep
int _timeStep
Definition: PViewFactory.h:23
PViewFactory::_name
std::string _name
Definition: PViewFactory.h:22
fullMatrix< double >
PViewFactory::setEntry
void setEntry(int id, const fullMatrix< double > &val)
Definition: PViewFactory.cpp:18
PViewFactory::createView
PView * createView()
Definition: PViewFactory.cpp:28
GModel
Definition: GModel.h:44
PViewFactory::PViewFactory
PViewFactory(std::string name, std::string type, GModel *model, int timeStep, int dim=3)
Definition: PViewFactory.cpp:12
PViewFactory.h
PViewFactory::_values
std::map< int, std::vector< double > > _values
Definition: PViewFactory.h:21
PViewFactory::_model
GModel * _model
Definition: PViewFactory.h:24
PViewFactory::_dim
int _dim
Definition: PViewFactory.h:23
fullMatrix::size2
int size2() const
Definition: fullMatrix.h:275
fullMatrix::size1
int size1() const
Definition: fullMatrix.h:274
GModel.h
fullMatrix.h
PViewFactory::_type
std::string _type
Definition: PViewFactory.h:22