00001
00002
00003
00004
00005
00006
00007 #include "constvelocitymodule.h"
00008
00009 ConstVelocityModule::ConstVelocityModule(OrthoMesh &mesh, Function3D & f)
00010 :m_mesh(mesh),m_velFunction(f),m_vPressure(m_mesh.numCells())
00011 {
00012 assert(f.n_components() == 3);
00013 m_vPressure=0.0;
00014 }
00015
00016 ConstVelocityModule::ConstVelocityModule(OrthoMesh &mesh, Function3D & f,Function3D &fPressure)
00017 :m_mesh(mesh),m_velFunction(f),m_vPressure(m_mesh.numCells())
00018 {
00019 assert(f.n_components() == 3);
00020 mesh.setCentralValuesFromFunction(fPressure,m_vPressure);
00021 }
00022
00023
00024
00025
00026 ConstVelocityModule::~ConstVelocityModule()
00027 {
00028
00029
00030 }
00031
00032 void ConstVelocityModule::getVelocitiesAtFaces(Matrix & vel)
00033 {
00034 m_mesh.setFacesValuesFromFunction(m_velFunction,vel);
00035 }
00036
00037
00038
00039
00040 void ConstVelocityModule::iterate(TransportBase &trans)
00041 {
00042
00043
00044
00045
00046 return;
00047
00048 }
00049
00050
00051
00052
00053
00054
00055
00056
00057 void ConstVelocityModule::getNormalVelocityAtFaces(VecDouble &vNormal)
00058 {
00059 assert(vNormal.size()==m_mesh.numFaces());
00060 OrthoMesh::Face_It face = m_mesh.begin_face();
00061 OrthoMesh::Face_It endFace = m_mesh.end_face();
00062
00063 for (;face!=endFace;face++)
00064 {
00065
00066 Point<3> P = face->barycenter();
00067 unsigned faceIndex = face->index();
00068 for (unsigned deg=0;deg<m_velFunction.n_components();deg++)
00069 {
00070 vNormal(faceIndex) = m_velFunction(P,face->getNormalOrientation());
00071 }
00072 }
00073 }
00074
00075
00076 const VecDouble& ConstVelocityModule::getPressureAtCells()
00077 {
00078 return m_vPressure;
00079 }
00080
00081
00082 void ConstVelocityModule::setDt(double dt)
00083 {
00084
00085 }