Nektar++
|
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <MultiRegions/ExpList.h>
#include <MultiRegions/ExpList1D.h>
#include <MultiRegions/ContField1D.h>
#include <MultiRegions/ContField2D.h>
#include <MultiRegions/ContField3D.h>
#include <MultiRegions/ContField3DHomogeneous1D.h>
#include <MultiRegions/ContField3DHomogeneous2D.h>
#include <LocalRegions/SegExp.h>
#include <LocalRegions/Expansion2D.h>
#include <SpatialDomains/MeshGraph2D.h>
Go to the source code of this file.
void CalcNonLinearForcing | ( | SpatialDomains::MeshGraphSharedPtr & | mesh, |
LibUtilities::SessionReaderSharedPtr & | session, | ||
string | fieldfile, | ||
Array< OneD, MultiRegions::ExpListSharedPtr > & | waveFields, | ||
MultiRegions::ExpListSharedPtr & | streak, | ||
Array< OneD, int > | Refindices, | ||
bool | symm | ||
) |
Definition at line 1684 of file FldCalcBCs.cpp.
References Nektar::SpatialDomains::eNeumann, Vmath::Fill(), npts, Vmath::Smul(), Vmath::Vadd(), Vmath::Vcopy(), Vmath::Vmul(), Vmath::Vvtvp(), and Nektar::LibUtilities::Write().
Referenced by main().
void Extractlayerdata | ( | Array< OneD, int > | Iregions, |
int | coordim, | ||
SpatialDomains::MeshGraphSharedPtr & | mesh, | ||
LibUtilities::SessionReaderSharedPtr & | session, | ||
SpatialDomains::BoundaryConditions & | bcs, | ||
Array< OneD, MultiRegions::ExpListSharedPtr > & | infields, | ||
MultiRegions::ContField1DSharedPtr & | outfieldx, | ||
MultiRegions::ContField1DSharedPtr & | outfieldy, | ||
MultiRegions::ExpListSharedPtr & | streak, | ||
bool | symm, | ||
Array< OneD, int > | Refindices, | ||
NekDouble | alpha, | ||
NekDouble | cr | ||
) |
Definition at line 692 of file FldCalcBCs.cpp.
References ASSERTL0, Nektar::StdRegions::StdExpansion::BwdTrans(), Nektar::MultiRegions::eS, Nektar::MultiRegions::eX, Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), Nektar::LocalRegions::Expansion1D::GetLeftAdjacentElementEdge(), Nektar::iterator, Vmath::Smul(), Vmath::Vcopy(), Vmath::Vmul(), and Vmath::Zero().
Referenced by main().
Array<OneD, int> GetReflectionIndex | ( | MultiRegions::ExpListSharedPtr | Exp, |
int | Ireg | ||
) |
Definition at line 637 of file FldCalcBCs.cpp.
References ASSERTL0, Nektar::NekConstants::kGeomFactorsTol, npts, and Vmath::Vmax().
Referenced by main().
Array<OneD, int> GetReflectionIndex2D | ( | MultiRegions::ExpListSharedPtr | wavefield | ) |
Definition at line 1911 of file FldCalcBCs.cpp.
References ASSERTL0, Nektar::NekConstants::kGeomFactorsTol, npts, and Vmath::Vmax().
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Below is the old function from GeomFactors1D::v_ComputeEdgeTangents. This However, the vectors were computed in the function below, but is never called and therefore was never working.
This utility therefore does not presently work, but the (now removed) function is kept here for reference.
– Chris Cantwell
void GeomFactors1D::v_ComputeEdgeTangents( const GeometrySharedPtr &geom, const int edge, const LibUtilities::PointsKey &to_key) { int k; int nquad= to_key.GetNumPoints(); Geometry2DSharedPtr g; ASSERTL0(g= boost::dynamic_pointer_cast<Geometry2D>(geom), "FAIL"); GeomFactorsSharedPtr gf = geom->GetMetricInfo();
cannot use m_type here GeomType gtype = gf->GetGtype(); GeomType gtype= m_type; m_tangent =Array<OneD, Array<OneD, NekDouble> >(m_coordDim); for( k=0; k< m_coordDim; ++k) { m_tangent[k] = Array<OneD, NekDouble>(nquad); }
int i;
DerivStorage deriv = GetDeriv(m_pointsKey); FillDeriv(deriv, m_pointsKey);
NekDouble fac;
Regular geometry case if((gtype == eRegular)||(gtype == eMovingRegular)) {
for(i = 0; i < m_coordDim; ++i) { Vmath::Fill(nquad, deriv[0][i][0],m_tangent[i],1); }
normalise fac = 0.0; for(i =0 ; i < m_coordDim; ++i) { fac += m_tangent[i][0]*m_tangent[i][0]; } fac = 1.0/sqrt(fac); for (i = 0; i < m_coordDim; ++i) { Vmath::Smul(nquad,fac,m_tangent[i],1,m_tangent[i],1); } }
else // Set up deformed tangents {
Array<OneD, NekDouble> jac(m_coordDim*nquad);
for(i = 0; i < m_coordDim; ++i) { for(int j=0; j<nquad; j++) { m_tangent[i][j] = deriv[0][i][j]; } }
normalise normal vectors Array<OneD,NekDouble> work(nquad,0.0); for(i = 0; i < m_coordDim; ++i) { Vmath::Vvtvp(nquad, m_tangent[i],1, m_tangent[i],1,work,1,work,1); }
Vmath::Vsqrt(nquad,work,1,work,1); Vmath::Sdiv(nquad,1.0,work,1,work,1);
for(i = 0; i < m_coordDim; ++i) { Vmath::Vmul(nquad, m_tangent[i],1,work,1,m_tangent[i],1); } } }
To create another bcs file comment everything from '//start' to '//end' decomment the lines which follow '//decomment' and run with the command: ./FldCalcBCs meshfile fieldfile fieldfile
Definition at line 109 of file FldCalcBCs.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, CalcNonLinearForcing(), Nektar::LibUtilities::SessionReader::CreateInstance(), Nektar::LibUtilities::ePolyEvenlySpaced, Extractlayerdata(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), GetReflectionIndex(), GetReflectionIndex2D(), Nektar::LibUtilities::Import(), Nektar::NekConstants::kNekUnsetDouble, Manipulate(), Nektar::SpatialDomains::MeshGraph::Read(), SetFields(), WriteBcs(), and WriteFld().
void Manipulate | ( | Array< OneD, int > | Iregions, |
int | coordim, | ||
SpatialDomains::MeshGraphSharedPtr & | mesh, | ||
SpatialDomains::BoundaryConditions & | bcs, | ||
Array< OneD, MultiRegions::ExpListSharedPtr > & | infields, | ||
Array< OneD, MultiRegions::ExpList1DSharedPtr > & | outfieldx, | ||
Array< OneD, MultiRegions::ExpList1DSharedPtr > & | outfieldy, | ||
MultiRegions::ExpListSharedPtr & | streak | ||
) |
void SetFields | ( | SpatialDomains::MeshGraphSharedPtr & | mesh, |
SpatialDomains::BoundaryConditionsSharedPtr & | boundaryConditions, | ||
LibUtilities::SessionReaderSharedPtr & | session, | ||
Array< OneD, MultiRegions::ExpListSharedPtr > & | Exp, | ||
int | nvariables | ||
) |
< physical length in X direction (if homogeneous)
< physical length in Y direction (if homogeneous)
< physical length in Z direction (if homogeneous)
< number of points in X direction (if homogeneous)
< number of points in Y direction (if homogeneous)
< number of points in Z direction (if homogeneous)
Parameter for homogeneous expansions
Definition at line 474 of file FldCalcBCs.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::LibUtilities::eFourier, and Nektar::LibUtilities::eFourierEvenlySpaced.
Referenced by main().
void WriteBcs | ( | string | variable, |
int | region, | ||
string | fieldfile, | ||
SpatialDomains::MeshGraphSharedPtr & | mesh, | ||
MultiRegions::ContField1DSharedPtr & | outregionfield | ||
) |
Definition at line 1962 of file FldCalcBCs.cpp.
References Nektar::LibUtilities::Write().
Referenced by main().
void WriteFld | ( | string | outfile, |
SpatialDomains::MeshGraphSharedPtr & | mesh, | ||
Array< OneD, MultiRegions::ExpListSharedPtr > & | fields | ||
) |
Definition at line 1990 of file FldCalcBCs.cpp.
References ASSERTL0, and Nektar::LibUtilities::Write().
Referenced by main().