Hi,
in the context of elastodynamics, i want to solve a problem of soil-structure interaction with some inclusions on the domain with different material properties, and i want to define these material properties as a DG Function using a MeshFunctions (type double), e.g., i tried this without succes:
using namespace dolfin;
// Inclussion
class Omega0 : public SubDomain
{
bool inside(const Array<double>& x, bool on_boundary) const
{
if (x[1] <= -0.75 && x[1] >= -1.75 && std::abs(x[0]) <= 1)
return true;
else
return false;
}
};
// Mesh dimesions
double b = 0.3, L = 2.5, h = 2.5, Lpml = 1;
Point vertex_1(-(L + Lpml), 0);
Point vertex_2(L + Lpml, -(h + Lpml));
// Density of the mesh
int nx = 30, ny = 0.5*nx;
int main()
{
// Mesh
RectangleMesh mesh(vertex_1, vertex_2, nx, ny, "left/right");
// Create mesh functions over the cells
MeshFunction<double> density(mesh, mesh.topology().dim());
density = 1.0; // Set all domain density equal to 1
Omega0 Omega_0;
Omega_0.mark(density, 2.0); // Set density on Omega0 equal to 2
DG0::FunctionSpace Vdg(mesh);
Function rho(Vdg);
// This is what i want to do (or something similar)
rho.vector() = density.values(); // ¿GenericVector = Array?
}
it is possible to do something like this?