Skip to content

Commit

Permalink
fix -Werror
Browse files Browse the repository at this point in the history
  • Loading branch information
nqdu committed Sep 30, 2024
1 parent 8f579c6 commit 6cfdc15
Show file tree
Hide file tree
Showing 6 changed files with 507 additions and 506 deletions.
Binary file modified bin/surf24
Binary file not shown.
Binary file modified bin/surftti
Binary file not shown.
70 changes: 40 additions & 30 deletions code_gen/aniso_code_gen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,19 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"def replace_fortran_str(text):\n",
" #temp:str = text.replace(\"+ &\\n \",\" + \")\n",
" temp:str = text.replace(\" &\\n \",\"\")\n",
" temp = temp.replace(\"+\",\"+ \")\n",
" temp = temp.replace(\"-\",\"- \")\n",
" temp = temp.replace(\"+\",\" + \")\n",
" temp = temp.replace(\"-\",\" - \")\n",
" temp = temp.replace(\" -\",\" -\")\n",
" temp = temp.replace(\" +\",\" +\")\n",
" temp = temp.replace(\"- \",\"- \")\n",
" temp = temp.replace(\"+ \",\"+ \")\n",
" #temp:str = temp.replace(\"- &\\n \",\" - \")\n",
" \n",
"\n",
Expand Down Expand Up @@ -167,7 +171,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -363,27 +367,6 @@
"fileid.close()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sp.diff(Lag,om)\n",
"\"\""
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -502,7 +485,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -551,9 +534,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"80 305\n",
"152 305\n",
"224 305\n",
"296 305\n",
"temp(:) = A*sinphi*sinth0**2*cosphi*costh0**2 + C*sinphi*sinth0 &\n",
" **2*cosphi*costh0**2 - 2*F*sinphi*sinth0**2*cosphi &\n",
" *costh0**2 - 4*L*sinphi*sinth0**2*cosphi*costh0* &\n",
" *2 + L*sinphi*sinth0**2*cosphi - N*sinphi*sinth0**2*cosphi &\n",
" \n"
]
}
],
"source": [
"text = 'temp(:) = A*sin(dphi)*sin(theta0)**2*cos(dphi)*cos(theta0)**2 + C*sin( &\\n dphi)*sin(theta0)**2*cos(dphi)*cos(theta0)**2 - 2*F*sin(dphi)*sin &\\n (theta0)**2*cos(dphi)*cos(theta0)**2 - 4*L*sin(dphi)*sin(theta0) &\\n **2*cos(dphi)*cos(theta0)**2 + L*sin(dphi)*sin(theta0)**2*cos( &\\n dphi) - N*sin(dphi)*sin(theta0)**2*cos(dphi)'\n",
"temp = replace_fortran_str1(text)\n",
Expand All @@ -562,9 +561,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"'temp(:) = A*sinphi*sinth0**2*cosphi*costh0**2 + C*sinphi*sinth0 &\\n **2*cosphi*costh0**2 - 2*F*sinphi*sinth0**2*cosphi &\\n *costh0**2 - 4*L*sinphi*sinth0**2*cosphi*costh0* &\\n *2 + L*sinphi*sinth0**2*cosphi - N*sinphi*sinth0**2*cosphi &\\n '"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"temp"
]
Expand Down
Binary file added doxygen/swdtti.pdf
Binary file not shown.
9 changes: 5 additions & 4 deletions src/prepare_tti_matrices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ prepare_matrices(double phi)
K1mat.resize(msize * msize);
K2mat.resize(msize * msize);
Emat.resize(msize * msize);
std::fill(Mmat.begin(),Mmat.end(),(0.,0.));
std::fill(K1mat.begin(),K1mat.end(),(0.,0.));
std::fill(K2mat.begin(),K2mat.end(),(0.,0.));
std::fill(Emat.begin(),Emat.end(),(0.,0.));
const dcmplx ZERO{0.,0.};
std::fill(Mmat.begin(),Mmat.end(),ZERO);
std::fill(K1mat.begin(),K1mat.end(),ZERO);
std::fill(K2mat.begin(),K2mat.end(),ZERO);
std::fill(Emat.begin(),Emat.end(),ZERO);

// compute M/K/E for gll/grl layer
std::array<double,NGRL> dphi;
Expand Down
Loading

0 comments on commit 6cfdc15

Please sign in to comment.