OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ResultSourceScalar.hpp
Go to the documentation of this file.
1#pragma once
5
6template<class T>
8 : ResultSource(executionBarrier,volumeIter), _doF(doF), GetterOfDoF(GetterDoF)
9{}
10
11template<class T>
13{
14 _volumeIterator->Reset();
15 index_t size = _volumeIterator->GetVolumenSize();
16 double * result = new double[size];
17
18 int i = 0;
19 index_t index = _volumeIterator->GetCurrentIndex();
20 result[i] = *(_doF.*GetterOfDoF)(index);
21
22 while (_volumeIterator->HasNext())
23 {
24 index = _volumeIterator->GetNextIndex();
25 i++;
26 result[i] = *(_doF.*GetterOfDoF)(index);
27 }
28 auto resultContainer = new ResultContainerScalar(result,size, currentTimeStep);
29 return resultContainer;
30}
int result
Definition dllmain.cpp:82
int64_t index_t
Definition SystemDependentDefines.h:13
Definition DegreesOfFreedom3DLoopCPU.h:8
Definition ExecutionBarrier.h:4
Definition IGridIteratorVolume.h:7
Definition ResultContainer.h:5
Definition ResultContainerScalar.h:5
Definition ResultSource.h:9
virtual ResultContainer * GenerateResultContainer(int currentTimeStep) override
Definition ResultSourceScalar.hpp:12
ResultSourceScalar(ExecutionBarrier *executionBarrier, IGridIteratorVolume *volumeIter, DegreesOfFreedom3DLoopCPU< T > &doF, T *(DegreesOfFreedom3DLoopCPU< T >::*GetterDoF)(index_t index) const)
Definition ResultSourceScalar.hpp:7