Commit f95b5c6c authored by Florian Wittkamp's avatar Florian Wittkamp
Browse files

Smaller changes in doxygen and timestep

parent 079e3eca
......@@ -10,5 +10,6 @@ Documentation:
Requierment:
- Library [LAMA](https://www.libama.org)
- Compiler with C++11 support
Tested with g++ (4.9.3).
......@@ -796,7 +796,7 @@ FILE_PATTERNS =
# be searched for input files as well.
# The default value is: NO.
RECURSIVE = NO
RECURSIVE = YES
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
......
CC=g++
CFLAGS=-std=c++11 -Wall -fopenmp
CFLAGS=-std=c++11 -fopenmp -Wall -Wextra -Werror
IFLAGS=-I${SCAI_ROOT}/include -L${SCAI_ROOT}/lib -DSCAI_ASSERT_LEVEL_ERROR -DSCAI_LOG_LEVEL_ERROR -DSCAI_TRACE_OFF
LDFLAGS=-lscai_lama -lscai_solver -lscai_dmemo -lscai_sparsekernel -lscai_utilskernel -lscai_blaskernel -lscai_kregistry -lscai_hmemo -lscai_tasking -lscai_tracing -lscai_logging -lscai_common
......
......@@ -34,20 +34,25 @@ class Modelparameter
{
public:
Modelparameter(){}; //< Default constructor
//! Default constructor.
Modelparameter(){};
Modelparameter(hmemo::ContextPtr ctx, dmemo::DistributionPtr dist, lama::Scalar M, lama::Scalar rho);
Modelparameter(hmemo::ContextPtr ctx, dmemo::DistributionPtr dist, std::string filename);
Modelparameter(const Modelparameter& rhs); //< Copy Constructor
//! Copy Constructor.
Modelparameter(const Modelparameter& rhs);
~Modelparameter(){}; //< Destructor, releases all allocated resources.
//! Destructor, releases all allocated resources.
~Modelparameter(){};
void init(hmemo::ContextPtr ctx, dmemo::DistributionPtr dist, lama::Scalar M, lama::Scalar rho);
void init(hmemo::ContextPtr ctx, dmemo::DistributionPtr dist, std::string filename);
void write(std::string filename);
lama::DenseVector<ValueType> pi; ///< Vector storing first Lame-Parameter
lama::DenseVector<ValueType> density; ///< Vector storing Density
/// Vector storing first Lame-Parameter.
lama::DenseVector<ValueType> pi;
/// Vector storing Density.
lama::DenseVector<ValueType> density;
private:
......@@ -154,4 +159,8 @@ void Modelparameter<ValueType>::read(std::string filename){
pi.readFromFile(filename_pi);
density.readFromFile(filename_density);
};
\ No newline at end of file
};
......@@ -39,6 +39,12 @@ void timesteps( lama::DenseVector<ValueType>& seismogram, lama::DenseVector<Valu
// Invert Density Values before the time stepping
model.density.invert();
// create new Vector(Pointer) with same configuration as vZ
common::unique_ptr<lama::Vector> helpPtr( vZ.newVector() );
// get Reference of VectorPointer
lama::Vector& help = *helpPtr;
for ( IndexType t = 0; t < NT; t++ )
{
if( t % 100 == 0 && t != 0)
......@@ -46,22 +52,20 @@ void timesteps( lama::DenseVector<ValueType>& seismogram, lama::DenseVector<Valu
HOST_PRINT( comm, "Calculating time step " << t << " from " << NT << "\n" );
}
// create new Vector(Pointer) with same configuration as vZ
common::unique_ptr<lama::Vector> helpPtr( vZ.newVector() );
// get Reference of VectorPointer
lama::Vector& help = *helpPtr;
// update velocity, v_factor is 'DT / DH'
// velocity z: vZ = vZ + DT / ( DH * rho ) * A * p;
help=v_factor * A * p; // Update=DT / ( DH) * A * p
vZ += help.scale(model.density); // Update+1/RHO
// velocity x: vX = vX + DT / ( DH * rho ) * B * p;
help=v_factor * B * p; // Update=DT / ( DH) * B * p
vX += help.scale(model.density); // Update+1/RHO
// velocity y: vY = vY + DT / ( DH * rho ) * C * p;
help=v_factor * C * p; // Update=DT / ( DH) * C * p
vY += help.scale(model.density); // Update+1/RHO
// pressure update
help = DH_INV * D * vZ;
help += DH_INV * E * vX;
......@@ -73,6 +77,7 @@ void timesteps( lama::DenseVector<ValueType>& seismogram, lama::DenseVector<Valu
// should be used rarely
// TODO: can do this by index operator[] --> no need for DenseVector<>, can use Vector instead
p.setValue( source_index, p.getValue( source_index ) + source.getValue( t ) );
seismogram.setValue( t, p.getValue( seismogram_index ) );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment