diff --git a/ConSol/ConSol/Flux/NumFlux.cpp b/ConSol/ConSol/Flux/NumFlux.cpp index cf6e774..6a8a148 100644 --- a/ConSol/ConSol/Flux/NumFlux.cpp +++ b/ConSol/ConSol/Flux/NumFlux.cpp @@ -1,108 +1,108 @@ // // NumFlux.cpp // ConserSolver // // Created by Fabian Moenkeberg on 05.05.17. // Copyright © 2017 FabianMoenkeberg. All rights reserved. // class NetFlux; #include "NumFlux.hpp" #include NumFlux::NumFlux(MeshBase *mesh, Source *source, ModelBase *model, Reconstruct *reconstr){ this->mesh = mesh; this->source = source; this->model = model; this->reconstr = reconstr; this->netFlux2 = new NetFlux(); } //NumFlux::NumFlux(NumFlux const &flux) //: mesh(flux.mesh), source(flux.source), model(flux.model){}; NetFlux* NumFlux::F(){ // NetFlux* ret = new NetFlux();; return netFlux2; }; void NumFlux::initialize(MeshBase *mesh, Source *source, ModelBase *model, Reconstruct *reconstr, Configuration config){ this->mesh = mesh; this->source = source; this->model = model; this->reconstr = reconstr; this->nThreads = config.getNthreads(); if (nThreads == 0){ nThreads = omp_get_max_threads(); } std::cout << " Reconstruction: Running threads: " << nThreads << " out of " << omp_get_max_threads() << "\n"; netFlux2->initialize(model, reconstr->getQWeights()); std::vectorsubmeshEdg0 = mesh->getSubmeshEdg0(); UReconstr.resize(2,std::vector>>(submeshEdg0.back(), std::vector>(0,std::vector(mesh->getNelem())))); for (int i = 0; i < submeshEdg0[1]; i++){ UReconstr[0][i].resize(reconstr->getQWeights().size(),std::vector(mesh->getNelem())); UReconstr[1][i].resize(reconstr->getQWeights().size(),std::vector(mesh->getNelem())); } for (int i = submeshEdg0[1]; i < submeshEdg0.back(); i++){ UReconstr[0][i+submeshEdg0[0]].resize(1,std::vector(mesh->getNelem())); UReconstr[1][i+submeshEdg0[0]].resize(1,std::vector(mesh->getNelem())); } } void NumFlux::netFlux(std::vector> &numFlux, std::vector> &U, double t, double dt){ // std::vector>>> UReconstr; // std::cout << "URecsize: " << UReconstr.size()<< ","<< UReconstr[0].size() << "," <reconstruct(UReconstr, U, mesh, t); NetFlux* net = this->F(); mesh->netFlux(numFlux, net ,U ,UReconstr, t, dt); // reconstr->reconstruct(numFlux, net, U, mesh, t, dt); if (source->getIsUsed()){ - source->source(U, mesh, t, dt,numFlux) + source->source(U, mesh, t, dt,numFlux); // int dim1 = (int)mesh->getNinternal(); // int dim2 = (int)numFlux[0].size(); // omp_set_num_threads(nThreads); //#pragma omp parallel for // for (int i = 0; i < dim1; i++) { // // int indInternal = mesh->getInternal(i); //// if (indInternal == 1205){ //// std::cout << indInternal; //// } // std::vector addSource = source->source(U, mesh, t, dt, indInternal); // for (int j = 0; j < dim2; j++){ // numFlux[indInternal][j] = numFlux[indInternal][j] + addSource[j]; // } // } } }; std::vector> NumFlux::f(std::vector> U, int dir){ std::vector> ret = this->model->f(U, dir); return ret; }; std::vector NumFlux::f(std::vector U, int dir){ std::vector ret = this->model->f(U, dir); return ret; }; MeshBase* NumFlux::getMesh(){ return mesh; } ModelBase* NumFlux::getModel(){ return model; } FluxName NumFlux::getName() {return name;};