NasCar
Loading...
Searching...
No Matches
Macros | Functions
LevelSet.c File Reference

Compute the Level Set function (signed distance function to the body) The main objective is to compute the Level Set function [19] from an initial body Lagrangian mesh. More...

#include "mpi.h"
#include "petscdmda.h"
#include "petscksp.h"
#include "petscpc.h"
#include "struct.h"
#include "LevelSet.h"
#include "Body_Cyl.h"
#include "Body_Fish.h"
#include "Body_Jelly.h"
#include "Body_Ray.h"
#include "Body_Electric.h"
#include "Body_Bateau.h"
#include "Body_Serpent.h"
#include "Body_Energie.h"
#include "Body_Heart.h"
#include "Body_Membrane.h"
#include "Body_Cylinder.h"
#include "Body_Anneau.h"
#include "Body_Eel.h"
#include "Body_Dolphin.h"
#include "Body_Dolphin2.h"
#include "Body_Tore.h"
#include "Body_Snake.h"
#include "Vectors.h"
Include dependency graph for LevelSet.c:

Macros

#define __FUNCT__   "body_geometry"
 
#define __FUNCT__   "body_deformation"
 
#define __FUNCT__   "LevelSet_Box"
 
#define __FUNCT__   "body_rotationdef"
 
#define __FUNCT__   "LevelSet_Export"
 
#define __FUNCT__   "body_masscenter"
 
#define __FUNCT__   "body_inertia"
 
#define __FUNCT__   "LevelSet"
 
#define __FUNCT__   "body_normal"
 
#define __FUNCT__   "LevelSetElast"
 
#define __FUNCT__   "reinitialization"
 
#define __FUNCT__   "signe"
 

Functions

PetscErrorCode body_geometry (Grid grid, Obs *obs)
 
PetscErrorCode body_deformation (Simu simu, Grid grid, Obs *obs)
 
PetscErrorCode LevelSet_Box (Grid grid, Obs *obs)
 
PetscErrorCode body_rotationdef (Obs *obs)
 
PetscErrorCode LevelSet_Export (Simu simu, Proc proc, Obs *obs)
 
PetscErrorCode body_masscenter (Obs *obs)
 
PetscErrorCode body_inertia (Obs *obs)
 
PetscErrorCode LevelSet (Simu simu, Grid grid, Proc proc, Fields vec, Arrays arr, Obs *obs)
 
PetscErrorCode body_normal (Obs *obs)
 
PetscErrorCode LevelSetElast (Simu simu, Grid grid, Proc proc, Fields vec, Arrays arr, Obs *obs)
 
PetscErrorCode reinitialization (Simu *simu, Grid grid, Proc proc, Fields vec, Arrays arr)
 
double signe (Grid grid, double psi)
 

Detailed Description

Compute the Level Set function (signed distance function to the body) The main objective is to compute the Level Set function [19] from an initial body Lagrangian mesh.

Version
0.0
Author
Michel Bergmann
Date
2023-03-03

Function Documentation

◆ body_deformation()

PetscErrorCode body_deformation ( Simu  simu,
Grid  grid,
Obs obs 
)

Deformation and motion of the body.

It can be imposed, or results from the forces and tirques exerted by the fluid o the body.

◆ body_geometry()

PetscErrorCode body_geometry ( Grid  grid,
Obs obs 
)

Load the body geometry, starting from the choice in INPUT.DAT

◆ body_inertia()

PetscErrorCode body_inertia ( Obs obs)

Computation of the body intertia matrix

◆ body_masscenter()

PetscErrorCode body_masscenter ( Obs obs)

Computation of the body center of mass

◆ body_normal()

PetscErrorCode body_normal ( Obs obs)

Computation of outward unitary normals to the body (at each mesh grid face center)

◆ body_rotationdef()

PetscErrorCode body_rotationdef ( Obs obs)

Computation of the rotation induced by the deformation

This will be soustracted to the effective rotation given by the Torques (procrustes analysis)

◆ LevelSet()

PetscErrorCode LevelSet ( Simu  simu,
Grid  grid,
Proc  proc,
Fields  vec,
Arrays  arr,
Obs obs 
)

Computation of Level Set (signed distance function) associated to the body

Here, positive values are inside the body

◆ LevelSet_Box()

PetscErrorCode LevelSet_Box ( Grid  grid,
Obs obs 
)

Computation of the size of the box in which the Level Set is Computed

It is usually the minimal Cartesian box including all the body.

◆ LevelSet_Export()

PetscErrorCode LevelSet_Export ( Simu  simu,
Proc  proc,
Obs obs 
)

Exportation of the body Lagrangian markers (vtk): this is only to check to body

◆ LevelSetElast()

PetscErrorCode LevelSetElast ( Simu  simu,
Grid  grid,
Proc  proc,
Fields  vec,
Arrays  arr,
Obs obs 
)

Computation of the Level Set for elastic bodies

Not a distance function, but only positive values inside the body, and negatice outside

◆ reinitialization()

PetscErrorCode reinitialization ( Simu simu,
Grid  grid,
Proc  proc,
Fields  vec,
Arrays  arr 
)

Reinitialization step the the elastic body to obtain a signed distance function

◆ signe()

double signe ( Grid  grid,
double  psi 
)

Computation of the sign